Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[builder] replace configure_mw by add_stream

  • Loading branch information...
commit 680d5a5f04adcce556c29e5b0983a6c1849c4b4d 1 parent 67765ad
Pierrick Koch authored

Showing 65 changed files with 180 additions and 180 deletions. Show diff stats Hide diff stats

  1. +2 2 addons/io_export_morse_scene.py
  2. +3 3 bindings/pymorse/pymorse-testing.py
  3. +2 2 bindings/pymorse/pymorse.py
  4. +3 3 doc/morse/user/advanced_tutorials/cat_and_mouse.rst
  5. +4 4 doc/morse/user/advanced_tutorials/ros_tutorial.rst
  6. +2 2 doc/morse/user/advanced_tutorials/tutorial_builder_ros.rst
  7. +1 1  doc/morse/user/beginner_tutorials/hri_tutorial.rst
  8. +1 1  doc/morse/user/beginner_tutorials/tutorial.rst
  9. +3 3 doc/morse/user/beginner_tutorials/yarp_tutorial.rst
  10. +6 6 doc/morse/user/builder.rst
  11. +11 11 doc/morse/user/builder_example.rst
  12. +1 1  doc/morse/user/others/human.rst
  13. +8 8 examples/scenarii/action-1.py
  14. +3 3 examples/scenarii/quadrotor_dynamic_example.py
  15. +3 3 examples/scenarii/ros_depth.py
  16. +2 2 examples/scenarii/ros_example.py
  17. +2 2 examples/scenarii/ros_example_multi.py
  18. +5 5 examples/scenarii/ros_example_pr2.py
  19. +9 9 examples/scenarii/rosace-1.py
  20. +8 8 examples/scenarii/test-1.py
  21. +3 3 examples/tutorials/cat_mouse_game.py
  22. +4 4 examples/tutorials/multinode/dala_simple.py
  23. +4 4 examples/tutorials/ros_navigation/scenario.py
  24. +3 3 examples/tutorials/tutorial-2-yarp.py
  25. +1 1  src/morse/builder/robots/human.py
  26. +1 1  testing/base/armature_pose_testing.py
  27. +3 3 testing/base/armature_testing.py
  28. +1 1  testing/base/battery_testing.py
  29. +2 2 testing/base/destination_testing.py
  30. +1 1  testing/base/gps_testing.py
  31. +2 2 testing/base/gripper_testing.py
  32. +1 1  testing/base/gyroscope_testing.py
  33. +2 2 testing/base/light_testing.py
  34. +2 2 testing/base/ned_testing.py
  35. +3 3 testing/base/odometry_testing.py
  36. +3 3 testing/base/orientation_testing.py
  37. +1 1  testing/base/pose_testing.py
  38. +3 3 testing/base/proximity_testing.py
  39. +3 3 testing/base/ptu_testing.py
  40. +2 2 testing/base/rotorcraft_waypoint_testing.py
  41. +2 2 testing/base/semantic_camera_testing.py
  42. +1 1  testing/base/sick_testing.py
  43. +2 2 testing/base/stabilized_quadrirotor_testing.py
  44. +2 2 testing/base/steer_force_testing.py
  45. +2 2 testing/base/teleport_testing.py
  46. +2 2 testing/base/thermometer_testing.py
  47. +2 2 testing/base/utm_mod_testing.py
  48. +2 2 testing/base/victim_testing.py
  49. +3 3 testing/base/video_camera_diffimg_testing.py
  50. +2 2 testing/base/video_camera_testing.py
  51. +2 2 testing/base/vw_testing.py
  52. +2 2 testing/base/waypoint_testing.py
  53. +2 2 testing/base/xyw_testing.py
  54. +2 2 testing/middlewares/ros/data_stream.py
  55. +3 3 testing/middlewares/ros/depth_camera.py
  56. +3 3 testing/middlewares/ros/sick.py
  57. +3 3 testing/middlewares/ros/video_camera.py
  58. +2 2 testing/middlewares/yarp/yarp_datastream_testing.py
  59. +2 2 testing/robots/human/human_pose.py
  60. +1 1  testing/robots/pr2/jointstate.py
  61. +3 3 testing/robots/segway/reverse_vw.py
  62. +3 3 testing/robots/segway/segway_vw.py
  63. +3 3 testing/robots/segway/spiral-dala.py
  64. +3 3 testing/robots/segway/spiral.py
  65. +2 2 tools/io_export_morse.py
4 addons/io_export_morse_scene.py
@@ -170,14 +170,14 @@ def scan_config(file_out):
170 170 if isinstance (value[0], str):
171 171 mw = value[0]
172 172 mw = mw.lower()
173   - file_out.write("%s.configure_mw('%s', %s)\n" % (component, mw, value))
  173 + file_out.write("%s.add_stream('%s', %s)\n" % (component, mw, value))
174 174 # If using the new syntax that allows more than one middleware
175 175 # per component
176 176 else:
177 177 for item in value:
178 178 mw = item[0]
179 179 mw = mw.lower()
180   - file_out.write("%s.configure_mw('%s', %s)\n" % (component, mw, item))
  180 + file_out.write("%s.add_stream('%s', %s)\n" % (component, mw, item))
181 181
182 182 try:
183 183 component_config.component_service
6 bindings/pymorse/pymorse-testing.py
@@ -31,11 +31,11 @@ def setUpEnv(self):
31 31 robot1.translate(0.0,1.0,0.0)
32 32
33 33 battery = Sensor('battery')
34   - battery.configure_mw('socket')
  34 + battery.add_stream('socket')
35 35 robot1.append(battery)
36 36
37 37 motion = Actuator('waypoint')
38   - motion.configure_mw('socket')
  38 + motion.add_stream('socket')
39 39 motion.configure_service('socket')
40 40 robot1.append(motion)
41 41
@@ -46,7 +46,7 @@ def setUpEnv(self):
46 46
47 47 pose = Sensor('pose')
48 48 pose.name = "MyPose"
49   - pose.configure_mw('socket')
  49 + pose.add_stream('socket')
