Skip to content

Commit f41160a

Browse files
committed
added comments to the ruby scripts
1 parent 736ce0f commit f41160a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

scripts/simpleRockTutorialTest.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
require 'readline'
33
include Orocos
44

5+
## Initialize orocos ##
56
Orocos.initialize
67

8+
## Execute the deployment 'rock_tutorial' ##
79
Orocos.run 'rock_tutorial' do
810

11+
## Get a specific task context ##
912
rockControl = TaskContext.get 'rock_tutorial_control'
1013
rockVisualization = TaskContext.get 'rock_tutorial_visualization'
1114

15+
## Connect the ports ##
1216
rockControl.pose.connect_to rockVisualization.pose
1317

18+
## Create a sample writer for a port ##
1419
sampleWriter = rockControl.motion_command.writer
1520

21+
## Start the tasks ##
1622
rockControl.start
1723
rockVisualization.start
1824

25+
## Write motion command sample ##
1926
sample = sampleWriter.new_sample
2027
sample.translation = 1
2128
sample.rotation = 0.5
2229
sampleWriter.write(sample)
2330

2431
Readline::readline('Press enter to exit')
25-
2632
end

scripts/startRockTutorial.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22
require 'readline'
33
include Orocos
44

5+
## Initialize orocos ##
56
Orocos.initialize
67

8+
## Execute the deployments 'rock_tutorial' and 'joystick_local' ##
79
Orocos.run 'rock_tutorial', 'joystick_local' do
810

11+
## Get the specific task context ##
912
rockControl = TaskContext.get 'rock_tutorial_control'
1013
rockVisualization = TaskContext.get 'rock_tutorial_visualization'
1114
joystickLocal = TaskContext.get 'joystick_local'
1215

16+
## Connect the ports ##
1317
joystickLocal.motion_command.connect_to rockControl.motion_command
1418
rockControl.pose.connect_to rockVisualization.pose
1519

20+
## Set some properties ##
21+
joystickLocal.joystick_device = "/dev/input/js0"
22+
23+
## Configure the tasks ##
1624
joystickLocal.configure
17-
joystickLocal.start
1825

26+
## Start the tasks ##
27+
joystickLocal.start
1928
rockControl.start
2029
rockVisualization.start
2130

2231
Readline::readline('Press enter to exit')
23-
2432
end

0 commit comments

Comments
 (0)