CoSpace Rescue 2014 - Getting Started
-
Upload
danijel-rakic -
Category
Documents
-
view
222 -
download
0
Transcript of CoSpace Rescue 2014 - Getting Started
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
1/10
Page 1 of 9
COSPACE RESCUE
SIMULATORGETTING 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
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
2/10
Page 2 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.
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
3/10
Page 3 of 9
CsBot Software
The graphical programming environment used for CoSpace is CsBot. To launch this software:
1. Clickon theCsBoticon to launch thesoftware:
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:
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
4/10
Page 4 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 competitiontabs 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.
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
5/10
Page 5 of 9
Robot selectionthis allows the user to select which robotssensor 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 feedbackthis 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 controlby 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 tabThis is the most important tab, and allows you to program
your robot and also load and run your programs:
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
6/10
Page 6 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 toprogram is shown here:
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
7/10
Page 7 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 buildthe 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. Priorityset by the order of the statements
2. Condition3. 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.
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
8/10
Page 8 of 10Getting Started Guide
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.
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:
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
}
}
ighestPriority
Lowest priority action
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
9/10
Page 9 of 10Getting Started Guide
Actionsactions are set using the bottom panel:
Action Explanation
Wheel_Left or
Wheel_Right
Set the speed of the left wheel:
5 = maximum speed forwards
-5 = maximum speed backwards
0 = stop
LED_1 = 0 0 = LED off
1 = LED blinks2 = LED steady on
Duration Sets the length of time the action runs for.
Key Action Find objects - should be selected if the object is found. The internal variable
LoadedObjectswill be added by 1.
Deposit - should be selected when deposit the objects. The internal variable
LoadedObjectswill 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. Moving forward
2.
Turn
3. Find Red blocks
4. Deposit a Block
5. Deposit and Leave
6. Avoid A Trap
7. Teleport
8. Using Variables
9. Connecting to a Real Robot
-
7/24/2019 CoSpace Rescue 2014 - Getting Started
10/10
Page 10 of 10Getting Started Guide
CoSpace Rescue Game
Target: Collect as many points as possible Strategy: Avoid traps and obstacles
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: www.CoSpaceRobot.org
Enquiry: [email protected]
Technical Support: [email protected]
Primary Age Group
Game takes place in two
virtual worlds
Secondary Age Group
Game takes place in real and
virtual worlds