ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Everything looked good to me. So I just tested your code and the markers popped up in rviz no problem. I'm guessing that your problem is most likely related to the Fixed Frame in rviz. If you are only running your node and rviz, then there are no nodes publishing on the /tf topic (via a tf broadcaster). Thus rviz has no way of knowing what frames are available. Try manually typing my_frame in for the Fixed Frame in rviz, and I'm guessing your markers will show up.

To see that this is the issue, try starting a static transform publisher. Then rviz will be able to correctly select a fixed frame. E.g.:

rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 world my_frame