K-Team Khepera III User Manual - page 30
5.3
Serial communication protocol
When the robot is used as standalone ( without a KoreBotLE ), the serial
communication protocol is designed to control all Khepera’s functions using
a RS232 serial line. The serial line configuration (baudrate as well as data,
start, stop and parity bits) for the host computer must match the robot’s
configuration.
The host computer and the Khepera robot are communicating with
ASCII messages. Each single interaction is composed by:
- A command, beginning with one ASCII capital letters and followed,
if necessary, by numerical or literal parameters separated by a comma
and terminated by a carriage return or a line feed, sent by the host
computer to the Khepera robot.
- A response, beginning with the same one ASCII letters of the com-
mand but in lower-case and followed, if necessary, by numerical or lit-
eral parameters separated by a comma and terminated by a carriage
return and a line feed, sent by the Khepera to the host computer.
During the entire communication, the host computer is acting as a master
and the Khepera as slave. All communications are initiated by the master.
Two different types of interactions are possible. The first set of inter-
actions is used to set up the robot configuration from the host computer
(set up serial line, changing controllers configuration,...), the second set of
interactions is used to control the robot (controlling motors, reading sensors
value,...).
A set of commands is available as detailed in appendix.
5.3.1
Testing a simple interaction
Testing some basic commands is the best method to understand the serial
protocol and tools available on the Khepera. Using a properly configured
serial link between the robot and a computer, please follow the instructions
bellow:
- Type the capital letter B followed by a carriage return or a line feed.
- The robot must respond with b followed by an indication of the version
of software running on the robot and terminated by a line feed.
- Type the capital letter N followed by a carriage return or a line feed.
- The robot must respond with n followed by 11 numbers separated by
a comma and terminated by a line feed. These numbers are the values
of the robot proximity sensors presented in section 3.1.6.
- Retry the same command (N) putting some obstacles in front of the
robot. The response must change.
- Type the protocol command D,l10000,l-10000 followed by a carriage
return or a line feed.
Khepera III manual ver 2.2
28