rviz does not display Gazebo robot
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
It is supposed that I should select "cameradepthframe" 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?
Asked by Kansai on 2021-03-20 05:36:08 UTC
Answers
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
.
Asked by sonelu on 2021-03-20 08:41:08 UTC
Comments
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
Asked by Kansai on 2021-03-20 09:42:31 UTC
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
Asked by sonelu on 2021-03-20 10:41:40 UTC
Comments