Communication protocols
The micro-trooper has been thought as an open robotic tool and as such it allows the user to
have an absolute control over the higher layers. The user can work at two different levels with a
micro-trooper, on one side it is possible to program on the embedded computer your own
autonomous behaviors and on the other you can consider the robot as a network peripheral and
program all processes on a remote computer to finally only send the final commands to the
robot or robots to perform.
The only level that is not accessible to the user is the microcontroller that takes in charge the
motor control. The programmer will have therefore to stick with the established communication
protocol between the embedded computer and the microcontroller. Users are free though to
make use of the existing protocol between the embedded computer and the provided control
interface for their own projects or to create a new one altogether that would suit better their
application needs.
The computer-microcontroller protocol:
The embedded computer communicates with the microcontroller at 19200 baud through a
RS232 link on COM2. Parameters are 8 data bits, no parity and one stop bit. When receiving no
data the robot will automatically stop, this means a permanent communication stream has to be
established in order to keep the robot moving. For every byte sent from the computer, the
microcontroller sends one byte of raw sensor data in answer. This exchange of information takes
place in cycles of 7 bytes as follows:
26
Bytes sent:
255 RIGHT LEFT NULL NULL NULL NULL
Bytes received:
RIGHT LEFT IR1 IR2 IR3 IR4 BATT
Reset
byte
Right
speed
Left
speed
Null
bytes
#tics/41ms
IR sensors
if present
(clockwise)
Battery
level
#tics/41ms