Interfacing ATRV-Jr™ to Ada

The ATRV-Jr™ robot from RWII which we are currently using for experiments in autonomous robot navigation has a laser range finder, a sonar system, a gyroscope and two motors. While the laser range finder and the gyroscope are connected to serial ports directly, the sonar system and the motor controller (and some other system information) is available through one single controller connected to a serial port only.

We choose Ada for the construction of the real-time architecture and subsequently it was decided to implement all the interfacing to the robot in Ada too. The source code can be browsed starting from an example program.

The following modules are made available under the conditions of the usual “open source agreement”:

User interfaces

Specification Implementation Description motor.adb Motor initialization and usage sonar.adb Sonar initialization and usage laser.adb Laser initialization and usage gyro.adb Gyroscope initialization and usage   Type definitions for physical properties of the sensors

Low level interfaces

Specification Implementation Description interrupt_handler.adb Common interrupt handler for a ADA under Linux
os_connection.c   Interface to the serial ports on Linux flex_common.adb Common data structures and routines for the flex driver flex_driver.adb Packet read and write tasks motor_handler.adb Motor packet handler sonar_handler.adb Sonar packet handler laser_driver.adb Interface to the laser serial port gyro_driver.adb Interface to the gyro serial port

Formal packet data specification

packets Motor and Sonar control data packet description


All files above can be downloaded in one package as robotdrivers.tar.gz