110 likes | 242 Views
Program Flow. LabVIEW Robotics Fundamentals. Unintuition. You know what this program does… So what does this one do?. Inserted code. Unintuition. Nope. until Touch Sensor pressed?. then. then. “Wide” turn with right wheel planted. Move forward. Wait in place 1 second. Unintuition.
E N D
Program Flow LabVIEW Robotics Fundamentals
Unintuition • You know what this program does… • So what does this one do? Inserted code
Unintuition • Nope until TouchSensor pressed? then then “Wide” turn with right wheel planted Move forward Wait in place 1 second
Unintuition • Nope until Touch Sensor pressed? then “Wide” turn with right wheel planted Move forward 1 sec
Unintuition • Correct answer: • But why? And how do you explain it? until Touch Sensor pressed then Turn in place Move forward 1 sec
Intuition • Commands in LabVIEW follow simple rules: • Commands run when the program reaches them • Robots are very literal
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
Intuition Be the Block Exercise: • One person gets to “be” each command • One person gets to “be” the robot • Use a ball or other prop to represent control of the program
Intuition Set Motors B and C forward! 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! Okay (walking forward)
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