Você está na página 1de 10

COSPACE RESCUE

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

GETTING STARTED GUIDE


RoboCup Junior CoSpace is a worldwide robot simulation competition. The aim of the competition is to
score maximum points by collecting different coloured objects whilst avoiding traps and avoiding the
opposing teams robots.

Your Virtual Robot


The virtual robot you will be programming is shown below:

The robot has 3 outputs:

2 independently controlled motors at the back of the robot


1 LED which can be set to steady on or flashing

The robots also have a range of sensors:

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.

A small recap on how the sensors work


Ultrasound sensors measure distance. This is done by transmitting
an ultrasound wave which is then reflected by an object. By
determining the time between when the ultrasound wave is sent
and when it is received the distance the object is away can be
determined. This is known as sonar and is the same method
that bats use to detect the distance of objects.
Colour sensors use photodiodes to detect the colour of objects beneath them. The colour
of the field detected by the sensor is returned as 3 values, the red, green and blue values
(rgb values) where each value is between 0-255. Any colour can be produced from a
combination of R, G and B values.
Page 2 of 9

CsBot Software
The graphical programming environment used for CoSpace is CsBot. To launch this software:

1. Click on the CsBot icon to launch the software:


2. You then then need to select the primary platform. This will then show
the competition field and the control panel as shown below:

The Virtual Environment


The competition field that is loaded is the field that you are going to program your robot to move around
and collect the different coloured objects:

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:

The Control Panel


The control panel is launched when the software starts and can be used to manually control the robot, to
launch the AI (artificial intelligence) programming window and to run your robot. By clicking on the robot
or competition tabs different options are given.
Robot tab
This tab allows you to view live sensor values for the virtual robots and also to manually move the robot
around in the field.

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.

The Control Panel: Competition tab


This is the most important tab, and allows you to program
your robot and also load and run your programs:

Page 5 of 9

To launch the AI programming panel, click on the AI button:

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
}

Elise if condition x = true


{
Run actionx until condition is no longer true
}

Lowest priority action

Adding statements and setting the priority


Statements can be added by right clicking on the statement tree
and choosing options from the menu. The order of statements can
then also be altered by changing the order of statements.
The higher the statement, the higher priority.
Conditions
The conditions for the statement are set using the conditions are of the interface:

Getting Started Guide

Page 8 of 10

Actions actions are set using the bottom panel:

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

Getting Started Guide

Page 9 of 10

CoSpace Rescue Game


Target: Collect as many points as possible

Strategy: Avoid traps and obstacles

Primary Age Group


Game takes place in two
virtual worlds

Secondary Age Group


Game takes place in real and
virtual worlds

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:

Getting Started Guide

www.CoSpaceRobot.org
info@CoSpaceRobot.org
support@CoSpaceRobot.org

Page 10 of 10

Você também pode gostar