Upload
marion-joseph
View
220
Download
0
Embed Size (px)
Citation preview
EducateNXT
Introducing AutonomyAutonomous behavior occurs when a robot, using its own sensors, can make a decision for itself.
The Sumo EduBots shown have light and ultrasonic sensors that allow them to make decisions.
EducateNXT
Where am I?The first task is for the EduBot to stay inside the dohyo when it moves.
It must know whether it is on the white middle or the black boundary – and what to do in each case.
Write down what action you want for the EduBot when it is on…
White middle
________________________________________________________________________
Black boundary
________________________________________________________________________
EducateNXT
Where am I? Flowchart
What reading does the light sensor see?
Drive Forward(unlimited duration)
Stop and turn around
Sees black
Sees white
Repeat
Here is the answer in the form of a flowchart.
EducateNXT
Where am I? Program
Here is the answer in the form of a flow chartHere is the answer in the form of a program.
With some blanks for you to work out.
Note the < sign in the Compare part of the switch configuration panel has been switched to get “sees black” on the top branch.
Mouse click to reveal blocks.
EducateNXT
Where are you?Using the ultrasonic sensor, the opponent can be tracked.
To attach an ultrasonic sensor, you can use the NXT Building Guide that comes with the kit.
Or better yet, try and attach your own – maybe at
the front.
EducateNXT
Programming the U.S. SensorFill in the behaviors
U.S. Sensor Behavior
Can detect an object within
range
Cannot detect an object within
range
EducateNXT
Programming the U.S. Sensor
The Flowchart
Check U.S. sensor.Is there an object in front of the robot?
?
?Yes
No
Repeat
EducateNXT
Two Sensors – One Program
Check light sensor
?
Check ultrasonic
sensor
?
?
Black boundary detected
Opponent found
No object detected
Sees white only
Repeat
Which sensor takes priority (goes first) – light or ultrasonic?
Programming up to you – no hints this
time!