Robot Amusement Park
School Team Challenge
The Challenge
1) To construct and program a mobile robot (the ‘cart’) capable of autonomously following a specified route through an amusement park ride.
2) To construct, program and decorate two animated (motorised) robotic theme park attractions that will be placed along the amusement park ride. The two attractions should ideally make use of different mechanical principles (cams, gears, cranks and sliders, and so on) as part of their mechanism.
3) To construct an area of the theme park that will house your attractions and provide a route through them that can be followed by the robot cart. Your robot cart should follow a black line on a white background that marks out a route through the attractions. Entry and exit points for the route will be marked out in your area of the amusement park, although how the actual route is laid out within that area is up to you.
Each attraction, and the robot cart, will be controlled by its own controller. Ideally, each attraction will start when a cart approaches the attraction, and should stop (and if necessary reset itself) when the cart has passed the attraction.
Light or touch sensors can be used to detect the presence of a robot as it approaches an attraction. The cart may also send a message to an attraction to announce that it is approaching.
The Team
The challenge been designed to incorporate several tasks that will need to be shared out amongst team members. Although tasks can be carried out concurrently, each subteam will need to collaborate with the other subteams.
For example, if you divide the team up into programming and robot construction subteams, the programming team will need to work closely with the construction teams. The cart team will need to work with the attraction teams to identify how the approach of the cart will be signalled to the attraction. The team member(s) responsible for laying out the amusement park itself will need to ensure there is room for the exhibits, and so on.
Resources
Your team will be provided with several Lego Mindstorms kits, enough to build two attractions and a mobile cart, and access to a PC running the OU-Robotlab robot programming environment.
Several example programme fragments for controlling the motors via the Lego Mindstorms RCX computer brick are provided. You can use these fragments as part of a control programme for your robots, or use them as inspiration for your own programmes.
Several example mechanisms are provided as inspiration for your own attractions, as well as references to several websites that use animations to demonstrate the principle behind various simple mechanisms.
You can find links to relevant online references via a bookmark collection set up using the del.icio.us social booking environment:
http://del.icio.us/psychemedia/T885+robotAmusementPark
One to Discuss
How would you document your project so that somebody else could recreate your Robot Amusement Park?
Programming Hints
How do I configure the program at first?(program statements appear after main) / output left_motor on A
output left_motor on C
sensor lightSensor on 2 is light as percent
main
How do I make my robot go forwards/turn both motors on in the same direction? / forward [left_motor right_motor]
on [left_motor right_motor]
How do I make my robot continue doing something for two seconds before the next step? / wait 200
How do I turn the motors off at the end of the program? / off [left_motor right_motor]
How can I get my robot to turn/turn two motors on in different directions?
(Turn one motor on and the other one off, or set the wheels to turn in different directions. Four different ways are possible…) / forward [left_motor]
backward [right_motor]
on [left_motor right_motor]
How else can I program the motors to turn at different speeds?
(Change the power level of each motor, which often has the effect of slowing the motor down) / power [left_motor] 4
power [left_motor] 8
forward [left_motor right_motor]
on [left_motor right_motor]
How do I make reverse the direction the motors are turning (e.g. from forwards to backwards)? / reverse [left_motor right_motor]
How do I slow a motor down programmatically? (the maximum power is 8). / power [left_motor right_motor] 4
How do I make my robot go forwards for one second, then reverse the direction of both motors and get it to go backwards for 0.6s (60 hundredths of a second)? / forward [left_motor right_motor]
on [left_motor right_motor] for 100
reverse [left_motor right_motor]
on [left_motor right_motor] for 60
How do I make my robot go forwards and stop when it sees the black line?
(You will need to experiment with the light/dark threshold level, which is set to 42 in this example) / forward [left_motor right_motor]
on [left_motor right_motor] for 100
while lightSensor > 42
comment DO NOTHING
off [left_motor right_motor]
What's the code for a line follower (or more specifically, an edge follower)? / forward [left_motor right_motor]
on [left_motor]
forever
if lightSensor < 42
then
on [left_motor]
off [right_motor]
else
off [left_motor]
on [right_motor]
How do I configure the light sensor? / sensor lightSensor on 2 is light as percent
How do I configure the rotation sensor? / sensor rotnSensor on 3 is rotation as angle
How do I configure the touch sensor? / sensor touchSensor on 1 is switch as Boolean
How do I configure the motors? / output left_motor on A
output another_motor on B
output third_motor on C
How do I send a message from one robot to another? (You can set the number from 1 to 255) / send 15
How do I receive a message sent by another controller? / if message = 123
then
sound 1
clear message
How do I send a message from the PC to an RCX controller (useful for testing)? / RobotLab Menu: Window -> Messages
Enter message number and click send
How do I set a threshold value between two constant values? / const white = 45
const black = 30
var blackWhiteThresh = 20
comment this is just a placeholder value
main
set blackWhiteThresh = (black + white)/2
How do I make the robot do something when the touch sensor is pressed? / sensor touchSensor on 1 is switch as boolean
main
forever
off [left_motor right_motor]
if touchSensor = 1
then
on [left_motor]
How do I start to do something when a touch sensor is pressed and stop when it is released? / if touch_sensor=1
then
on left_motor
while touchSensor=1
comment Loop until touch sensor is released
comment When released, carry on from here
off left_motor
How do I extend the follower so it sends a message when it sees a silver checkmark?
(The robot drives forward over the silver checkmark so that it does not send several messages from the same one.) / forward [left_motor right_motor]
on [left_motor]
forever
if lightSensor < blackWhiteThresh
then
on [left_motor]
off [right_motor]
else
if lightSensor WhiteSilverThresh
then
off [left_motor]
on [right_motor]
else
send 12
sound 2
forward [left_motor right_motor]
wait 30