Raptor
From HotDec
Contents |
The Raptor
The Raptor is a heavy-duty 4x4 RC truck that has been fitted with sensors and a Single Board Computer running Linux. The purpose of the project is to create a good platform for control theory testing and implementation.
At present, the Raptor has 4 encoders mounted to each of its wheels. These are connected to a Micro Controller Unit that sits on top of the SBC. The MCU then passes the encoder measurments to the MCU where a Linux module makes them available to userspace code. A program runs on the SBC that starts and stops various controllers at the user's discretion, and can pass information from the network to the controller. A client has been written that can send information to and recieve information from the truck.
The final goal for this project is to make the design general purpose, efficient, cheap, and easy to maintain. The test of this goal is to have several Raptors built that run controllers while outdoors.
Details
The Raptor project consists of 3 main parts: the client, the server, and the Raptor itself. The Raptor, in turn, consists of two parts: the daemon and the controller. A detailed description follows:
Client
There are currently two versions of the Raptor Client: a Text User Interface(TUI) and a Graphical User Interface(GUI).
TUI
The Text User Interface is a very simple commandline client for the Raptor. It works only on Linux, and developement has been discontinued in favor of the GUI (see below), however it is still useful in certain situations inside the lab. (TODO add explaination of how it works and how to use it)
GUI
The Graphical User Interface was developed in wxWidgets to be completely cross-platorm (compatible with Windows, GTK2, OS/X, X11, others...). Compilation on Windows requires MinGW. The GUI will be posted here for download as soon as release builds are available. (TODO add usage)
Server
The Raptor Server is a very simple threaded TCP server which only functions in passing messages between the client and truck. This has two advantages of a direct connection:
- The client and truck only have to know the address of the server to make a complete connection. This means that the IP of either one can changed without affecting the configuration of the network.
- When additional trucks and clients are added, the server will aid in disbersing messages appropriately. For example, one client may want to send messages to three distinct trucks, or a single truck may want to send data to all clients, and so on.
The Raptor Server currently requires the following ports to be open:
- 24588 TCP for Raptor communications.
- 24588 UDP for status queries from the Raptor.
- 24589 TCP for client communications.
Raptor
The Raptor itself (often simply called 'the truck') is a combination of software and hardware. The hardware is controlled by the Controller, which is in turn controlled by the Raptor Daemon.
Hardware
The Raptor itself is a modified Traxxas E-Maxx Model 3906. The Raptor has custom mountings designed to attach encoders, a Single Board Computer, and a GPS unit. It also has optional mountings for four combination servo-IR-sonar units which have not been added yet. (TODO info on mountings, more hardware info)
Daemon
The Raptor Daemon is a simple program which runs at all times on the truck and ensures that the Raptor is in a consistent state. Specifically, the Daemon ensures that the network is functioning at all times, and that the controller is running and responsive. A special 'kill' message has been implemented to kill the controller and stop the truck in case of emergency or malfunction. This eases the burden of the Controller programmer and creates a more fault-tolerant environment for the controller to run in.
Controller
The Raptor Controller is the heart of the Raptor project. The project's goal is to design and implement a 'testbed for control' and as such, the controller is an undefined component of the Raptor which will make it acheive some goal. A simple controller can make the Raptor perform circles or figure-eights, while a more sophisticated controller can make the Raptor follow sidewalks.
Trucknet
Trucknet contains header files for basic constants used by most programs related to the truck, as well as the pure virtual message class from which all the other message classes on the truck are inherited. Miscellaneous Functions and some small utilities also reside in the message class.
- TCPmsg
- A class to allow messaging over TCP.
- UNIXmsg
- A class to allow messaging between programs using UNIX sockets.
