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

  1. In the left menu, navigate to Global Options and change Fixed Frame from map to base_footprint.
  2. Click on the Add button on the left, scroll down, and double-click on RobotModel.
  3. Open the new RobotModel menu, locate Description Topic, and click on the empty space to the right.
  4. Click on the Add button again, scroll down, and double-click on TF.
  5. If you want to see through the model, open RobotModel and reduce the Alpha (transparency) value from 1 to 0.8, for example.
  6. 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