Program a robot to collect RED objects while
navigating in the virtual world. A robot will unload the objects collected when
it enters the deposit box.
A robot is considered to deposit the objects
in the collection box (orange area) successfully, if -
v
Both colour sensors must detect the
orange zone at the same time.
v Deposit objects
v The robot must
stop and turn on the LED for 3 seconds (with a steady light)
v
The robot must be able to exit the
deposit area automatically.
Recap:
If an action is executed for |
It means that this statement is executed for |
60
milliseconds |
1 duration |
120 ms |
2 durations |
3 seconds or
3000 ms |
50 duration |
3600 ms |
60 duration |
Flowchart:
Procedure:
1.
Manually move the robot into the “Orange Zone”, record its colour
sensor’s reading.
2.
Open the Project “SearchingRED_6.smp”
3.
Add a statement called “Deposit”. Since the deposit has the highest
priority, it should be added as the first statement
4.
Specify conditions, and actions.
5.
The advanced action is added to move the robot out of the deposit area
after unloading.
6.
Save the project as “Deposit”
7.
Build the project.
8.
Load the “Deposit.dll” to the RED robot and monitor its performance.