50 50 robot2.append(pose)
51 51
52 52 # Environment
4 bindings/pymorse/pymorse.py
@@ -48,12 +48,12 @@
48 48
49 49 pose = Sensor('pose')
50 50 pose.name = "pose"
51   - pose.configure_mw('socket')
  51 + pose.add_stream('socket')
52 52 r2d2.append(pose)
53 53
54 54 motion = Actuator('waypoint')
55 55 motion.name = "motion"
56   - motion.configure_mw('socket')
  56 + motion.add_stream('socket')
57 57 motion.configure_service('socket')
58 58 r2d2.append(motion)
59 59
6 doc/morse/user/advanced_tutorials/cat_and_mouse.rst
Source Rendered
@@ -90,9 +90,9 @@ actuator to follow it.
90 90
91 91 .. code-block:: python
92 92
93   - V_W.configure_mw('socket')
94   - Semantic_L.configure_mw('socket')
95   - Semantic_R.configure_mw('socket')
  93 + V_W.add_stream('socket')
  94 + Semantic_L.add_stream('socket')
  95 + Semantic_R.add_stream('socket')
96 96
97 97 And finally we complete the scene configuration:
98 98
8 doc/morse/user/advanced_tutorials/ros_tutorial.rst
Source Rendered
@@ -67,7 +67,7 @@ get some odometry feedback.
67 67 # An odometry sensor to get odometry information
68 68 odometry = Sensor('odometry')
69 69 james.append(odometry)
70   - odometry.configure_mw('ros')
  70 + odometry.add_stream('ros')
71 71
72 72 # Keyboard control
73 73 keyboard = Actuator('keyboard')
@@ -110,7 +110,7 @@ First complete the ``scenario.py`` script by adding a posture sensor:
110 110
111 111 pr2_posture = Sensor('pr2_posture')
112 112 james.append(pr2_posture)
113   - pr2_posture.configure_mw('ros')
  113 + pr2_posture.add_stream('ros')
114 114
115 115 [...]
116 116
@@ -186,7 +186,7 @@ Edit ``scenario.py`` to add a SICK sensor, configured to approximate the PR2 Hok
186 186 sick.properties(laser_range = 30.0)
187 187 sick.properties(resolution = 1.0)
188 188 sick.properties(scan_window = 180.0)
189   - sick.configure_mw('ros')
  189 + sick.add_stream('ros')
190 190
191 191 We can now build a first map of our environment. Restart the simulation with
192 192 ``morse run scenario.py``.
@@ -260,7 +260,7 @@ Then, we need to add a motion controller to our robot. Open your ``scenario.py``
260 260
261 261 motion_controller = Actuator('xy_omega')
262 262 james.append(motion_controller)
263   - motion_controller.configure_mw('ros')
  263 + motion_controller.add_stream('ros')
264 264
265 265 For the navigation, we will use the high-level ``move_base`` ROS module. The
266 266 *2D Nav Goal* button in RVIZ interface will allow us to easily send navigation
4 doc/morse/user/advanced_tutorials/tutorial_builder_ros.rst
Source Rendered
@@ -58,8 +58,8 @@ Configuring the middlewares
58 58 +++++++++++++++++++++++++++
59 59 .. code-block:: python
60 60
61   - gyroscope.configure_mw('ros')
62   - motion.configure_mw('ros')
  61 + gyroscope.add_stream('ros')
  62 + motion.add_stream('ros')
63 63
64 64 The middleware components will automatically be appended to the scene when necessary.
65 65
2  doc/morse/user/beginner_tutorials/hri_tutorial.rst
Source Rendered
@@ -126,7 +126,7 @@ In this tutorial, we will use sockets to stream the pose out of MORSE:
126 126
127 127 # Set the pose sensor to use the socket interface to communicate
128 128 # with modules outside of MORSE.
129   - pose.configure_mw('socket')
  129 + pose.add_stream('socket')
130 130
131 131 # [...]
132 132
2  doc/morse/user/beginner_tutorials/tutorial.rst
Source Rendered
@@ -103,7 +103,7 @@ with the outside world. This is done with these instructions:
103 103
104 104 .. code-block:: python
105 105
106   - pose.configure_mw('socket')
  106 + pose.add_stream('socket')
107 107 pose.configure_service('socket')
108 108 motion.configure_service('socket')
109 109
6 doc/morse/user/beginner_tutorials/yarp_tutorial.rst
Source Rendered
@@ -53,9 +53,9 @@ This is done with these lines:
53 53
54 54 .. code-block:: python
55 55
56   - Motion_Controller.configure_mw('yarp')
57   - Pose.configure_mw('yarp')
58   - Camera.configure_mw('yarp')
  56 + Motion_Controller.add_stream('yarp')
  57 + Pose.add_stream('yarp')
  58 + Camera.add_stream('yarp')
59 59
60 60 This will fill up the necessary information into the ``component_config.py`` file
61 61 inside the newly created Blender scenario.
12 doc/morse/user/builder.rst
Source Rendered
@@ -65,7 +65,7 @@ The Component classes
65 65 The class ``Component`` inherits directly from ``AbstractComponent`` and adds
66 66 more functions:
67 67
68   - * **configure_mw**: Do the binding between a component and the method to
  68 + * **add_stream**: Do the binding between a component and the method to
69 69 export/import its data. This must be used in general by sensors and
70 70 actuators. A single component can make several calls to this function to add
71 71 bindings with more than one middleware. The parameter can be either the name
@@ -336,18 +336,18 @@ added to the scene when the builder script is parsed.
336 336
337 337 In order to set a component-middleware-method, we have two options, the first
338 338 one is simple for the user, but requires some pre-configuration (a dictionary
339   -defined in the file ``src/morse/builder/data.py``). The argument of the 'configure_mw'
  339 +defined in the file ``src/morse/builder/data.py``). The argument of the 'add_stream'
