robotics abstractions: levels of language, world view introduction to lego mindstorms build basic...
TRANSCRIPT
Robotics
Abstractions: Levels of language, world viewIntroduction to Lego Mindstorms
Build basic robotWrite & download program
Homework: postings
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
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
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
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
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
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.
Assembly is ….
• Challenging– Locating parts– Calculating trajectories– Allowing for variability– …
• Concept of ‘preserving orientation’
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!!!!
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
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
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
Move block: initial setting
Motors B & C
75% power
1 Rotation
Brake after 1 rotation (not coast)
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.
Direction now set to curve
Power at 25%
5 seconds
Coast after 5 seconds
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!
Feedback information
Data links: input & output
Sound block
built-in sounds + capability for individual tones & sound files
WARNING: sound files are big.
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
Today’s challenge
• Build basic robot
• Program to – Go forward, – Say “Have a nice day” ,– Turn around in a curve– Go back
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
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….
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.
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.