-
Notifications
You must be signed in to change notification settings - Fork 0
4. Features via ROS2 Topics
The list of topics is crucial for low-level control and diagnostic purposes. Here is a comprehensive list:
-
Type:
std_msgs/Bool
-
Description: Enables or disables individual motor control. Ensure this is set to
true
to control the motors individually.
Warning
Enabling this mode will allow you to control the motors of the robot individually. Make sure you have lifted the robot to a higher level before using this feature to prevent an accidents
-
Type:
std_msgs/Int32
-
Description: Controls the right front motor of the robot. Make sure
/motor_control/enable
is set totrue
for this to take effect.
-
Type:
std_msgs/Int32
-
Description: Controls the left front motor of the robot. Make sure
/motor_control/enable
is set totrue
for this to take effect.
-
Type:
std_msgs/Int32
-
Description: Controls the right back motor of the robot. Make sure
/motor_control/enable
is set totrue
for this to take effect.
-
Type:
std_msgs/Int32
-
Description: Controls the left back motor of the robot. Make sure
/motor_control/enable
is set totrue
for this to take effect.
To control a motor:
ros2 topic pub -1 /motor_control/right_front std_msgs/msg/Int32 "{data: 100}"
Note
The values range from -255 to 255 with 255 being the highest speed in forward direction and -255 being the highest speed in backward direction.
-
Type:
std_msgs/Int32
- Description: Provides navigation status information of the robot.
-
Type:
std_msgs/String
- Description: Provides network connectivity status of the robot.
-
Type:
std_msgs/Int32
-
Description: This topic is of type
int
and is used to control the Proportional-Integral-Derivative (PID) controller.-
0
- Stop PID control -
1
- Fast PID control -
2
- Smooth PID control -
3
- Supersmooth PID control
-
Here's an example:
ros2 topic pub -1 /pid/control std_msgs/msg/Int32 "{data: 1}"
-
Type:
std_msgs/Bool
- Description: Controls the enabling/disabling of custom PID modes.
-
Type:
std_msgs/Float32MultiArray
- Description: Updates the PID constants.
-
Type:
std_msgs/Float32MultiArray
- Description: Saves custom PID configurations.
-
Type:
std_msgs/Int32
- Description: Runs diagnostics tests on the robot. It serves the purpose of identifying and addressing any issues that may arise during the robot's operation. For detailed diagnostics procedures, refer to the documentation.
-
Type:
geometry_msgs/Twist
-
Description: Provides velocity commands in linear and angular dimensions.The
/cmd_vel
topic is responsible for receiving velocity commands for the robot. These commands can be generated by teleoperation or themove_base
module, instructing the robot on how fast to move in different directions.
Warning
Use with caution. The ECU (ESP32) will reset, and pins may enter a floating state.
-
Type:
std_msgs/Bool
- Description: Handles ECU restart commands.
-
Type:
std_msgs/Bool
- Description: Controls the enabling/disabling of buzzer functions.
-
Type:
std_msgs/Bool
- Description: Controls the enabling/disabling of battery low warnings through the buzzer.
-
Type:
std_msgs/Bool
- Description: The /hill_hold_control topic when enabled (It can be enabled by publishing true on /hill_hold_control topic) holds the robot on slope without any user input.
-
Type:
std_msgs/Int32
- Description: The /microros_domain_id enables you to change your firmware's domain id permanently. Once changed, the firmware remembers your last set value and always boots up with the same domain id. (Currently set on domain-id 169)
To change the domain id, make sure microros agent is active, Open a new terminal and publish your custom domain id:
ros2 topic pub -1 /microros_domain_id std_msgs/msg/Int32 "{data: 169}"
The robot will change the domain ID and reset the ECU automatically to make the necessary changes. You will able to see the topics on your custom domain id now.
This topic provides information about the remaining battery percentage of the robot.
Battery Percentage | Beeping Sounds |
---|---|
100 - 20 | No beeping |
20 - 15 | Beep every 2 minutes |
15 - 10 | Beep every 1 minute |
Below 10 | Very frequent beeping |
0 (Complete Discharge) | Continuous beep |
Tip
To ensure you are aware of the robot's battery status, pay attention to the beeping sounds, especially as the battery percentage decreases.
Caution
Do not drain the battery below 10 %
, doing so can damage the battery permanently.
This topic reports the current battery voltage, ranging from 29.4V at maximum charge to 22.4V at minimum charge.
This topic provides an array of ticks for all four wheels of the robot, in the format [lf, lb, rf, rb]
. These values represent the encoder readings of the wheel ticks.
The /wheel/vel
topic sends an array of calculated current velocities for each wheel on the robot, received via encoders. The format of the array is [lf, lb, rf, rb]
, representing the actual velocity at which each wheel is moving.
-
Type:
std_msgs/Int32MultiArray
-
Description: Provides the RPM (Revolutions Per Minute) of the wheels in the format
[lf, lb, rf, rb]
.
-
Type:
geometry_msgs/Twist
- Description: Publishes the robot's velocity commands.
-
Type:
sensor_msgs/Imu
- Description: Provides IMU (Inertial Measurement Unit) data including orientation, angular velocity, and linear acceleration.
-
Type:
std_msgs/Bool
- Description: Publishes the status of the Emergency Stop button.
-
Type:
std_msgs/Bool
- Description: Publishes feedback on the Pixhawk control status.