In order to remote control the rovers a protocol has been developed that is send using a serial port emulating Bluetooth connection.
To add a little robustness some simple checksums and headers are added.
All stated values are hexadecimal if not said otherwise!
Header (2 bytes)
0B 05Type (1 byte)
typeLength (2 bytes)
lenData (len bytes)
dataWhile the header is fixed, there are a few types that can be understood by each rover. Not every rover however supports each type in each configuration.
| Type | Description | Rovers | Status |
|---|---|---|---|
| 0 | Not used for robustness reasons | All | |
| 1 | motorDriverMotorUpdate - Set ID/IQ and speed for a/several motors | R2 | Deprecated for R3 |
| 2 | motorDriverMotorMeasure - Get current current | R2 | TBD |
| 3 | motorDriverGetCurrentsCollection - Get currents from sample buffer | R2 | TBD |
| 4 | motorDriverGetFaultReg - Get fault status of motors | R2 | TBD |
| 5 | motorDriverGetControlCollection - Get controls from sample buffer | R2 | TBD |
| 6 | motorDriverMotorMeasure - Get maximum current during last period | R2 | TBD |
| 7 | spiCommunication - send SPI commands to the Atmel | R0,R3 | Active, even tough the R3 does not have an Atmel |
| 8 | wait - waits a certain amount of time before evaluating the next command. | R0 QNX, R2,R3 |
Active |
| 9 | buggySteering - a higher level steering algo for driving like a buggy | R0 QNX | Never worked well (Deprecated) |
| 10 | onOffControl - allows to enable/disable things | R3 | Active |
| 11 | vectorProtocol - implementation of our vector steering model | R3 | Active |
On the R0, these packets are sent to the Atmel controller to set a servo to a specified value. For compatibility with the control, these packets are also interpreted by the R3.
There are two data bytes to submit: motor and value.
motor: number of motor, according to R0 numerationvalue: desired value (speed or angle) of designated motor (1..255)value.
Example:
To turn the front left wheel to 45° and set its driving motor to a slow speed (20% of maximum), these commands have to be transmitted:
0B 05 07 00 02 00 C0 (set front left steering to 45° [value of 192])
0B 05 07 00 02 05 99 (set front left driving to 20% [value of 153])
It is possible to set multiple motors at the same time.
0B 05 07 00 04 05 99 00 C0 (does the same as the commands above, but with just one command).
On the R3, the voltage regulators for the motor power supply as well as each of the controller processes can be enabled or disabled via a simple command.
There are three data bytes to submit: type, id and value.
type: 0: motor power supply, 1: motor controllersid (motor power supply): number of output on MMB2 (0..2)id (motor controllers): number of motor controller, according to R3 numerationvalue: 0: disable, 1: enable, 2: read status
Example:
To use the front motors of the R3, these commands have to be transmitted:
0B 05 0A 00 03 00 00 01 (enable motor power supply 0 [front])
0B 05 0A 00 03 01 00 01 (enable controller 0 [front left steering])
0B 05 0A 00 03 01 01 01 (enable controller 1 [front left driving])
0B 05 0A 00 03 01 02 01 (enable controller 2 [front right steering])
0B 05 0A 00 03 01 03 01 (enable controller 3 [front right driving])
On the R3, the vector control model is also implemented directly on the rover, the values of every wheel are calculated there.
There are three data bytes to submit, corresponding to the vectors of our model: x, y and ry. Each of them is interpreted as a signed 8-bit integer limited to -127..127.
x: translation in forward direction of the rovery: translation to the right of the roverry: rotation around the center of the rover
Example:
To stop the rover, this command has to be transmitted:
0B 05 0B 00 03 00 00 00 (x = 0, y = 0, ry = 0, all wheels will be centered)
To drive diagonal forward/right with moderate speed (38% of maximum), this command has to be transmitted:
0B 05 0B 00 03 30 30 00 (x = 48, y = 48, ry = 0)
Type (1 byte)
30(Ascii 0) String for Error terminated by:
0A
31(Ascii 1) Confirmation with Adler checksum (4
bytes)
32(Ascii 2) String for Information terminated by:
0A
33(Ascii 3) Complex reply with TLV structure
type&0x80!=0 then this is an unrequested reply.
I.e. a motorFault has been detected.34(Ascii 4) Confirmation without Adler checksum
This is used by the R0 without QNX to reply to type-7 commands.
Due to the spatial separation of front and rear in the R3, the numeration of the R0 was no longer applicable. Both numerations differ substantially.
| Motor description | R0 numeration | R3 numeration |
|---|---|---|
| Front left steering | 0 | 0 |
| Front left driving | 5 | 1 |
| Front right steering | 3 | 2 |
| Front right driving | 8 | 3 |
| Rear left steering | 1 | 4 |
| Rear left driving | 6 | 5 |
| Rear right steering | 2 | 6 |
| Rear right driving | 7 | 7 |
| Solar panel | 4 | n.a. |