Skip to content
ashfaqfarooqui edited this page Dec 2, 2014 · 2 revisions

Going forward, the proxy will be used to communicate with external sensors and actuators.

####Usage: If you want to control the motion of the car, all you need to do is set the speed and steering values in the VEHICLECONTROL container and send it over the UDP stream. As it is done in the driver component. The sensor data is avaliable as a container over the UDP stream witht he name :USER_DATA_0. which is of sensorBoardData type. The sensor ID are available in the configuration file. Basically 0 would be IR sensor 1, 1->IR sensor2 and so on.

motor values are between 1-9 where 1 is lowest speed.

Steering can be controled between -43 to +45 (Correct me if I am wrong)

If you wish to Delve in deeper into the proxy read on:

###File organization:

Proxy.CPP <- Contains the implementation to read VEHICLECONTROL values from the stream and send the data to the arduino. Also, It reads data from the sensors through the arduino and sends it as USER_DATA_0

ArduinoProtocol-> this file contains the protocol to communicate to the arduino. It is responisble to format the data in an understandable way for the arduino and send the data over serial.

SerialProtocolSample-> This class opens the port to the arduino, and is responsible for the writeing data to the serial port. Going futher this class must be replaced and we should use the serialPortFactory.

SensorProtocol-> this class implements the listener for the sensor data recived over the serial port. When complete data has been recieved it cals the nextString function in proxy.

###The Protocol ####Sensors: Arduino sends data in the following format: iXX,XX,XX,XX:uXXX,XXX:wXXXX.

####Actuators: The protocol is the same as used last year.

To control steering we set steering with the following command: sXX\ where XX is the desired angle.

To Control the speed we use the command: mX, where X is speed selection 1-9. See arduino code for more details. (Victors report has more details)

####Setting real speed/Wheel frequency To use real speed the variable "Proxy.Actuator.UseRealSpeed" should be set to 1, by setting the value set to the speed variable will determine the speed. A negative value results in going reverse.

###Open topics on the proxy:

  1. Turning the Indicator and Brake lights on the car. This needs to be more well tested.
  2. Integrate pointSensor into the the proxy to make reading data for debugging easier. (Or change sensorBoardData map to be <char &,int>)
Clone this wiki locally