@@ -32,92 +32,88 @@ This is the core protocol used in both TCP and UART modes.
3232## 3. Command Set
3333| Command ID | Command Name | Description |
3434| ------------| -------------------| ----------------------|
35- | ` 0x01 ` | [ ` get_api_version ` ] ( #51-0x01_get_api_version ) | Retrieves the API version of the system |
36- | ` 0x02 ` | [ ` set_motor_speed ` ] ( #52- set_motor_speed ) | Sets the speed of a motor |
37- | ` 0x03 ` | [ ` set_all_motors_speed ` ] ( #53- set_all_motors_speed ) | Sets the speed for all four motors in a single command |
38- | ` 0x04 ` | [ ` get_encoder ` ] ( #54- get_encoder ) | Retrieves the encoder value for a specific motor |
39- | ` 0x05 ` | [ ` get_all_encoders ` ] ( #55- get_all_encoders ) | Retrieves the encoder values for all motors |
35+ | ` 0x01 ` | [ ` get_api_version ` ] ( #get_api_version-0x01 ) | Retrieves the API version of the system |
36+ | ` 0x02 ` | [ ` set_motor_speed ` ] ( #set_motor_speed-0x02 ) | Sets the speed of a motor |
37+ | ` 0x03 ` | [ ` set_all_motors_speed ` ] ( #set_all_motors_speed-0x03 ) | Sets the speed for all four motors in a single command |
38+ | ` 0x04 ` | [ ` get_encoder ` ] ( #get_encoder-0x04 ) | Retrieves the encoder value for a specific motor |
39+ | ` 0x05 ` | [ ` get_all_encoders ` ] ( #get_all_encoders-0x05 ) | Retrieves the encoder values for all motors |
4040
4141### get_api_version (0x01)
4242Retrieves the firmware/API version.
4343
4444** Request**
4545| Offset | Size (bytes) | Field Description | Values |
4646| --------| -------------| ------------------| --------|
47- | 0 | 1 | command_id | 0x01 |
48- | 1 | 1 | ROS2 Driver Version | 1-255 |
47+ | 0 | 1 | command_id | 0x01 |
48+ | 1 | 1 | ROS2 Driver Version | 1-255 |
4949
5050** Response**
5151| Offset | Size (bytes) | Field Description | Values |
5252| --------| -------------| ------------------| --------|
53- | 0 | 1 | command_id | 0x01 |
54- | 1 | 1 | API Version | 1-255 |
53+ | 0 | 1 | command_id | 0x01 |
54+ | 1 | 1 | API Version | 1-255 |
5555
5656### set_motor_speed (0x02)
5757Sets the speed of a specific motor.
5858
5959** Request**
6060| Offset | Size (bytes) | Field Description | Values |
6161| --------| -------------| ------------------| --------|
62- | 0 | 1 | command_id | 0x02 |
63- | 1 | 1 | motor_id | Motor ID (0-3) |
64- | 2 | 4 | speed | Speed in RPM multiplied by 100 |
62+ | 0 | 1 | command_id | 0x02 |
63+ | 1 | 1 | motor_id | Motor ID (0-3) |
64+ | 2 | 4 | speed | Speed in RPM multiplied by 100 |
6565
6666** Response**
6767| Offset | Size (bytes) | Field Description | Values |
6868| --------| -------------| ------------------| --------|
69- | 0 | 1 | command_id | 0x02 |
70- | 1 | 1 | Status Code | 0 for OK, non-zero for error (error codes defined later) |
69+ | 0 | 1 | command_id | 0x02 |
7170
7271### set_all_motors_speed (0x03)
7372Sets the speed for all four motors in a single command.
7473
7574** Request**
7675| Offset | Size (bytes) | Field Description | Values |
77- | --------| -------------- | - ------------------| --------|
78- | 0 | 1 | command_id | 0x03 |
79- | 1 | 4 | speed_motor_0 | Speed in RPM multiplied by 100 |
80- | 5 | 4 | speed_motor_1 | Speed in RPM multiplied by 100 |
81- | 9 | 4 | speed_motor_2 | Speed in RPM multiplied by 100 |
82- | 13 | 4 | speed_motor_3 | Speed in RPM multiplied by 100 |
76+ | --------| -------------| ------------------| --------|
77+ | 0 | 1 | command_id | 0x03 |
78+ | 1 | 4 | speed_motor_1 | Speed in RPM multiplied by 100 |
79+ | 5 | 4 | speed_motor_2 | Speed in RPM multiplied by 100 |
80+ | 9 | 4 | speed_motor_3 | Speed in RPM multiplied by 100 |
81+ | 13 | 4 | speed_motor_4 | Speed in RPM multiplied by 100 |
8382
8483** Response**
8584| Offset | Size (bytes) | Field Description | Values |
8685| --------| -------------| ------------------| --------|
87- | 0 | 1 | command_id | 0x03 |
88- | 1 | 1 | Status Code | 0 for OK, non-zero for error (error codes defined later) |
86+ | 0 | 1 | command_id | 0x03 |
8987
9088### get_encoder (0x04)
9189Retrieves the encoder value for a specific motor.
9290
9391** Request**
9492| Offset | Size (bytes) | Field Description | Values |
9593| --------| -------------| ------------------| --------|
96- | 0 | 1 | command_id | 0x04 |
97- | 1 | 1 | motor_id | Motor ID (0-3) |
94+ | 0 | 1 | command_id | 0x04 |
95+ | 1 | 1 | motor_id | Motor ID (0-3) |
9896
9997** Response**
10098| Offset | Size (bytes) | Field Description | Values |
101- | --------| --------------| -------------------| --------|
102- | 0 | 1 | command_id | 0x04 |
103- | 1 | 4 | encoder_value | Encoder value for the specified motor |
104-
105- ---
99+ | --------| -------------| ------------------| --------|
100+ | 0 | 1 | command_id | 0x04 |
101+ | 1 | 4 | encoder_value | Encoder value |
106102
107103### get_all_encoders (0x05)
108104Retrieves the encoder values for all motors.
109105
110106** Request**
111107| Offset | Size (bytes) | Field Description | Values |
112- | --------| -------------- | - ------------------| --------|
113- | 0 | 1 | command_id | 0x05 |
108+ | --------| -------------| ------------------| --------|
109+ | 0 | 1 | command_id | 0x05 |
114110
115111** Response**
116112| Offset | Size (bytes) | Field Description | Values |
117- | --------| -------------- | - ------------------| --------|
118- | 0 | 1 | command_id | 0x05 |
119- | 1 | 4 | encoder_motor_0 | Encoder value for motor 0 |
120- | 5 | 4 | encoder_motor_1 | Encoder value for motor 1 |
121- | 9 | 4 | encoder_motor_2 | Encoder value for motor 2 |
122- | 13 | 4 | encoder_motor_3 | Encoder value for motor 3 |
113+ | --------| -------------| ------------------| --------|
114+ | 0 | 1 | command_id | 0x05 |
115+ | 1 | 4 | encoder_value_motor_1 | Encoder value |
116+ | 5 | 4 | encoder_value_motor_2 | Encoder value |
117+ | 9 | 4 | encoder_value_motor_3 | Encoder value |
118+ | 13 | 4 | encoder_value_motor_4 | Encoder value |
123119
0 commit comments