LaserBots: User Manual
Friday, 18 January 2013 Category : Game, Implementation, Phase Two, User Manual 1
Home > Phase Two
Friday, 18 January 2013 Category : Game, Implementation, Phase Two, User Manual 1
Category : Implementation, Phase Two 0
Category : Implementation, Phase Two 0
Project Timeline
Due to certain parts of the project taking less and some parts being considerably more difficult than was initially thought, along with delay in obtaining particular components the project timeline was updated to reflect the plan for the remainder of the project. Initial timing is on the top line and the revised timing is on the second line in red.
![]() |
| Updated Project Timeline |
Category : Implementation, Phase Two 0
#include <Servo.h> #include "avr/interrupt.h" char instruction [10]; //instruction sent to arduino int i = 0; //index for instruction array int j = 0; //index for for loop String stringXCoord = ""; int intXCoord; //x coordinate for servo String stringYCoord = ""; int intYCoord; //y coordinate for servo Servo servoX; //servo x Servo servoY; //servo y
Thursday, 17 January 2013 Category : Implementation, Phase Two 0
Wednesday, 16 January 2013 Category : Comms, Design, Implementation, Phase Two 0
Sunday, 13 January 2013 Category : Comms, Implementation, Phase Two 0
![]() |
| TouchOSC configuration screen |
Saturday, 12 January 2013 Category : Design, Phase Two 0
![]() |
| Improved Interface |
Friday, 11 January 2013 Category : Implementation, Phase Two 1
| PCB Schematic |
Tuesday, 8 January 2013 Category : Implementation, Phase Two 0
![]() |
| Completed Prototype |
Monday, 7 January 2013 Category : Comms, Implementation, Phase Two 0
![]() |
| Circle Network Setup |
char instruction [10]; //instruction sent to arduinoNext, a String needs to be introduced so that a message can be resent on to robot 2.
//message to send on to Robot 2 String resendMessage = "";Inspecting the previous code for the robot, the first part of void loop() stays the same - while there is serial data available, read the data and store in the instruction array. Next, check to see if the instruction starts and ends with the characters '<' and '>' (remembering to change the index by one for the ending character).
//check that message is for robot 1 <1....>
if (instruction[j+1] == '1')
{
If the message is for the robot, the normal parsing takes place (parse the rest of the message to deal with lasers, servos and motors). Else, if the message is for robot 2, robot 1 needs to resend the message. The message is concatenated together and then printed out. Before being printed, however, the serial port is flushed. //else check is message is for robot 2 <2...>
else if (instruction[j+1] == '2')
{
//reset resend message to blank
resendMessage = "";
int k = 0;
//loop around the instruction message
for (k = j; k<(j+10); k++)
{
//concatenate all characters of message
resendMessage += instruction[k];
}
Serial.print(0); //flush the serial port
Serial.print(resendMessage); //send the message onto Robot 2
}
That is all the code that needs to be added/changed for robot 1 to parse the instruction message.
//string to print to contact games master - in the following form: //G (games master) 2 (robot 2's score) 10 (how much to increment score) String GMscoreLR = "[G210]"; String GMscoreB = "[G215]";
Serial.print(0);//flush the serial port
//print message to GM to increment Robot 2's score
Serial.println(GMscoreLR);
In the other interrupt, this code needs to be added: Serial.print(0);//flush the serial port
//print message to GM to increment Robot 2's score
Serial.println(GMscoreB);
These interrupts print the correct string which will then be sent on to robot 2. char instruction [10]; //instruction sent to arduinoNext, a String needs to be introduced so that a message can be resent on to the Games Master.
//message to send on to Games Master String resendMessage = "";Again, inspecting the previous code for the robot, the first part of void loop() stays the same - while there is serial data available, read the data and store in the instruction array. Next, check to see if the instruction starts and ends with the characters '<' and '>' (remembering to change the index by one for the ending character).
//check the message is for robot 2 <2...>
if (instruction[j+1] == '2')
{
//if message is score packet for the Games Master
else if ((instruction[j] == '[') && (instruction[j+5] == ']'))
{
//reset resend message to blank
resendMessage = "";
int k = 0;
//loop around the instruction message
for (k = j; k<(j+6); k++)
{
//concatenate all characters of message
resendMessage += instruction[k];
}
Serial.print(0); //flush the serial port
Serial.print(resendMessage); //send the message onto games master
}
In this else-if statement, the message is concatenated together and then sent on to the Games Master. Serial.print(0);//flush the serial port
//print message to GM to increment Robot 2's score
Serial.println(GMscoreLR);
And in the other interrupt, this code needs to be added: Serial.print(0);//flush the serial port
//print message to GM to increment Robot 2's score
Serial.println(GMscoreB);
That concludes all the code that needs to be updated on the robots. Please see post BLAH for the parsing of the Games Master packets in Processing.
Category : Comms, Implementation, Phase Two 1
After trying a point to point network, and a point to multipoint network, it was decided that a circle network would be implemented.
![]() |
| Circle network |
![]() |
| Coordinator and Router Setup for Circle Network |
Category : Implementation, Phase Two 0
Category : Comms, Implementation, Phase Two 0
| Broadcast configuration for an Xbee network |
Friday, 4 January 2013 Category : Comms, Implementation, Phase Two 2
![]() |
| Xbees in Unicast mode |
Wednesday, 12 December 2012 Category : Comms, Implementation, Phase Two 0
The offboard system uses the raspberry pi as the base station to send and receive signals from the iPads over the network interface and process the messages and send control packets to the game master Xbee.
Category : Detection, Implementation, Laser, Phase Two 0
Monday, 10 December 2012 Category : Implementation, Phase Two 0
The Tamiya tank systems, gearbox, tracks and platforms all came with instructions and although they had many small parts and were time consuming to assemble were otherwise relatively straightforward to assemble and test.
![]() |
| Wheel and Track Parts |
![]() |
| Gearbox Parts |
![]() |
| Gearbox Assembly |
![]() |
| Platform, wheel and track assembly |
![]() |
| Full Assembly |
![]() |
| Battery and motor chip installation for testing |
![]() |
| Motor chip connected to gearbox |
![]() |
| Ready for Arduino |
![]() |
| Testing
For testing code see
|