CoSpace Rescue 2014 - Getting Started
CoSpace Rescue 2014 - Getting Started
CoSpace Rescue 2014 - Getting Started
SIMULATOR
GETTING STARTED GUIDE
This training material was developed in collaboration with CoSpace UK, RoboCup
Singapore and RoboCup CoSpace Technical Committee.
CoSpace Robotics Development Team
Advanced Robotics and Intelligent Control Centre (ARICC)
Singapore Polytechnic
www.CoSpaceRobot.org
Page 1 of 9
4 ultrasound sensors that measure the distance of objects in front of the sensor in centimetres.
These are fitted to the front, left, right and back of the robot. These can be used to detect walls
and boundaries.
2 colour sensors used to detect the colour of the field below the sensor in order to detect the
different coloured objects. They return a red, green, blue values ranging between 0-255 that
together describes the colour of the field they see.
1 Compass sensor at the top of the robot, which measures the angle in degrees where 0 is facing
the scoring board. The angle is compass bearing is measured anticlockwise.
CsBot Software
The graphical programming environment used for CoSpace is CsBot. To launch this software:
Page 3 of 9
Arrow keys can be used zoom and move around the environment. You
can also use the mouse to move the viewpoint by clicking and dragging.
The score board is used to show the current score for the teams playing
and the number of objects currently held by the robot. The game time
remaining is also shown:
Page 4 of 9
Robot selection this allows the user to select which robots sensor values to view; the live sensor
values for the Blue Virtual Robot or the Red Virtual Robot are displayed according to your selection.
Real-time sensor feedback this allows the user to view the sensors readings as the robot moves
through the virtual environment. This is useful for obtaining readings from the colour sensors.
Manual Robot control by moving the round joystick controller, the direction and speed of the
robot can be controlled manually. You can use this to position your robot over a particular colour
and obtain the corresponding sensor values.
Even when the game is running it is possible to view this panel, to help with debugging.
The joystick controller can be used to move the robot
around the field. You can select which robot(s) to control
by setting the control to a tick below the red or blue robot.
Page 5 of 9
AI Programming Panel
This is the panel that you can use to
create your programs. The
programming approach used is event
driven programming. This is when the
flow of the program is determined by
events. The graphical interface use to
program is shown here:
Page 6 of 9
File Menu
This menu allows you to create and save your
programs.
After creating and saving a program you have
developed, you must also build the program so that
it can be loaded into a virtual robot.
Event Driven Programming
The programming approach used is event driven so the flow of the program is determined by robot events.
This is a different way of thinking about programming than typical programming languages/environments.
To program a robot you create statements which have 3 properties associated with them:
1. Priority set by the order of the statements
2. Condition
3. Action
These are set in the AI development panel:
The program works by testing the condition of the highest priority statement, if this is true, it will run the
action associated with this statement until the condition is no longer true.
Page 7 of 9
If this highest priority statement is not true, the software will test the next statement down until it finds
the highest priority statement that is true (if any) it will then run this action until the condition is no longer
true. It will then return to the highest priority statement, and repeat the process.
Highest Priority
Repeat Forever {
If condition1 = true
{
Run action1 until condition1 is no longer true
}
Else if condition2 = true
{
Run action2 until condition2 is no longer true
}
Page 8 of 10
Action
Wheel_Left or
Wheel_Right
LED_1 = 0
Duration
Key Action
Explanation
Set the speed of the left wheel:
5 = maximum speed forwards
-5 = maximum speed backwards
0 = stop
0 = LED off
1 = LED blinks
2 = LED steady on
Sets the length of time the action runs for.
Find objects - should be selected if the object is found. The internal variable
LoadedObjects will be added by 1.
Deposit - should be selected when deposit the objects. The internal variable
LoadedObjects will be reset to 0.
Teleport - should be selected if the virtual robot in stage 1 needs to be
teleported to stage 2.
Remember when programming that the robots are modelled as real robots. They experience friction,
gravity and actions will not happen instantaneously!
List of Activities
1.
2.
3.
4.
5.
6.
7.
8.
9.
Moving forward
Turn
Find Red blocks
Deposit a Block
Deposit and Leave
Avoid A Trap
Teleport
Using Variables
Connecting to a Real Robot
Page 9 of 10
Mini Challenge
Program your robot navigates through the field to collect objects while competing with
another robot that is doing the same job.
Contact US
CoSpace Robot Website:
Enquiry:
Technical Support:
www.CoSpaceRobot.org
info@CoSpaceRobot.org
support@CoSpaceRobot.org
Page 10 of 10