urdf/XML/link - ROS Wiki
how to Publish the TFs from the terminal
run robot state publisher
ros2 run robot_state_publisher robot_state_publisher --ros-args -p robot_description:="$(xacro /home/san/Public/ros_ws/src/my_robot_description/urdf/my_robot.urdf.xacro)"
run joint state publisher
ros2 run joint_state_publisher_gui joint_state_publisher_gui
run rviz
ros2 run rviz2 rviz2
change rviz configurations
- In the left menu, navigate to Global Options and change Fixed Frame from
map
to base_footprint
.
- After this, the Global Status: Error should change to Global Status: OK.
- Click on the Add button on the left, scroll down, and double-click on RobotModel.
- A new menu for RobotModel will appear on the left side of RViz.
- Open the new RobotModel menu, locate Description Topic, and click on the empty space to the right.
- A drop-down menu will appear; select /robot_description.
- After this, the robot model should appear on the screen.
- Click on the Add button again, scroll down, and double-click on TF.
- This will open a new menu, and the TFs will appear on the screen.
- If you want to see through the model, open RobotModel and reduce the Alpha (transparency) value from
1
to 0.8
, for example.
- You can remove extra menus like Views (on the right) and Time (at the bottom) to get more space for the robot visualization.
save this rviz configuration
rviz window —> save config
ros2 run rviz2 rviz2 -d /home/san/Public/ros_ws/src/my_robot_description/rviz/urdf_config.rviz