Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what...

10
Program Flow LabVIEW Robotics Fundamentals

Transcript of Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what...

Page 1: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Program Flow

LabVIEW Robotics Fundamentals

Page 2: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Unintuition

• You know what this program does…

• So what does this one do?

Inserted code

Page 3: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Unintuition

• Nope

then until TouchSensor pressed?

“Wide” turn with right wheel planted

Move forward

then

Wait in place 1 second

Page 4: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Unintuition

• Nope

then until Touch Sensor pressed?

“Wide” turn with right wheel planted

Move forward 1 sec

Page 5: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Unintuition

• Correct answer:

• But why? And how do you explain it?

then until Touch Sensor pressed

Turn in placeMove forward 1 sec

Page 6: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Intuition

• Commands in LabVIEW follow simple rules:– Commands run when the program reaches them– Robots are very literal

Page 7: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Intuition

• Run when the program reaches you– Blocks “pass” control of the program between

them as they are done• Motor commands pass control when they are done

setting the motor power (usually instantly)• Wait commands pass control when done waiting

Page 8: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Intuition

Be the Block Exercise:1. One person gets to “be” each command2. One person gets to “be” the robot3. Use a ball or other prop to represent control of

the program

Page 9: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Intuition

Be the Block Exercise:– Each motor “command” will tell the “robot” to do

something, such as “Set Motor C forward”– When done, hand “control” to the next command!– The “robot” should only do exactly what it is told!

Set Motors B and C forward!

Okay

(walking forward)

Page 10: Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.

Intuition

• To see this happen LIVE in LabVIEW:– Turn on Highlight Execution (near the Run button):

– Then Run the program; commands will animate to show which one is running!

Active command