File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 2
2
require 'readline'
3
3
include Orocos
4
4
5
+ ## Initialize orocos ##
5
6
Orocos . initialize
6
7
8
+ ## Execute the deployment 'rock_tutorial' ##
7
9
Orocos . run 'rock_tutorial' do
8
10
11
+ ## Get a specific task context ##
9
12
rockControl = TaskContext . get 'rock_tutorial_control'
10
13
rockVisualization = TaskContext . get 'rock_tutorial_visualization'
11
14
15
+ ## Connect the ports ##
12
16
rockControl . pose . connect_to rockVisualization . pose
13
17
18
+ ## Create a sample writer for a port ##
14
19
sampleWriter = rockControl . motion_command . writer
15
20
21
+ ## Start the tasks ##
16
22
rockControl . start
17
23
rockVisualization . start
18
24
25
+ ## Write motion command sample ##
19
26
sample = sampleWriter . new_sample
20
27
sample . translation = 1
21
28
sample . rotation = 0.5
22
29
sampleWriter . write ( sample )
23
30
24
31
Readline ::readline ( 'Press enter to exit' )
25
-
26
32
end
Original file line number Diff line number Diff line change 2
2
require 'readline'
3
3
include Orocos
4
4
5
+ ## Initialize orocos ##
5
6
Orocos . initialize
6
7
8
+ ## Execute the deployments 'rock_tutorial' and 'joystick_local' ##
7
9
Orocos . run 'rock_tutorial' , 'joystick_local' do
8
10
11
+ ## Get the specific task context ##
9
12
rockControl = TaskContext . get 'rock_tutorial_control'
10
13
rockVisualization = TaskContext . get 'rock_tutorial_visualization'
11
14
joystickLocal = TaskContext . get 'joystick_local'
12
15
16
+ ## Connect the ports ##
13
17
joystickLocal . motion_command . connect_to rockControl . motion_command
14
18
rockControl . pose . connect_to rockVisualization . pose
15
19
20
+ ## Set some properties ##
21
+ joystickLocal . joystick_device = "/dev/input/js0"
22
+
23
+ ## Configure the tasks ##
16
24
joystickLocal . configure
17
- joystickLocal . start
18
25
26
+ ## Start the tasks ##
27
+ joystickLocal . start
19
28
rockControl . start
20
29
rockVisualization . start
21
30
22
31
Readline ::readline ( 'Press enter to exit' )
23
-
24
32
end
You can’t perform that action at this time.
0 commit comments