turtlebot3_node
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 main TurtleBot3 hardware interface node that communicates with the OpenCR board via USB serial connection. This node handles motor control, sensor data acquisition, and publishes various sensor states including IMU, battery, and joint information.
Publishers
battery_state(sensor_msgs/BatteryState)Battery voltage and charge state information
imu(sensor_msgs/Imu)IMU orientation, angular velocity, and linear acceleration data
magnetic_field(sensor_msgs/MagneticField)Magnetic field measurements from the IMU magnetometer
sensor_state(turtlebot3_msgs/SensorState)Custom sensor state message containing bumper, cliff, illumination, IR, sonar, and other sensor data
joint_states(sensor_msgs/JointState)Joint positions, velocities, and efforts for the wheel joints
Subscribers
cmd_vel(geometry_msgs/Twist or geometry_msgs/TwistStamped)Velocity commands for controlling the robot’s linear and angular motion
Accepts both Twist (ROS 2 Humble) and TwistStamped (later distros) message types
Services
motor_power(std_srvs/SetBool)Enable or disable motor power
reset(std_srvs/Trigger)Reset the OpenCR board
sound(turtlebot3_msgs/Sound)Play predefined sounds through the OpenCR buzzer
Parameters
opencr.id(int, default: 200)Dynamixel ID of the OpenCR board
opencr.baud_rate(int, default: 1000000)Baud rate for serial communication with OpenCR
opencr.protocol_version(float, default: 2.0)Dynamixel protocol version
motors.profile_acceleration_constant(float, default: 214.577)Conversion constant for motor acceleration profile
motors.profile_acceleration(float, default: 0.0)Motor acceleration profile in rev/min²
wheels.separation(float, default: 0.160)Distance between the left and right wheels in meters
wheels.radius(float, default: 0.033)Radius of the wheels in meters
sensors.bumper_1(uint8, default: 0)Enable/disable bumper sensor 1
sensors.bumper_2(uint8, default: 0)Enable/disable bumper sensor 2
sensors.illumination(uint8, default: 0)Enable/disable illumination sensor
sensors.ir(uint8, default: 0)Enable/disable IR sensor
sensors.sonar(uint8, default: 0)Enable/disable sonar sensor
Example Usage
Launch the TurtleBot3 node with default USB port:
ros2 run turtlebot3_node turtlebot3_node
Launch with a custom USB port:
ros2 run turtlebot3_node turtlebot3_node -i /dev/ttyUSB0
Enable motor power using service:
ros2 service call /motor_power std_srvs/srv/SetBool "{data: true}"
Send velocity commands:
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.1}, angular: {z: 0.5}}"