Rosanswers logo


I need to display markers (currently few arrows, showing path for robot) at a fixed point wrt my simulated environment. The environment has turtlebot and few objects.

While publishing markers if I set marker.header.frame_id = "/odom", then I get the desired result as long as robot does not collide or I don't reset the environment.

Before publishing the markers if I call service /gazebo/get_model_state and get the robot state, and use that to apply inverse transformation to the markers, and use /base_link in marker.header.frame_id, then I get what I need.

But I am sure there must be a simpler way to do this. What should be my frame in marker.header.frame_id


how can I use TF to do this easily. As of now I am using only 2D inverse transformation, so when robot collides then for some time the markers are displayed at different location.

I am using electric on Ubuntu 11.10

Originally posted by aknirala on ROS Answers with karma: 339 on 2013-03-29

Post score: 0


1 Answer 1


Rosanswers logo

If you assign a timestamp to the marker, or if the fixed frame in RViz is set to the same frame that the marker is transmitted in, it will always stay at a fixed location in RViz.

Originally posted by dgossow with karma: 1444 on 2013-03-29

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by aknirala on 2013-03-29:
Yes, of course, but if I choose an arbitrary (diff) name for marker frame than robot and other things (point cloud etc) are not displayed. How can I make all of them + fixed markers display simultaneously. There should be some global frame or sth else (I mean simulations should have this advantage)

Comment by dgossow on 2013-04-01:
So, you want Gazebo to send a transform between base_link and the world frame?

Comment by dgossow on 2013-04-01:
Maybe this answers your question: http://answers.ros.org/question/12110/visualizing-objects-in-rviz/

Comment by aknirala on 2013-04-15:
Reg link at pastebin.com/hcipigtf I couldn't understand the code (nt gd wd python). Could you plz explain how It's reading (one) object position from Gazebo and publishing transformation between world frame, robot base_link and object link. I guess for this I don't need to load URDF to param server.


Your Answer

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