Ask Your Question
1

Reasons for marker or markerarray to be invisible in rviz?

asked 2016-03-04 14:01:19 -0600

vignesh gravatar image

I am working on driverless cars for motion planning.The car environment was already built (like odometry,car pose..)and my part was building planning algorithm.I got some trajectories,paths,goal position as markers from planning part..first I am running launch file related to car environment and then running the launch file related to planning with rviz now so that I can visualize everything together...now the problem was that I am getting all markers in rviz (status ok in display panel) but I couldnt able to visualize the markers generated by planner alone....but it is getting published while doing rostopic echo!! What are possible reasons for markers to be not visible in rviz in this case?

Any help is much appreciated!

P.S: I set alpha to 1 in all markers,and all the markers in both car environment and planning part are having same marker header...

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2016-03-04 15:49:48 -0600

robustify gravatar image

Here is a list of things that, if not done, could make the marker not show up as expected:

  • Set the scale of the marker. By default, the scale is (0,0,0), which will make the marker infinitesimal and therefore invisible.
  • Make sure the transparency is set. By default, the 'a' field of the marker color is 0, which will make the marker completely transparent.
  • Set the orientation of the marker. By default, all quaternion parameters are zero, which is an invalid quaternion. Set w to 1 to initialize the orientation.
  • Update the time stamp of the marker when you update its properties.
  • Make sure the frame ID of the marker exists in the TF tree, or is the same frame as the fixed frame in Rviz.
  • If publishing a marker array, make sure the 'id' field of each array element is unique. Otherwise, only the marker that was added last will appear.

If all of the above points are verified, then do a sanity check on the position of the marker. The simplest way is to 'rostopic info' the marker topic. Make sure the coordinates make sense.

I hope this helps!

edit flag offensive delete link more

Comments

Other potential reasons: - The "Marker" display is not added to the rviz view yet (Click "Add" and insert it) - The "Marker" topic that the rviz GUI subscribes to by default does not have a slash. Select the correct topic (with slash) from the list to make it work. (Goddamn)

fvd gravatar imagefvd ( 2017-07-07 20:25:32 -0600 )edit
0

answered 2016-12-15 15:39:00 -0600

dinesh gravatar image

updated 2016-12-15 15:39:26 -0600

The reason is if one of the value of x,y,z if is NAN than all other markers becomes invisible also, so u should first check the values of x,y,z it should not be NAN than u can easily send any number of marker as u want as in this example:

   if(!isnan(x[i].data) && !isnan(y[i].data) && !isnan(z[i].data))  {  
     p.x = x[i].data; p.y=y[i].data; p.z=z[i].data; std::cout<<i<<std::endl;
     points.points.push_back(p);
     marker_pub.publish(points);
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-03-04 14:01:19 -0600

Seen: 2,340 times

Last updated: Dec 15 '16