# 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](http://docs.ros.org/api/sensor_msgs/html/msg/BatteryState.html)) - Battery voltage and charge state information - `imu` ([sensor_msgs/Imu](http://docs.ros.org/api/sensor_msgs/html/msg/Imu.html)) - IMU orientation, angular velocity, and linear acceleration data - `magnetic_field` ([sensor_msgs/MagneticField](http://docs.ros.org/api/sensor_msgs/html/msg/MagneticField.html)) - Magnetic field measurements from the IMU magnetometer - `sensor_state` ([turtlebot3_msgs/SensorState](https://github.com/ROBOTIS-GIT/turtlebot3_msgs)) - Custom sensor state message containing bumper, cliff, illumination, IR, sonar, and other sensor data - `joint_states` ([sensor_msgs/JointState](http://docs.ros.org/api/sensor_msgs/html/msg/JointState.html)) - Joint positions, velocities, and efforts for the wheel joints ## Subscribers - `cmd_vel` ([geometry_msgs/Twist](http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html) or [geometry_msgs/TwistStamped](http://docs.ros.org/api/geometry_msgs/html/msg/TwistStamped.html)) - 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](http://docs.ros.org/api/std_srvs/html/srv/SetBool.html)) - Enable or disable motor power - `reset` ([std_srvs/Trigger](http://docs.ros.org/api/std_srvs/html/srv/Trigger.html)) - Reset the OpenCR board - `sound` ([turtlebot3_msgs/Sound](https://github.com/ROBOTIS-GIT/turtlebot3_msgs)) - 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: ```bash ros2 run turtlebot3_node turtlebot3_node ``` Launch with a custom USB port: ```bash ros2 run turtlebot3_node turtlebot3_node -i /dev/ttyUSB0 ``` Enable motor power using service: ```bash ros2 service call /motor_power std_srvs/srv/SetBool "{data: true}" ``` Send velocity commands: ```bash ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.1}, angular: {z: 0.5}}" ```