0
$\begingroup$

Rosanswers logo

Hello ROS community,

I migrated from ROS kinetic to melodic recently and I found some bugs related to rviz visualization markers. For example, the points scale does not change and it is displayed always with a same color. I never have this kind of problem with kinetic and also with indigo. It is important to refer that I have tried already to reinstall ROS and also I copied the Markers: Points and Lines (C++) tutorial and the problem persist. In addition, this only happens with Points and Sphere Lists, because I tried with Line Strips and Line Lists and worked well.

The used algorithm is presented next:

#include <franka_udrilling/udrilling_state.h>
#include <tf/transform_broadcaster.h>
#include <visualization_msgs/Marker.h>

int main(int argc, char **argv){

    ros::init(argc, argv, "test_node");
    ros::NodeHandle nh;
    franka_udrilling::uDrillingState panda(nh);

    
    ros::Publisher marker_pub = nh.advertise<visualization_msgs::Marker>("visualization_marker", 10);

    visualization_msgs::Marker points, line_strip;
    points.header.frame_id = line_strip.header.frame_id = "/panda_link0";
    points.header.stamp = line_strip.header.stamp = ros::Time::now();
    points.ns = line_strip.ns = "points_and_lines";
    points.id = 0;
    line_strip.id = 1;
    points.action = line_strip.action = visualization_msgs::Marker::ADD;
    points.type = visualization_msgs::Marker::POINTS;
    line_strip.type = visualization_msgs::Marker::LINE_STRIP;

    points.pose.orientation.w = line_strip.pose.orientation.w = 1.0;

    // POINTS markers use x and y scale for width/height respectively
    points.scale.x = 0.01;
    points.scale.y = 0.01;

    // LINE_STRIP/LINE_LIST markers use only the x component of scale, for the line width
    line_strip.scale.x = 0.01;

    // Set the color -- be sure to set alpha to something non-zero!
    points.color.a = 1.0;
    points.color.r = 1.0f;
    points.color.g = 0.0f;
    points.color.b = 0.0f;

    // Line strip is blue
    line_strip.color.a = 1.0;
    line_strip.color.b = 1.0;

    // ---------------------------------------------------------------------------
    // GET INITIAL POSE
    // ---------------------------------------------------------------------------
    Eigen::Matrix4d O_T_EE;
    Eigen::VectorXd pose(7,1);


    // ---------------------------------------------------------------------------
    // MAIN LOOP
    // ---------------------------------------------------------------------------
    ros::Rate loop_rate(100);
    int count = 0;
    while (ros::ok()){

        O_T_EE = panda.O_T_EE;
        pose = panda.robotPose(O_T_EE);

        geometry_msgs::Point p;
        p.x = pose[0];
        p.y = pose[1];
        p.z = pose[2];

        points.points.push_back(p);
        line_strip.points.push_back(p);

        // if(line_strip.points.size() > 30){
        //   line_strip.points.erase(line_strip.points.begin());
        // }
        //
        // if(points.points.size() > 30){
        //   points.points.erase(points.points.begin());
        // }
        
        marker_pub.publish(points);
        // marker_pub.publish(line_strip);

        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
        break;

        ros::spinOnce();
        loop_rate.sleep();
        count++;
    }
   
    return 0;
}

Best Regards, Hélio Ochoa

As you can see in the pictures bellow the line markers works without any problems, but the point markers are completely invisible.

image description(/upfiles/15731284289094426.png)image description


Originally posted by Ochoa92 on ROS Answers with karma: 13 on 2019-10-30

Post score: 0


Original comments

Comment by gvdhoorn on 2019-10-31:
There is a good chance this is not a "bug" in the markers, but ros/urdfdom_headers#41, which is a known issue on Bionic+Melodic installs when using non US.UTF-8 locale settings (or any locale that uses a , instead of a . for numbers with decimals).

Please see #q272692 for an older Q&A about this.

Comment by gvdhoorn on 2019-10-31:
Please attach your screenshot directly to the question. I've given you sufficient karma for that.

Comment by Ochoa92 on 2019-11-04:
Thank you for your help. I tried what you suggest, but unfortunately in my case did not work. Do you have any other solution?

Comment by gvdhoorn on 2019-11-04:
As always: "does not work" is not a sufficient description of any problem.

Can you describe what exactly you've tried? Be very specific, it's crucial to understand which commands, in which terminals and in what order you've used.

It could well be that your problem is actually not linked to the locale issue, but for now I cannot conclude that.

Comment by gvdhoorn on 2019-11-04:
@Ochoa92: can you process my earlier comment here? Thanks.

Comment by Ochoa92 on 2019-11-04:
Sorry. Basically I put the following line in my ".bashrc" file and then I restart the terminal: export LC_NUMERIC="en_US.UTF-8"

Comment by Ochoa92 on 2019-11-07:
As you can see in the screenshots the points have no color and a very small scale.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

A recent Q&A seems to have reported a similar issue, and it turned out it was a problem with the video drivers.

Could you check #q337916?


Originally posted by gvdhoorn with karma: 86574 on 2019-11-20

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Ochoa92 on 2019-11-20:
I updated my gpu drivers and problem solved. Thank for your help.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.