Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball....

10
Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Transcript of Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball....

Page 1: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

RoboticsNXT sensors

Back to Light sensor: red vs blue ball.Lab: Maze. Add mallet. Hit red ball.Homework: Postings. Develop task

involving multiple sensors.

Page 2: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Lego sensors

Include

• physical packaging: way to attach to other Lego pieces

• electrical packaging: analog to digital signal: bit pattern representing a number

• software for / in NXT-G: block(s) and help text

Page 3: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Maze

• Ideas?

• Note: can simplify maze: say only right angles.

• How can robot know it is done (outside of maze)?

Page 4: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Maze: one approachLoop• Move forward a little (can set motors to glide)• Check bumper. If pressed, back up and turn

to the right (see next). May do this in one or two steps.

• Check ultrasonic mounted on the left. If >some amount, turn to left, move forward a little.

THERE ARE OTHERS!

Page 5: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Preview: Compass sensor

• Calculates magnetic heading: 0 to 359 degrees– Returns number– Returns true/false if inside or outside specified

range– Absolute or relative operation….

• Need to download software:Tools/Block Import and Export Wizard

Page 6: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.
Page 7: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Cautions

• Note: The compass measures the very weak earth's magnetic field. Ensure that is mounted at least 4 inches or 10 centimeters away from the NXT and motors.

Why????

Also ensure that it is mounted horizontally as the heading will not be accurate if the compass isn't level.

Why????

Page 8: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Tasks

• Task using ultrasonic sensor?

• Task using bumper (touch sensor)?

• Task using light?

• Task using compass sensor?

• Tasks using multiple sensorsNote: just 4 ports.

Page 9: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Red vs Blue ball• Build mallet (my word)

– pp 50-61

• Build stand– pp 62-67 OR– Do your own design, perhaps use tire for stand (more

stabile but need to check height) and something bigger to be detected by the ultrasound sensor.

• Use Mindstorms help for program.– Need to pick value that distinguishes red and blue ball

Page 10: Robotics NXT sensors Back to Light sensor: red vs blue ball. Lab: Maze. Add mallet. Hit red ball. Homework: Postings. Develop task involving multiple sensors.

Homework

• Postings

• Plan activity making use of multiple sensors

• Note: next week: coordinate systems, position[ing], NXT-G: variables, file system