nav_algo.radio module

Bases: nav_algo.SailSensors.UARTDevice

Constructor for the radio. -baudrate is an integer(should be 9600 for the xbee) -serialport, the serial port the xbee is connected to(just leave default for the xbee) -t is the uart timeout period(just leave at 1 for normal operation)

Data should be of the form:.

“———-WAYPOINTS———-” + “,X:” + current_waypoint.x + ” Y:” + current_waypoint.y + “,X:” + next_waypoint.x + ” Y:” + next_waypoint.y + … “,X:” + last_waypoint.x + ” Y:” + last_waypoint.y + “,———-END———-” + new line character

Note that waypoints are comma delineated while x and y coordinates of the same point are space delineated. The waypoints should be printed in order from first to last (do not include waypoints that have already been hit).

Data should be of the form:.

“———-NAVIGATION———-” + “,Origin Latitude: ” + origLat + “,Origin Longitude: ” + origLong + “,X position: ” + currentPosition.x + “,Y position: ” + currentPosition.y + “,Wind Direction: ” + windDir + “,Pitch: ” + pitch + “,Roll: ” + roll + “,Yaw: ” + yaw + “,Sail Angle: ” + sailAngle + “,Tail Angle: ” + tailAngle + “,Heading: ” + heading + “,———-END———-” + new line character

Note that fields are comma delineated and there is only a new line character at the end of the string.

Data should be of the form:.

“———-HIT———-” + “,X:” + waypoint.x + ” Y:” + waypoint.y + “,———-END———-” + new line character

Note that fields are comma delineated while x and y coordinates of the same point are space delineated.

Note ‘printAllWaypoints’ should be called immediately after this.