The code for the RT controller on the Lunabotics robot for the 2020 season.
The controller takes extended CAN messages. The arbitration ID of these messages should be formatted as follows:
Bytes 31-8 | Bytes 7-0 |
---|---|
Message ID (subsystem-specific) | Controller subsystem ID |
Below is a table of controller subsystem IDs:
Subsystem | ID |
---|---|
Drivetrain | 100 |
ACHOO | 101 |
GESUNDHEIT | 102 |
SNEEZE | 103 |
BLESSYOU | 104 |
These IDs start at 100 to avoid interaction with VESCs. See the subsystem tables below for message IDs. Message IDs are required to begin above 35 to avoid interaction with VESC command IDs, which go up to 27.
Command | ID | Broadcasts/Listens | Length | Data |
---|---|---|---|---|
Twist | 35 | Listens | 8 | Bits 7-4: Linear velocity (int32) mm/s Bits 3-0: Angular Velocity (int32) mrad/s |
Command | ID | Broadcasts/Listens | Length | Data |
---|---|---|---|---|
Set kneel | 40 | Listens | 1 | 0: Stand 1: Kneel |
Kneel state | 41 | Broadcasts (10 Hz) | 1 | 0: Standing 1: Moving up 2: Moving Down 3: Kneeling |
Command | ID | Broadcasts/Listens | Length | Data |
---|---|---|---|---|
Set extension | 50 | Listens | 1 | 0: Stow 1: Extend |
Conveyor speed | 51 | Listens | 4 | Speed (int32) rpm |
Set door | 52 | Listens | 1 | 0: Close 1: Open |
Extension state | 53 | Broadcasts (10 Hz) | 6 | Byte 0: 0: Stowed 1: Moving to stow 2: Moving to extend 3: Extended Byte 1: 0: Door closed 1: Door open Byte 2-5: Speed (int32) rpm |
Command | ID | Broadcasts/Listens | Length | Data |
---|---|---|---|---|
Extension state | 60 | Broadcasts (50 Hz) | 6 | Byte 0 (State): 0: Idle 1: Digging 2: Homing Byte 1: Is homed (bool) Byte 2-5: Speed (int32) rpm |
Set dig speed | 61 | Listens | 4 | Speed (int32) rpm |
Go home | 62 | Listens | 0 | N/A |
Set transfer speed | 63 | Listens | 4 | Speed (int32) rpm |