My first robot programming - Simple “Go” Young Joon Kim MSRDS First Beginner Course – STEP4
2 Topics Preparing basic environment Simple “Go” drive “Go Forwards” drive “Go Backwards” drive Stopping a robot Going around Turning round
3 “Go” Drive Commands
4 Go –Drive a robot with motor power –Motor power is set with given value and keeps its value Usages –robotname.Go() //default power is 0.2 –robotname.Go(power) –robotname.Go(left_power, right_power) Range of motor power values –-1.0 (Max backwards) ~ 1.0 (Max forwards) –0: Stop the motor
5 “Go” Drive Commands Go forwards –Use the value above 0 –Ex) robotname.Go() robotname.Go(0.3) robotname.Go(0.2, 0.2) Go backwards –Use the negative value –Ex) robotname.Go(-0.3) robotname.Go(-0.2, -0.2)
6 “Go” Drive Commands Stopping a robot –Use the value 0 –Ex) robotname.Go(0) robotname.Go(0, 0) robotname.Stop()
7 Preparing basic environment
8 Launch VPL and add an new “Data” activity
9 Preparing basic environment Type “Script/BasicEnv0.txt” with “string” type
10 Preparing basic environment Add “SPL Engine” service
11 Preparing basic environment Connect “Data” activity to “SPL Engine” service
12 Preparing basic environment Select “ExecuteScriptFile” on the right list 1 2
13 Preparing basic environment Select “value” item on the left list 1 2
14 Preparing basic environment Run VPL diagram by pressing “F5” key or clicking “Start” icon
15 Preparing basic environment Execution result
16 Simple “Go” drive
17 Simple “Go” drive Add a new “Data” activity and change its type as “string” 1 2
18 Simple “Go” drive Type “myrobot.Go()” in the new “Data” activity
19 Simple “Go” drive Add an new “SPL Drive” service
20 Connect the output point of “Data” activity to the input point of “SPL Drive” service by dragging Simple “Go” drive
21 Select “value” item on the left list Simple “Go” drive 1 2
22 Simple “Go” drive Run VPL diagram by pressing “F5” key or clicking “Start” icon
23 Simple “Go” drive Execution result
24 “Go Forwards” drive
25 “Go Forwards” drive Change drive command as follows –myrobot.Go() -> myrobot.Go(0.5) –Left and right power will be set with 0.5
26 “Go Forwards” drive Run VPL diagram by pressing “F5” key or clicking “Start” icon
27 Execution result “Go Forwards” drive
28 “Go Backwards” drive
29 “Go Backwards” drive Change drive command as follows –myrobot.Go(0.5) -> myrobot.Go(-0.1) –Left and right power will be set with -0.1
30 “Go Backwards” drive Run VPL diagram by pressing “F5” key or clicking “Start” icon
31 Execution result “Go Backwards” drive
32 Stopping a robot
33 Stopping a robot Add an new “HelloApps (Util) Button Dialog” service
34 Stopping a robot Add below diagram to make a robot stop 1 2
35 Stopping a robot Connect notification point of “Button Dialog” to the input point of “Data” activity Input point Output point Notification point
36 Stopping a robot Connect notification point of “Button Dialog” to the input point of “Data” activity
37 Stopping a robot Select “NotifyButtonClicked” item on the left list
38 Stopping a robot Run VPL diagram by pressing “F5” key or clicking “Start” icon
39 Execution result Stopping a robot Go backwards Click Stop
40 Going around
41 Going around Reopen “Going Forwards” diagram sample
42 Going around Change drive command as follows –myrobot.Go(0.5) -> myrobot.Go(0.2, 0.4) –Left and right power will be set with 0.2 and 0.4
43 Going around Run VPL diagram by pressing “F5” key or clicking “Start” icon
44 Execution result Going around
45 Turning round
46 Turning round Change drive command as follows –myrobot.Go(0.2, 0.4) -> myrobot.Go(0.2, -0.2) –Left and right power will be set with 0.2 and -0.2
47 Turning round Run VPL diagram by pressing “F5” key or clicking “Start” icon
48 Execution result Turning round