Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic...
-
Upload
colin-kristopher-marsh -
Category
Documents
-
view
215 -
download
0
Transcript of Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic...
![Page 1: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/1.jpg)
Robotics
Abstractions: Levels of language, world viewIntroduction to Lego Mindstorms
Build basic robotWrite & download program
Homework: postings
![Page 2: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/2.jpg)
Levels of language
• Distinguish between – task: what you want to do– procedure: how you/your program directs
robot to do it
• Even procedure level distinguishes between– moving robot joints to get to an endpoint vs– moving robot joints
![Page 3: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/3.jpg)
World view
• What does the robot (you?) know about the work area?
• What are assumptions / constraints?
• Related to: how robust is it necessary to make the program / strategy
![Page 4: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/4.jpg)
Levels of language: Task level
[Unconstrained]: block A somewhere on table, block B somewhere on table
PUT BLOCK A ON BLOCK B
[More constrained]: block A a specific place on the table, block B a specific place
PUT BLOCK A ON BLOCK B
![Page 5: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/5.jpg)
Levels of language: Procedure
[Unconstrained]: block A somewhere on table, block B somewhere on tableLOCATE BLOCK ALOCATE BLOCK BPICK UP BLOCK AMOVE BLOCK A OVER TO CALCULATED POSITION ABOVE BMOVE BLOCK A TO CALCULATED POSITION ON B
[More constrained]: block A a specific place on the table, block B a specific placePICK UP BLOCK AMOVE BLOCK A OVER TO ABOVE BLOCK BMOVE BLOCK A DOWN UNTIL CONTACT
![Page 6: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/6.jpg)
Levels of Language: joints, sensors, etc.
[Unconstrained]: block A somewhere on table, block B somewhere on tableInvoke vision system to locate block A and block B OR invoke search program ….Calculate joint positions for path to get to block ACalculate gripping positionSet joints so as to move block A over to calculated position above BSet joints so as to move/lower block A…possibly do move until touch
[More constrained]: block A a specific place on the table, block B a specific placeCalculate joint positions for path to get to block ACalculate gripping positionSet joints so as to move block A over to calculated position above BSet joints so as to move/lower block A…possibly do move until touch
![Page 7: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/7.jpg)
Language, world view
• My choices of levels of language (task, procedure, robot joints) not the only ones
• Can pose higher levels and lower levels!
• These are general concepts to keep in mind. Will return to it.
![Page 8: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/8.jpg)
Assembly is ….
• Challenging– Locating parts– Calculating trajectories– Allowing for variability– …
• Concept of ‘preserving orientation’
![Page 9: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/9.jpg)
Exercise[s]
• Pick task and describe in task terms and in procedural terms– (Shoe tying)– Opening/unwrapping gift– Put on coat– Sharpening a pencil using automatic or
manual pencil sharpener– Cooking scrambled eggs– Building the basic Mindstorms robot!
ANSWER this on moodle!!!!
![Page 10: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/10.jpg)
Lego parts
• Electronic– the Brick, motors, sensors, cables
• Structural– beams, other
• Connectors– some friction, some smooth
• Gears– transfer and/or change torque
• Miscellaneous– tires, Lego people, other
![Page 11: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/11.jpg)
NXT-G• Level of language is low.
– Note: considerable computation at motors and sensors
• You/your NXT-G program direct tribot actions directly: procedure, not task.
• Preview: – Task: hit the red ball– You will program: Procedure:
• move forward using certain motors until certain sensor indicates time to stop
• check light level to determine which ball• if red ball, move arm motor to swing
![Page 12: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/12.jpg)
Lego Mindstorm NXT
• Create program using drag-and-drop of “blocks”– Iconic form of programming– Each icon/block has its own set of settings
(parameters) and (possibly) data links to be set
• Add comments. File/Save As (…save)• Then download program to NXT brick
– Compile and download. Any syntactic errors will be caught.
• Missing data link
– Failure if lack of space on the NXT brick• Will need to be conscious of space
![Page 13: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/13.jpg)
Move block: initial setting
Motors B & C
75% power
1 Rotation
Brake after 1 rotation (not coast)
![Page 14: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/14.jpg)
Important fact…
• You (the builder of the robot) must make sure that motor B and motor C do what you want. This depends on– Where/how you build– What port– External conditions
• The program doesn’t know anything. It just sends a signal to a port.
![Page 15: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/15.jpg)
Direction now set to curve
Power at 25%
5 seconds
Coast after 5 seconds
![Page 16: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/16.jpg)
How…
• Do you get robot to travel specific distance?
• Use trial-and-error to set time or rotations
• Use feedback: keep computer connected to NXT and monitor rotations
• Next class!
![Page 17: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/17.jpg)
Feedback information
Data links: input & output
![Page 18: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/18.jpg)
Sound block
built-in sounds + capability for individual tones & sound files
WARNING: sound files are big.
![Page 19: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/19.jpg)
Build
• Basic robot• NXT brick serves as main chassis• Carried around by wheels operated by 2
motors– Attached to appropriate ports
• Will add – Grabber– Sensors
• More programs
![Page 20: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/20.jpg)
Today’s challenge
• Build basic robot
• Program to – Go forward, – Say “Have a nice day” ,– Turn around in a curve– Go back
![Page 21: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/21.jpg)
Program has been saved on computer File/Save
Used comment writer to document action
Program consists of
Move block
Sound block
Move block (turning)
Move block
![Page 22: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/22.jpg)
Comment
• Blocks may – Do something
• Make sound and wait for completion versus…• Turn motors for X rotations/degrees/seconds
– Start something• Start sound• Turn motors on unlimited (will do this next class)
– Actually, mostly blocks: Try to do something• Motors try to turn in rough terrain….
![Page 23: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/23.jpg)
Go!
• Use directions in the kit.– Page 8 to 22 which is– Steps 1 to 17
• NOTE: step 14: putting in batteries has already been done• These kits use Lithium battery, which needs to be charged up.
– Turn on and try demo program– Write program and download
• DON’T MIX PARTS.– Be careful: especially with small pieces
• DON’T LOSE PARTS.• Need to be careful that cables are not in the way!• Make haste slowly.
![Page 24: Robotics Abstractions: Levels of language, world view Introduction to Lego Mindstorms Build basic robot Write & download program Homework: postings.](https://reader030.fdocuments.net/reader030/viewer/2022032803/56649e2f5503460f94b1fc6b/html5/thumbnails/24.jpg)
Team work
• For this activity: everyone should be aware of all details.– Take turns.– Don’t assume you can’t do anything.
• For bigger projects, there may be specialists.