340 340 method is a string with the name of the middleware.
341 341
342 342 .. code-block:: python
343 343
344   - motion.configure_mw('ros')
345   - motion.configure_mw('yarp')
  344 + motion.add_stream('ros')
  345 + motion.add_stream('yarp')
346 346
347 347 cf. ``morse.builder.data.MORSE_DATASTREAM_DICT``
348 348
349 349 More than one middleware can be configured for the same component, by using
350   -several calls to the component.configure_mw method.
  350 +several calls to the component.add_stream method.
351 351
352 352 The second one is a bit less simple for the end-user.
353 353 It consists of including the description of the middleware binding just as it
@@ -355,7 +355,7 @@ would be done by hand in the ``component_config.py`` script:
355 355
356 356 .. code-block:: python
357 357
358   - motion.configure_mw('ros', 'read_twist', 'morse/middleware/ros/read_vw_twist')
  358 + motion.add_stream('ros', 'read_twist', 'morse/middleware/ros/read_vw_twist')
359 359
360 360 cf. :doc:`hooks <../user/hooks>` and the tutorial on :doc:`manually building a scene
361 361 <../user/advanced_tutorials/editing_in_blender>` (in particular the section configuring middleware) for details.
22 doc/morse/user/builder_example.rst
Source Rendered
@@ -43,12 +43,12 @@ Let's have a look to a typical ``Builder`` script, and explain it, step by step:
43 43 cam.properties(cam_width = 128, cam_height = 128)
44 44
45 45 # Configure the middlewares
46   - motion.configure_mw('ros')
47   - odometry.configure_mw('ros')
48   - proximity.configure_mw('ros')
49   - pose.configure_mw('ros')
50   - sick.configure_mw('ros')
51   - cam.configure_mw('ros')
  46 + motion.add_stream('ros')
  47 + odometry.add_stream('ros')
  48 + proximity.add_stream('ros')
  49 + pose.add_stream('ros')
  50 + sick.add_stream('ros')
  51 + cam.add_stream('ros')
52 52
53 53 env = Environment('land-1/trees')
54 54 env.place_camera([-5.0, 5.0, 3.0])
@@ -146,21 +146,21 @@ Middleware configuration
146 146 For usual sensors and actuators, configuring a middleware to access the
147 147 component is as easy as::
148 148
149   - motion.configure_mw('ros')
  149 + motion.add_stream('ros')
150 150
151 151 One component can be made accessible through several middleware by simply
152   -calling again ``configure_mw``::
  152 +calling again ``add_stream``::
153 153
154   - motion.configure_mw('yarp')
  154 + motion.add_stream('yarp')
155 155
156 156 You can check which sensors and actuators are supported by which middleware in
157 157 the :doc:`compatibility matrix <integration>`.
158 158
159 159 .. note::
160 160 Sometimes, you will need to use a specific serialization method.
161   - This can be achieved by passing more parameters to ``configure_mw``::
  161 + This can be achieved by passing more parameters to ``add_stream``::
162 162
163   - motion.configure_mw('ros', 'read_twist', 'morse/middleware/ros/read_vw_twist')
  163 + motion.add_stream('ros', 'read_twist', 'morse/middleware/ros/read_vw_twist')
