This ROS2 package publishes static transforms for a robot described by a URDF file. It is designed to work as a standalone TF publisher, even in environments where standard tools like joint_state_publisher might be missing.
- Package Name:
robot_tf_publisher - Main Nodes:
robot_state_publisher: Publishes TFs based on the URDF.dummy_joint_publisher: A custom Python node that publishes static zero-values for wheel joints (wheel_left_revolute,wheel_right_revolute) to ensure a complete TF tree.
robot_tf_publisher/
├── CMakeLists.txt # Build configuration
├── package.xml # Package manifest and dependencies
├── README.md # This documentation
├── launch/
│ └── tf_publisher.launch.py # Main launch file
├── urdf/
│ └── robot.urdf # Robot description (URDF)
└── scripts/
└── dummy_joint_publisher.py # Custom joint state publisher
robot_state_publisherlaunchlaunch_rosrclpy(for the dummy joint publisher)
Note: This package replaces the standard joint_state_publisher with a custom lightweight script to avoid dependency issues.
To build the package, run the following from your workspace root:
# Source ROS2 environment (if not already sourced)
source /opt/ros/humble/setup.bash
# Build the package
colcon build --packages-select robot_tf_publisherAfter building, source the install setup and launch the publisher:
source install/setup.bash
ros2 launch robot_tf_publisher tf_publisher.launch.pyThis will:
- Load
urdf/robot.urdf. - Start
robot_state_publisherwith the robot description. - Start
dummy_joint_publisherto publish joint states. - Publish the full TF tree for the robot.