Download presentation
Presentation is loading. Please wait.
1
My first robot programming - Simple “Go”
MSRDS First Beginner Course – STEP4 Young Joon Kim
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 Commands Go Usages Range of motor power values
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 Go backwards Use the value above 0 Ex)
robotname.Go() robotname.Go(0.3) robotname.Go(0.2, 0.2) Go backwards Use the negative value 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
Preparing basic environment
Launch SPL and add “StartSimulationEngine” command 1 2 Double click
9
Preparing basic environment
Expand “/FileName:” option Click + Expanded
10
Preparing basic environment
Double click “SimState/basicsim.xml” Double click
11
Preparing basic environment
Add “AddDifferentialDriveEntity” command on the “Entities” tab 1 Double click 2
12
Preparing basic environment
Add “FlushScript” command on the Actions tab 1 2 Double click
13
Preparing basic environment
Save as “script/SimpleGo.txt”
14
Preparing basic environment
Run SPL by pressing “F5” key or clicking “Run (F5)” icon
15
Preparing basic environment
Execution result
16
Simple “Go” drive
17
Simple “Go” drive Check available method for DriveEntity under the Actions tab
18
Simple “Go” drive base1.Go() How to use drive methods
“robot_name” + “.” + method Ex) Robot name: “base1” Method: “.Go()” base1.Go()
19
Simple “Go” drive Add “base1.Go()” command as follows
20
Simple “Go” drive Run SPL by pressing “F5” key or clicking “Run” icon
21
“Go Forwards” drive
22
“Go Forwards” drive Change drive command as follows
base1.Go() -> base1.Go(0.5) Left and right power will be set with 0.5
23
“Go Forwards” drive Change command as follows
24
“Go Forwards” drive Run SPL by pressing “F5” key or clicking “Run” icon
25
“Go Backwards” drive
26
“Go Backwards” drive Change drive command as follows
base1.Go(0.5) -> base1.Go(-0.3) Left and right power will be set with -0.3
27
“Go Backwards” drive Change command as follows
28
“Go Backwards” drive Execution result
29
Stopping a robot
30
Stopping a robot Add time delay command Wait milliseconds
Ex) wait 5 seconds Wait 5000
31
Stopping a robot Add “wait 5000” command as follows
32
Stopping a robot Add new drive command as follows base1.Go(0.0)
Left and right power will be set with 0.0
33
Stopping a robot Add “base1.Go(0.0)” as follows
34
Stopping a robot Execution result Go backwards 1 Stop 2
35
Going around
36
Going around Change drive command as follows
base1.Go(-0.3) -> base1.Go(0.2, 0.4) Left power will be set with 0.2 Right power will be set with 0.4
37
Going around Change command as follows
38
Going around Execution result
39
Turning round
40
Going around Change drive command as follows
base1.Go(0.2, 0.4) -> base1.Go(-0.2, 0.2) Left power will be set with -0.2 Right power will be set with 0.2
41
Going around Change command as follows
42
Turning round Execution result
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.