164 164
165 165 In that case, we instruct MORSE to use ROS with the ``read_twist`` method
166 166 defined in the ``morse.middleware.ros.read_vw_twist`` module.
2  doc/morse/user/others/human.rst
Source Rendered
@@ -72,7 +72,7 @@ Usage example:
72 72 human.translate(x=5.5, y=-3.2, z=0.0)
73 73 human.rotate(z=-3.0)
74 74
75   - human.armature.configure_mw('pocolibs',
  75 + human.armature.add_stream('pocolibs',
76 76 ['morse.middleware.pocolibs_datastream.Pocolibs',
77 77 'export_posture',
78 78 'morse/middleware/pocolibs/sensors/human_posture',
16 examples/scenarii/action-1.py
@@ -66,16 +66,16 @@
66 66
67 67
68 68 # Scene configuration
69   -GPS_001.configure_mw('yarp')
70   -CameraMain_002.configure_mw('yarp')
71   -Motion_Controller.configure_mw('yarp')
72   -Gyroscope_001.configure_mw('yarp')
  69 +GPS_001.add_stream('yarp')
  70 +CameraMain_002.add_stream('yarp')
  71 +Motion_Controller.add_stream('yarp')
  72 +Gyroscope_001.add_stream('yarp')
73 73
74   -Platine.configure_mw('yarp')
  74 +Platine.add_stream('yarp')
75 75
76   -Motion_Controller_001.configure_mw('pocolibs')
77   -Stereo.configure_mw('pocolibs')
78   -Gyroscope.configure_mw('pocolibs')
  76 +Motion_Controller_001.add_stream('pocolibs')
  77 +Stereo.add_stream('pocolibs')
  78 +Gyroscope.add_stream('pocolibs')
79 79
80 80 GPS_001.configure_modifier('NED')
81 81 Motion_Controller.configure_modifier('NED')
6 examples/scenarii/quadrotor_dynamic_example.py
@@ -16,12 +16,12 @@
16 16 if waypoint_controller:
17 17 motion = Actuator('rotorcraft_waypoint')
18 18 motion.name = 'waypoint'
19   - motion.configure_mw('ros')
  19 + motion.add_stream('ros')
20 20 else:
21 21 # simple controller taking RC-like roll/pitch/yaw/thrust input
22 22 motion = Actuator('rotorcraft_attitude')
23 23 motion.name = 'attitude'
24   - motion.configure_mw('ros', 'read_ctrl_input', 'morse/middleware/ros/read_asctec_ctrl_input')
  24 + motion.add_stream('ros', 'read_ctrl_input', 'morse/middleware/ros/read_asctec_ctrl_input')
25 25
26 26 Quadrotor.append(motion)
27 27
@@ -29,7 +29,7 @@
29 29 imu.name = 'imu'
30 30 # IMU with z-axis down (NED)
31 31 imu.rotate(x=math.pi)
32   -imu.configure_mw('ros')
  32 +imu.add_stream('ros')
33 33 Quadrotor.append(imu)
34 34
35 35 env = Environment('indoors-1/indoor-1')
6 examples/scenarii/ros_depth.py
@@ -8,14 +8,14 @@
8 8 motion.translate(z=0.3)
9 9 motion.name = 'Motion'
10 10 atrv.append(motion)
11   -motion.configure_mw('ros')
  11 +motion.add_stream('ros')
12 12
13 13 # Append an Odometry sensor
14 14 odometry = Sensor('odometry')
15 15 odometry.name = 'Odometry'
16 16 odometry.translate(z=0.73)
17 17 atrv.append(odometry)
18   -odometry.configure_mw('ros')
  18 +odometry.add_stream('ros')
19 19
20 20 # Append a camera
21 21 camera = Sensor('depth_camera')
@@ -26,7 +26,7 @@
26 26 capturing = True, Depth = True)
27 27 camera.frequency(15)
28 28 atrv.append(camera)
29   -camera.configure_mw('ros')
  29 +camera.add_stream('ros')
30 30
31 31 env = Environment('indoors-1/indoor-1')
32 32 env.aim_camera([1.0470, 0, 0.7854])
4 examples/scenarii/ros_example.py
@@ -16,8 +16,8 @@
16 16 atrv.append(gyroscope)
17 17
18 18 # Configuring the middlewares
19   -gyroscope.configure_mw('ros')
20   -motion.configure_mw('ros')
  19 +gyroscope.add_stream('ros')
  20 +motion.add_stream('ros')
21 21
22 22 env = Environment('indoors-1/indoor-1')
23 23 env.aim_camera([1.0470, 0, 0.7854])
4 examples/scenarii/ros_example_multi.py
@@ -17,8 +17,8 @@ def import_atrv(mw):
17 17 atrv.append(gyroscope)
18 18
19 19 # Configuring the middlewares
20   - gyroscope.configure_mw(mw)
21   - motion.configure_mw(mw)
  20 + gyroscope.add_stream(mw)
  21 + motion.add_stream(mw)
22 22 return atrv
23 23
24 24 atrv1 = import_atrv('ros')
10 examples/scenarii/ros_example_pr2.py
@@ -47,11 +47,11 @@
47 47 james.append(keyboard)
48 48
49 49 # Configuring the middlewares
50   -Pose_sensor.configure_mw('ros')
51   -Sick.configure_mw('ros')
52   -Motion_Controller.configure_mw('ros')
53   -IMU.configure_mw('ros')
54   -pr2_posture.configure_mw('ros', 'post_jointState', 'morse/middleware/ros/pr2_posture')
  50 +Pose_sensor.add_stream('ros')
  51 +Sick.add_stream('ros')
  52 +Motion_Controller.add_stream('ros')
  53 +IMU.add_stream('ros')
  54 +pr2_posture.add_stream('ros', 'post_jointState', 'morse/middleware/ros/pr2_posture')
55 55
56 56 # Add passive objects
57 57 cornflakes = PassiveObject('props/kitchen_objects', 'Cornflakes')
18 examples/scenarii/rosace-1.py
@@ -60,15 +60,15 @@
60 60 ATRV_001.append(Thermometer_001)
61 61
62 62
63   -GPS.configure_mw('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
64   -Motion_Controller.configure_mw('yarp', 'read_json_waypoint', 'morse/middleware/yarp/json_mod')
65   -Rosace_Sensor.configure_mw('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
66   -Proximity_Sensor.configure_mw('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
67   -
68   -Rosace_Sensor_001.configure_mw('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
69   -GPS_001.configure_mw('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
70   -Proximity_Sensor_001.configure_mw('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
71   -Motion_Controller_001.configure_mw('yarp', 'read_json_waypoint', 'morse/middleware/yarp/json_mod')
  63 +GPS.add_stream('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
  64 +Motion_Controller.add_stream('yarp', 'read_json_waypoint', 'morse/middleware/yarp/json_mod')
  65 +Rosace_Sensor.add_stream('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
  66 +Proximity_Sensor.add_stream('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
  67 +
  68 +Rosace_Sensor_001.add_stream('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
  69 +GPS_001.add_stream('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
  70 +Proximity_Sensor_001.add_stream('yarp', 'post_json_message', 'morse/middleware/yarp/json_mod')
  71 +Motion_Controller_001.add_stream('yarp', 'read_json_waypoint', 'morse/middleware/yarp/json_mod')
72 72
73 73 Motion_Controller.configure_service('yarp_json')
74 74 Rosace_Sensor_001.configure_service('yarp_json')
16 examples/scenarii/test-1.py
@@ -37,16 +37,16 @@
37 37 cam.properties(cam_width = 128, cam_height = 128)
38 38
39 39 # Configure the middlewares
40   -motion.configure_mw('yarp')
41   -odometry.configure_mw('yarp')
42   -proximity.configure_mw('yarp')
43   -pose.configure_mw('yarp')
44   -sick.configure_mw('yarp')
45   -cam.configure_mw('yarp')
  40 +motion.add_stream('yarp')
  41 +odometry.add_stream('yarp')
  42 +proximity.add_stream('yarp')
  43 +pose.add_stream('yarp')
  44 +sick.add_stream('yarp')
  45 +cam.add_stream('yarp')
46 46
47 47 # Configure the middlewares
48   -motion.configure_mw('socket')
49   -pose.configure_mw('socket')
  48 +motion.add_stream('socket')
  49 +pose.add_stream('socket')
50 50
51 51 env = Environment('laas/grande_salle')
52 52 env.aim_camera([1.0470, 0, 0.7854])
6 examples/tutorials/cat_mouse_game.py
@@ -18,9 +18,9 @@
18 18 Semantic_R.name = "Camera_R"
19 19 Cat.append(Semantic_R)
20 20
21   -V_W.configure_mw('socket')
22   -Semantic_L.configure_mw('socket')
23   -Semantic_R.configure_mw('socket')
  21 +V_W.add_stream('socket')
  22 +Semantic_L.add_stream('socket')
  23 +Semantic_R.add_stream('socket')
24 24
25 25
26 26 Mouse = Robot('atrv')
8 examples/tutorials/multinode/dala_simple.py
@@ -27,9 +27,9 @@ def equipped_robot(mw='yarp'):
27 27 cam.properties(cam_width = 128, cam_height = 128)
28 28
29 29 # Configure the middlewares
30   - motion.configure_mw(mw)
31   - pose.configure_mw(mw)
32   - sick.configure_mw(mw)
33   - cam.configure_mw(mw)
  30 + motion.add_stream(mw)
  31 + pose.add_stream(mw)
  32 + sick.add_stream(mw)
  33 + cam.add_stream(mw)
34 34
35 35 return (atrv)
8 examples/tutorials/ros_navigation/scenario.py
@@ -8,15 +8,15 @@
8 8 # Sensors and Actuators for navigation stack
9 9 pr2_posture = Sensor('pr2_posture')
10 10 james.append(pr2_posture)
11   -pr2_posture.configure_mw('ros')
  11 +pr2_posture.add_stream('ros')
12 12
13 13 motion_controller = Actuator('xy_omega')
14 14 james.append(motion_controller)
15   -motion_controller.configure_mw('ros')
  15 +motion_controller.add_stream('ros')
16 16
17 17 odometry = Sensor('odometry')
18 18 james.append(odometry)
19   -odometry.configure_mw('ros')
  19 +odometry.add_stream('ros')
20 20
21 21 Sick = Sensor('sick')
22 22 Sick.translate(x=0.275, z=0.252)
@@ -25,7 +25,7 @@
25 25 Sick.properties(laser_range=30.0000)
26 26 Sick.properties(resolution=1.0000)
27 27 Sick.properties(scan_window=180.0000)
28   -Sick.configure_mw('ros')
  28 +Sick.add_stream('ros')
29 29
30 30 # Keyboard control
31 31 keyboard = Actuator('keyboard')
6 examples/tutorials/tutorial-2-yarp.py
@@ -16,9 +16,9 @@
16 16
17 17
18 18 # Scene configuration
19   -Motion_Controller.configure_mw('yarp')
20   -Pose.configure_mw('yarp')
21   -Camera.configure_mw('yarp')
  19 +Motion_Controller.add_stream('yarp')
  20 +Pose.add_stream('yarp')
  21 +Camera.add_stream('yarp')
22 22
23 23 env = Environment('indoors-1/indoor-1')
24 24 env.aim_camera([1.0470, 0, 0.7854])
2  src/morse/builder/robots/human.py
@@ -23,7 +23,7 @@ class Human(Robot):
23 23 human.translate(x=5.5, y=-3.2, z=0.0)
24 24 human.rotate(z=-3.0)
25 25
26   - human.armature.configure_mw('pocolibs',
  26 + human.armature.add_stream('pocolibs',
27 27 ['Pocolibs',
28 28 'export_posture',
29 29 'morse/middleware/pocolibs/sensors/human_posture',
2  testing/base/armature_pose_testing.py
@@ -30,7 +30,7 @@ def setUpEnv(self):
30 30
31 31 kuka_posture = ArmaturePose('arm_pose')
32 32 kuka_lwr.append(kuka_posture)
33   - kuka_posture.configure_mw('socket')
  33 + kuka_posture.add_stream('socket')
34 34 kuka_posture.configure_service('socket')
35 35
36 36 env = Environment('empty', fastmode = True)
6 testing/base/armature_testing.py
@@ -27,17 +27,17 @@ def setUpEnv(self):
27 27 arm = KukaLWR()
28 28 robot.append(arm)
29 29 arm.translate(z=0.9)
30   - arm.configure_mw('socket')
  30 + arm.add_stream('socket')
31 31 arm.configure_service('socket')
32 32
33 33 pose = Pose()
34   - pose.configure_mw('socket')
  34 + pose.add_stream('socket')
35 35 pose.translate(z=1.3)
36 36 arm.append(pose)
37 37
38 38 arm_pose = ArmaturePose()
39 39 arm.append(arm_pose)
40   - arm_pose.configure_mw('socket')
  40 + arm_pose.add_stream('socket')
41 41
42 42 motion = Teleport()
43 43 robot.append(motion)
2  testing/base/battery_testing.py
@@ -24,7 +24,7 @@ def setUpEnv(self):
24 24 robot = ATRV()
25 25
26 26 battery = Battery()
27   - battery.configure_mw('socket')
  27 + battery.add_stream('socket')
28 28 battery.properties(DischargingRate = 10.0)
29 29 robot.append(battery)
30 30
4 testing/base/destination_testing.py
@@ -29,12 +29,12 @@ def setUpEnv(self):
29 29 robot.translate(0.0, 0.0, 20.0)
30 30
31 31 pose = Pose()
32   - pose.configure_mw('socket')
  32 + pose.add_stream('socket')
33 33 robot.append(pose)
34 34
35 35 destination = Destination('destination')
36 36 robot.append(destination)
37   - destination.configure_mw('socket')
  37 + destination.add_stream('socket')
38 38 destination.properties(Speed=2.0, Tolerance=0.3)
39 39
40 40 env = Environment('empty', fastmode = True)
2  testing/base/gps_testing.py
@@ -24,7 +24,7 @@ def setUpEnv(self):
24 24 robot.translate(10.0, 8.0, 0.0)
25 25
26 26 gps = GPS()
27   - gps.configure_mw('socket')
  27 + gps.add_stream('socket')
28 28 robot.append(gps)
29 29
30 30 env = Environment('empty', fastmode = True)
4 testing/base/gripper_testing.py
@@ -30,7 +30,7 @@ def setUpEnv(self):
30 30 arm = KukaLWR()
31 31 robot.append(arm)
32 32 arm.translate(x=0.5, z=0.9)
33   - arm.configure_mw('socket')
  33 + arm.add_stream('socket')
34 34 arm.configure_service('socket')
35 35
36 36 gripper = Gripper('gripper')
@@ -40,7 +40,7 @@ def setUpEnv(self):
40 40
41 41 teleport = Teleport()
42 42 robot.append(teleport)
43   - teleport.configure_mw('socket')
  43 + teleport.add_stream('socket')
44 44
45 45 tape1 = PassiveObject(prefix='BlackVideotape')
46 46 tape1.properties(Object = True, Graspable = True, Label = "BlackTape")
2  testing/base/gyroscope_testing.py
@@ -25,7 +25,7 @@ def setUpEnv(self):
25 25 robot.rotate(math.pi/16, math.pi/8, math.pi/2)
26 26
27 27 gyro = Gyroscope()
28   - gyro.configure_mw('socket')
  28 + gyro.add_stream('socket')
29 29 robot.append(gyro)
30 30
31 31 env = Environment('empty', fastmode = True)
4 testing/base/light_testing.py
@@ -27,13 +27,13 @@ def setUpEnv(self):
27 27 cam_focal = 25.0000, Vertical_Flip = True)
28 28 cam.translate(x=0.2, z=0.9)
29 29 atrv.append(cam)
30   - cam.configure_mw('socket')
  30 + cam.add_stream('socket')
31 31
32 32 light = Light('light')
33 33 light.translate(x=0.2, z=1.1)
34 34 light.properties(Distance = 50.0)
35 35 atrv.append(light)
36   - light.configure_mw('socket')
  36 + light.add_stream('socket')
37 37
38 38 block = PassiveObject('environments/indoors-1/boxes', 'GreenBox')
39 39 block.translate(x=2, y=0, z=1)
4 testing/base/ned_testing.py
@@ -26,12 +26,12 @@ def setUpEnv(self):
26 26
27 27 pose = Pose()
28 28 robot.append(pose)
29   - pose.configure_mw('socket')
  29 + pose.add_stream('socket')
30 30
31 31 pose2 = Pose()
32 32 pose2.configure_modifier('NED')
33 33 robot.append(pose2)
34   - pose2.configure_mw('socket')
  34 + pose2.add_stream('socket')
35 35
36 36
37 37 env = Environment('empty', fastmode = True)
6 testing/base/odometry_testing.py
@@ -27,15 +27,15 @@ def setUpEnv(self):
27 27
28 28 pose = Pose()
29 29 robot.append(pose)
30   - pose.configure_mw('socket')
  30 + pose.add_stream('socket')
31 31
32 32 motion = MotionVW('motion')
33 33 robot.append(motion)
34   - motion.configure_mw('socket')
  34 + motion.add_stream('socket')
35 35
36 36 odo = Odometry()
37 37 robot.append(odo)
38   - odo.configure_mw('socket')
  38 + odo.add_stream('socket')
39 39
40 40 env = Environment('empty', fastmode = True)
41 41 env.configure_service('socket')
6 testing/base/orientation_testing.py
@@ -28,15 +28,15 @@ def setUpEnv(self):
28 28 robot.translate(10.0, 8.0, 20.0)
29 29
30 30 gyro = Gyroscope()
31   - gyro.configure_mw('socket')
  31 + gyro.add_stream('socket')
32 32 robot.append(gyro)
33 33
34 34 orientation = Orientation('orientation')
35   - orientation.configure_mw('socket')
  35 + orientation.add_stream('socket')
36 36 robot.append(orientation)
37 37
38 38 pose = Pose()
39   - pose.configure_mw('socket')
  39 + pose.add_stream('socket')
40 40 robot.append(pose)
41 41
42 42 env = Environment('empty', fastmode = True)
2  testing/base/pose_testing.py
@@ -24,7 +24,7 @@ def setUpEnv(self):
24 24 robot = ATRV()
25 25
26 26 pose = Pose()
27   - pose.configure_mw('socket')
  27 + pose.add_stream('socket')
28 28 pose.translate(z=-0.10) # atrv sensor is at 10cm on the groud
29 29 robot.append(pose)
30 30
6 testing/base/proximity_testing.py
@@ -30,16 +30,16 @@ def setUpEnv(self):
30 30 proximity.properties(Track = "Catch_me")
31 31 proximity.properties(Range = 2.0)
32 32 robot.append(proximity)
33   - proximity.configure_mw('socket')
  33 + proximity.add_stream('socket')
34 34 proximity.configure_service('socket')
35 35
36 36 pose = Pose()
37 37 robot.append(pose)
38   - pose.configure_mw('socket')
  38 + pose.add_stream('socket')
39 39
40 40 motion = Teleport()
41 41 robot.append(motion)
42   - motion.configure_mw('socket')
  42 + motion.add_stream('socket')
43 43
44 44 target1 = ATRV("Target1")
45 45 target1.properties(Catch_me = True)
6 testing/base/ptu_testing.py
@@ -30,18 +30,18 @@ def setUpEnv(self):
30 30 robot = ATRV()
31 31
32 32 ptu = PTU()
33   - ptu.configure_mw('socket')
  33 + ptu.add_stream('socket')
34 34 ptu.translate(x=ptu_x, z=ptu_z)
35 35 ptu.configure_service('socket')
36 36 ptu.properties(Speed = 0.5)
37 37 robot.append(ptu)
38 38
39 39 posture = PTUPosture()
40   - posture.configure_mw('socket')
  40 + posture.add_stream('socket')
41 41 ptu.append(posture)
42 42
43 43 gyro = Gyroscope()
44   - gyro.configure_mw('socket')
  44 + gyro.add_stream('socket')
45 45 ptu.append(gyro)
46 46
47 47 chair = PassiveObject(prefix='RollingChair')
4 testing/base/rotorcraft_waypoint_testing.py
@@ -24,11 +24,11 @@ def setUpEnv(self):
24 24
25 25 pose = Pose()
26 26 robot.append(pose)
27   - pose.configure_mw('socket')
  27 + pose.add_stream('socket')
28 28
29 29 motion = RotorcraftWaypoint('motion')
30 30 robot.append(motion)
31   - motion.configure_mw('socket')
  31 + motion.add_stream('socket')
32 32 motion.configure_service('socket')
33 33
34 34 env = Environment('empty', fastmode = True)
4 testing/base/semantic_camera_testing.py
@@ -29,11 +29,11 @@ def setUpEnv(self):
29 29 camera = SemanticCamera()
30 30 robot.append(camera)
31 31 camera.translate(x=0.3, z=0.762)
32   - camera.configure_mw('socket')
  32 + camera.add_stream('socket')
33 33
34 34 motion = Teleport()
35 35 robot.append(motion)
36   - motion.configure_mw('socket')
  36 + motion.add_stream('socket')
37 37
38 38 env = Environment('indoors-1/boxes')
39 39 env.configure_service('socket')
2  testing/base/sick_testing.py
@@ -29,7 +29,7 @@ def setUpEnv(self):
29 29 sick.properties(laser_range = 10.0, Visible_arc = False)
30 30 sick.create_laser_arc()
31 31 robot.append(sick)
32   - sick.configure_mw('socket')
  32 + sick.add_stream('socket')
33 33
34 34 env = Environment('indoors-1/boxes', fastmode = True)
35 35 env.configure_service('socket')
4 testing/base/stabilized_quadrirotor_testing.py
@@ -27,12 +27,12 @@ def setUpEnv(self):
27 27 robot = QUAD2012('robot')
28 28
29 29 pose = Pose()
30   - pose.configure_mw('socket')
  30 + pose.add_stream('socket')
31 31 robot.append(pose)
32 32
33 33 motion = StabilizedQuadrotor('motion')
34 34 robot.append(motion)
35   - motion.configure_mw('socket')
  35 + motion.add_stream('socket')
36 36
37 37 env = Environment('empty', fastmode = True)
38 38 env.configure_service('socket')
4 testing/base/steer_force_testing.py
@@ -28,12 +28,12 @@ def setUpEnv(self):
28 28 robot = Hummer('robot')
29 29
30 30 pose = Pose()
31   - pose.configure_mw('socket')
  31 + pose.add_stream('socket')
32 32 robot.append(pose)
33 33
34 34 steer_force = SteerForce()
35 35 robot.append(steer_force)
36   - steer_force.configure_mw('socket')
  36 + steer_force.add_stream('socket')
37 37
38 38 env = Environment('land-1/rosace_1', fastmode = True)
39 39 env.configure_service('socket')
4 testing/base/teleport_testing.py
@@ -31,11 +31,11 @@ def setUpEnv(self):
31 31 robot.translate(10.0, 8.0, 20.0)
32 32
33 33 pose = Pose()
34   - pose.configure_mw('socket')
  34 + pose.add_stream('socket')
35 35 robot.append(pose)
36 36
37 37 teleport = Teleport('teleport')
38   - teleport.configure_mw('socket')
  38 + teleport.add_stream('socket')
39 39 robot.append(teleport)
40 40
41 41
4 testing/base/thermometer_testing.py
@@ -24,11 +24,11 @@ def setUpEnv(self):
24 24
25 25 thermometer = Thermometer()
26 26 robot.append(thermometer)
27   - thermometer.configure_mw('socket')
  27 + thermometer.add_stream('socket')
28 28
29 29 motion = Teleport()
30 30 robot.append(motion)
31   - motion.configure_mw('socket')
  31 + motion.add_stream('socket')
32 32
33 33 env = Environment('land-1/rosace_1', fastmode = True)
34 34 env.properties(Temperature='25.0')
4 testing/base/utm_mod_testing.py
@@ -24,11 +24,11 @@ def setUpEnv(self):
24 24 robot.translate(10.0, 8.0, 0.0)
25 25
26 26 gps = GPS()
27   - gps.configure_mw('socket')
  27 + gps.add_stream('socket')
28 28 robot.append(gps)
29 29
30 30 gps_mod = GPS()
31   - gps_mod.configure_mw('socket')
  31 + gps_mod.add_stream('socket')
32 32 gps_mod.configure_modifier('UTM')
33 33 robot.append(gps_mod)
34 34
4 testing/base/victim_testing.py
@@ -26,7 +26,7 @@ def setUpEnv(self):
26 26
27 27 victim_detector = Rosace()
28 28 robot.append(victim_detector)
29   - victim_detector.configure_mw('socket')
  29 + victim_detector.add_stream('socket')
30 30 victim_detector.configure_service('socket')
31 31 victim_detector.properties( Heal_range=1.0, Abilities="1,2,3,4,5")
32 32
@@ -35,7 +35,7 @@ def setUpEnv(self):
35 35
36 36 motion = Teleport()
37 37 robot.append(motion)
38   - motion.configure_mw('socket')
  38 + motion.add_stream('socket')
39 39
40 40 env = Environment('empty', fastmode = True)
41 41 env.properties(Temperature='25.0')
6 testing/base/video_camera_diffimg_testing.py
@@ -149,14 +149,14 @@ def setUpEnv(self):
149 149 camera.properties(Vertical_Flip = True)
150 150 camera.translate(x=0.2, z=0.9)
151 151 atrv.append(camera)
152   - camera.configure_mw('socket')
  152 + camera.add_stream('socket')
153 153
154 154 orientation = Orientation('orientation')
155   - orientation.configure_mw('socket')
  155 + orientation.add_stream('socket')
156 156 atrv.append(orientation)
157 157
158 158 gyroscope = Gyroscope('gyroscope')
159   - gyroscope.configure_mw('socket')
  159 + gyroscope.add_stream('socket')
160 160 atrv.append(gyroscope)
161 161
162 162 env = Environment('indoors-1/boxes')
4 testing/base/video_camera_testing.py
@@ -36,10 +36,10 @@ def setUpEnv(self):
36 36 cam.properties(Vertical_Flip = True)
37 37 cam.translate(x=0.2, z=0.9)
38 38 atrv.append(cam)
39   - cam.configure_mw('socket')
  39 + cam.add_stream('socket')
40 40
41 41 orientation = Orientation('orientation')
42   - orientation.configure_mw('socket')
  42 + orientation.add_stream('socket')
43 43 atrv.append(orientation)
44 44
45 45 env = Environment('indoors-1/boxes')
4 testing/base/vw_testing.py
@@ -36,11 +36,11 @@ def setUpEnv(self):
36 36 pose = Pose()
37 37 pose.translate(z=-0.10) # atrv base is 10cm over ground
38 38 robot.append(pose)
39   - pose.configure_mw('socket')
  39 + pose.add_stream('socket')
40 40
41 41 motion = MotionVW()
42 42 robot.append(motion)
43   - motion.configure_mw('socket')
  43 + motion.add_stream('socket')
44 44 motion.configure_service('socket')
45 45
46 46 env = Environment('empty', fastmode = True)
4 testing/base/waypoint_testing.py
@@ -28,11 +28,11 @@ def setUpEnv(self):
28 28 pose = Pose('pose')
29 29 pose.translate(z=-0.10) # atrv body
30 30 robot.append(pose)
31   - pose.configure_mw('socket')
  31 + pose.add_stream('socket')
32 32
33 33 motion = Waypoint('motion')
34 34 robot.append(motion)
35   - motion.configure_mw('socket')
  35 + motion.add_stream('socket')
36 36 motion.configure_service('socket')
37 37
38 38
4 testing/base/xyw_testing.py
@@ -31,11 +31,11 @@ def setUpEnv(self):
31 31 pose = Pose()
32 32 pose.translate(z=-0.10) # atrv base is 10cm over ground
33 33 robot.append(pose)
34   - pose.configure_mw('socket')
  34 + pose.add_stream('socket')
35 35
36 36 motion = MotionXYW('motion')
37 37 robot.append(motion)
38   - motion.configure_mw('socket')
  38 + motion.add_stream('socket')
39 39 motion.configure_service('socket')
40 40
41 41 env = Environment('empty', fastmode = True)
4 testing/middlewares/ros/data_stream.py
@@ -43,11 +43,11 @@ def setUpEnv(self):
43 43
44 44 pose = Pose()
45 45 robot.append(pose)
46   - pose.configure_mw('ros')
  46 + pose.add_stream('ros')
47 47
48 48 motion = MotionVW()
49 49 robot.append(motion)
50   - motion.configure_mw('ros')
  50 + motion.add_stream('ros')
51 51
52 52 env = Environment('empty', fastmode = True)
53 53 env.configure_service('socket')
6 testing/middlewares/ros/depth_camera.py
@@ -36,12 +36,12 @@ def setUpEnv(self):
36 36
37 37 motion = MotionVW('MotionVW')
38 38 robot.append(motion)
39   - motion.configure_mw('ros')
  39 + motion.add_stream('ros')
40 40
41 41 odometry = Odometry('Odometry')
42 42 odometry.translate(z=0.73)
43 43 robot.append(odometry)
44   - odometry.configure_mw('ros')
  44 + odometry.add_stream('ros')
45 45
46 46 camera = DepthCamera('DepthCamera')
47 47 camera.properties(cam_near=1.0, cam_far=20.0, Depth=True,\
@@ -49,7 +49,7 @@ def setUpEnv(self):
49 49 camera.translate(x=0.3, z=0.76)
50 50 camera.frequency(3)
51 51 robot.append(camera)
52   - camera.configure_mw('ros')
  52 + camera.add_stream('ros')
53 53
54 54 env = Environment('indoors-1/boxes')
55 55 # No fastmode here, no MaterialIndex in WIREFRAME mode: AttributeError:
6 testing/middlewares/ros/sick.py
@@ -36,19 +36,19 @@ def setUpEnv(self):
36 36
37 37 motion = MotionVW('MotionVW')
38 38 robot.append(motion)
39   - motion.configure_mw('ros')
  39 + motion.add_stream('ros')
40 40
41 41 odometry = Odometry('Odometry')
42 42 odometry.translate(z=0.73)
43 43 robot.append(odometry)
44   - odometry.configure_mw('ros')
  44 + odometry.add_stream('ros')
45 45
46 46 sick = Sick('Sick')
47 47 sick.translate(x = 0.18, z = 0.94)
48 48 robot.append(sick)
49 49 # sick.properties(scan_window = 270, resolution = .25)
50 50 sick.properties(scan_window = 180, resolution = 1)
51   - sick.configure_mw('ros')
  51 + sick.add_stream('ros')
52 52 # test does not call sick.__del__() so create laser arc manually
53 53 sick.create_laser_arc()
54 54
6 testing/middlewares/ros/video_camera.py
@@ -36,19 +36,19 @@ def setUpEnv(self):
36 36
37 37 motion = MotionVW('MotionVW')
38 38 robot.append(motion)
39   - motion.configure_mw('ros')
  39 + motion.add_stream('ros')
40 40
41 41 odometry = Odometry('Odometry')
42 42 odometry.translate(z=0.73)
43 43 robot.append(odometry)
44   - odometry.configure_mw('ros')
  44 + odometry.add_stream('ros')
45 45
46 46 camera = VideoCamera('Camera')
47 47 camera.properties(cam_width=128, cam_height=128, capturing=True, Vertical_Flip=True)
48 48 camera.translate(x=0.3, z=0.76)
49 49 camera.frequency(3)
50 50 robot.append(camera)