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

rviz does not display Gazebo robot

asked 2021-03-20 05:36:08 -0600

Kansai gravatar image

I am trying to display in rviz my Gazebo robot following the book 'Programming Robots with ROS"code here I run the gazebo simulator Then I run rosrun rviz rviz and I get this

image description

It is supposed that I should select "camera_depth_frame" from the Fixed Frame to the left, but you can see many red areas (errors) ("No transform")

Why is this happening and how can I correct it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-03-20 08:41:08 -0600

sonelu gravatar image

updated 2021-03-20 08:45:18 -0600

Most likely you have not started a robot_state_publisher node. This node subscribes to /joint_states and uses the robot_description parameter to calculate the "transforms" for all joints, that are published under /tf topic. rviz uses the messages on this topic to represent the robot.

If you do have a robot_state_publisher then probably you don't have a node publishing any /joint_states messages.

If you also have a node that publishes that, then check if you have the messages published with different namespace, thus requiring mapping to the expected namespace for robot_state_publisher and tf.

edit flag offensive delete link more


I did rosnode list and there is only gazebo, gazebo_gui and rosout. I don't see a robot_state_publisher. I am trying to use the turtlebot robot in Gazebo, by launchin roslaunch turtlebot3_gazebo turtlebot3_world.launch so I don't know what else I should do to start the robot_state_publisher. Any pointers on this will be greatly appreciated

Kansai gravatar image Kansai  ( 2021-03-20 09:42:31 -0600 )edit

Instead of starting rviz with rossun rviz rviz try starting using the launch file from turtlebot3:

roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch

this should launch also the robot_state_publisher

sonelu gravatar image sonelu  ( 2021-03-20 10:41:40 -0600 )edit

Question Tools

1 follower


Asked: 2021-03-20 05:36:08 -0600

Seen: 890 times

Last updated: Mar 20 '21