diff_drive_controller
This file is ai generated. Do not edit this file directly. Instead, edit the node source code and run the generate-node-docs command to update this file.
Description
The differential drive controller node that calculates odometry information for the TurtleBot3. This node subscribes to joint states and IMU data, computes the robot’s position and orientation, and publishes odometry messages and TF transforms.
Publishers
odom(nav_msgs/Odometry)Odometry information including pose and twist in the odometry frame
/tf(tf2_msgs/TFMessage)Transform from odometry frame to base_footprint frame (if
odometry.publish_tfis enabled)
Subscribers
joint_states(sensor_msgs/JointState)Joint position and velocity information from the wheels
imu(sensor_msgs/Imu)IMU orientation data (if
odometry.use_imuis enabled)
Services
reset_odometry(std_srvs/Trigger)Reset the odometry to zero position and orientation
Parameters
odometry.frame_id(string, default: “odom”)Frame ID for the odometry parent frame
odometry.child_frame_id(string, default: “base_footprint”)Frame ID for the odometry child frame
odometry.use_imu(bool, default: false)Use IMU data for orientation in odometry calculations
odometry.publish_tf(bool, default: false)Publish TF transform from odometry frame to base_footprint
Example Usage
The diff_drive_controller node is typically launched alongside the turtlebot3_node and does not need to be started separately. However, you can reset the odometry using:
ros2 service call /reset_odometry std_srvs/srv/Trigger
View the odometry data:
ros2 topic echo /odom
View the transform tree:
ros2 run tf2_tools view_frames