Skip to content

Commit 333d0bc

Browse files
author
Felix Exner (fexner)
authored
Use mock_hardware and mock_sensor_commands instead of fake (#739)
* Use mock_hardware and mock_sensor_commands instead of fake This has been deprecated a while back and was never adapted. * Update documentation to mock_hardware
1 parent d2599ec commit 333d0bc

File tree

12 files changed

+100
-100
lines changed

12 files changed

+100
-100
lines changed

ur_calibration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ Then, anybody cloning this repository can startup the robot simply by launching
7474
$ cd <colcon_ws>
7575
$ colcon build --packages-select <organization_name>_ur_launch
7676
$ ros2 launch <organization_name>_ur_launch ex-ur10-1.launch.py
77-
robot_ip:=xxx.yyy.zzz.www ur_type:=ur5e use_fake_hardware:=false launch_rviz:=true
77+
robot_ip:=xxx.yyy.zzz.www ur_type:=ur5e use_mock_hardware:=false launch_rviz:=true
7878
```

ur_moveit_config/launch/ur_moveit.launch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
def launch_setup(context, *args, **kwargs):
4545
# Initialize Arguments
4646
ur_type = LaunchConfiguration("ur_type")
47-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
47+
use_mock_hardware = LaunchConfiguration("use_mock_hardware")
4848
safety_limits = LaunchConfiguration("safety_limits")
4949
safety_pos_margin = LaunchConfiguration("safety_pos_margin")
5050
safety_k_position = LaunchConfiguration("safety_k_position")
@@ -166,8 +166,8 @@ def launch_setup(context, *args, **kwargs):
166166

167167
# Trajectory Execution Configuration
168168
controllers_yaml = load_yaml("ur_moveit_config", "config/controllers.yaml")
169-
# the scaled_joint_trajectory_controller does not work on fake hardware
170-
change_controllers = context.perform_substitution(use_fake_hardware)
169+
# the scaled_joint_trajectory_controller does not work on mock hardware
170+
change_controllers = context.perform_substitution(use_mock_hardware)
171171
if change_controllers == "true":
172172
controllers_yaml["scaled_joint_trajectory_controller"]["default"] = False
173173
controllers_yaml["joint_trajectory_controller"]["default"] = True
@@ -268,9 +268,9 @@ def generate_launch_description():
268268
)
269269
declared_arguments.append(
270270
DeclareLaunchArgument(
271-
"use_fake_hardware",
271+
"use_mock_hardware",
272272
default_value="false",
273-
description="Indicate whether robot is running with fake hardware mirroring command to its states.",
273+
description="Indicate whether robot is running with mock hardware mirroring command to its states.",
274274
)
275275
)
276276
declared_arguments.append(

ur_robot_driver/doc/setup_tool_communication.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ launch files:
3838

3939
.. code-block:: bash
4040
41-
$ ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_tool_communication:=true use_fake_hardware:=false launch_rviz:=false
41+
$ ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_tool_communication:=true use_mock_hardware:=false launch_rviz:=false
4242
# remember that your user needs to have the rights to write that file handle to /tmp/ttyUR
4343
4444
Following parameters can be set `ur.ros2_control.xacro <https://github.com/UniversalRobots/Universal_Robots_ROS2_Description/blob/ros2/urdf/ur.ros2_control.xacro>`_\ :

ur_robot_driver/doc/usage.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ The most relevant arguments are the following:
2222

2323
* ``ur_type`` (\ *mandatory* ) - a type of used UR robot (\ *ur3*\ , *ur3e*\ , *ur5*\ , *ur5e*\ , *ur10*\ , *ur10e*\ , or *ur16e*\ ).
2424
* ``robot_ip`` (\ *mandatory* ) - IP address by which the root can be reached.
25-
* ``use_fake_hardware`` (default: *false* ) - use simple hardware emulator from ros2_control.
25+
* ``use_mock_hardware`` (default: *false* ) - use simple hardware emulator from ros2_control.
2626
Useful for testing launch files, descriptions, etc. See explanation below.
27-
* ``initial_positions`` (default: dictionary with all joint values set to 0) - Allows passing a dictionary to set the initial joint values for the fake hardware from `ros2_control <http://control.ros.org/>`_. It can also be set from a yaml file with the ``load_yaml`` commands as follows:
27+
* ``initial_positions`` (default: dictionary with all joint values set to 0) - Allows passing a dictionary to set the initial joint values for the mock hardware from `ros2_control <http://control.ros.org/>`_. It can also be set from a yaml file with the ``load_yaml`` commands as follows:
2828

2929
.. code-block::
3030
@@ -41,7 +41,7 @@ The most relevant arguments are the following:
4141
wrist_2_joint: -1.765
4242
wrist_3_joint: 0.0
4343
44-
* ``fake_sensor_commands`` (default: *false* ) - enables setting sensor values for the hardware emulators.
44+
* ``mock_sensor_commands`` (default: *false* ) - enables setting sensor values for the hardware emulators.
4545
Useful for offline testing of controllers.
4646

4747
* ``robot_controller`` (default: *joint_trajectory_controller* ) - controller for robot joints to be started.
@@ -55,12 +55,12 @@ The most relevant arguments are the following:
5555

5656
*HINT* : list all loaded controllers using ``ros2 control list_controllers`` command.
5757

58-
**NOTE**\ : The package can simulate hardware with the ros2_control ``FakeSystem``. This emulator enables an environment for testing of "piping" of hardware and controllers, as well as testing robot's descriptions. For more details see `ros2_control documentation <https://ros-controls.github.io/control.ros.org/>`_ for more details.
58+
**NOTE**\ : The package can simulate hardware with the ros2_control ``MockSystem``. This emulator enables an environment for testing of "piping" of hardware and controllers, as well as testing robot's descriptions. For more details see `ros2_control documentation <https://ros-controls.github.io/control.ros.org/>`_ for more details.
5959

6060
Modes of operation
6161
------------------
6262

63-
As mentioned in the last section the driver has two basic modes of operation: Using fake hardware or
63+
As mentioned in the last section the driver has two basic modes of operation: Using mock hardware or
6464
using real hardware(Or the URSim simulator, which is equivalent from the driver's perspective).
6565
Additionally, the robot can be simulated using
6666
`Gazebo <https://github.com/UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation>`_ or
@@ -72,7 +72,7 @@ outside of this driver's scope.
7272

7373
* - mode
7474
- available controllers
75-
* - fake_hardware
75+
* - mock_hardware
7676
- :raw-html-m2r:`<ul><li>joint_trajectory_controller</li><li>forward_velocity_controller</li><li>forward_position_controller</li></ul>`
7777
* - real hardware / URSim
7878
- :raw-html-m2r:`<ul><li>joint_trajectory_controller</li><li>scaled_joint_trajectory_controller </li><li>forward_velocity_controller</li><li>forward_position_controller</li></ul>`
@@ -124,11 +124,11 @@ Allowed UR - Type strings: ``ur3``\ , ``ur3e``\ , ``ur5``\ , ``ur5e``\ , ``ur10`
124124

125125
* To do an offline test with URSim check details about it in `this section <#usage-with-official-ur-simulator>`_
126126

127-
* To use mocked hardware(capability of ros2_control), use ``use_fake_hardware`` argument, like:
127+
* To use mocked hardware(capability of ros2_control), use ``use_mock_hardware`` argument, like:
128128

129129
.. code-block::
130130
131-
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_fake_hardware:=true launch_rviz:=true
131+
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_mock_hardware:=true launch_rviz:=true
132132
133133
**NOTE**\ : Instead of using the global launch file for control stack, there are also prepeared launch files for each type of UR robots named. They accept the same arguments are the global one and are used by:
134134

@@ -150,11 +150,11 @@ Before running any commands, first check the controllers' state using ``ros2 con
150150
151151
After a few seconds the robot should move.
152152

153-
* To test another controller, simply define it using ``initial_joint_controller`` argument, for example when using fake hardware:
153+
* To test another controller, simply define it using ``initial_joint_controller`` argument, for example when using mock hardware:
154154

155155
.. code-block::
156156
157-
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy initial_joint_controller:=joint_trajectory_controller use_fake_hardware:=true launch_rviz:=true
157+
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy initial_joint_controller:=joint_trajectory_controller use_mock_hardware:=true launch_rviz:=true
158158
159159
And send the command using demo node:
160160

@@ -191,17 +191,17 @@ To test the driver with the example MoveIt-setup, first start the driver as desc
191191
Now you should be able to use the MoveIt Plugin in rviz2 to plan and execute trajectories with the
192192
robot as explained `here <https://moveit.picknik.ai/galactic/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html>`_.
193193

194-
Fake hardware
194+
Mock hardware
195195
^^^^^^^^^^^^^
196196

197-
Currently, the ``scaled_joint_trajectory_controller`` does not work with ros2_control fake_hardware. There is an
198-
`upstream Merge-Request <https://github.com/ros-controls/ros2_control/pull/822>`_ pending to fix that. Until this is merged and released, you'll have to fallback to the ``joint_trajectory_controller`` by passing ``initial_controller:=joint_trajectory_controller`` to the driver's startup. Also, you'll have to tell MoveIt! that you're using fake_hardware as it then has to map to the other controller:
197+
Currently, the ``scaled_joint_trajectory_controller`` does not work with ros2_control mock_hardware. There is an
198+
`upstream Merge-Request <https://github.com/ros-controls/ros2_control/pull/822>`_ pending to fix that. Until this is merged and released, you'll have to fallback to the ``joint_trajectory_controller`` by passing ``initial_controller:=joint_trajectory_controller`` to the driver's startup. Also, you'll have to tell MoveIt! that you're using mock_hardware as it then has to map to the other controller:
199199

200200
.. code-block::
201201
202-
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_fake_hardware:=true launch_rviz:=false initial_joint_controller:=joint_trajectory_controller
202+
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_mock_hardware:=true launch_rviz:=false initial_joint_controller:=joint_trajectory_controller
203203
# and in another shell
204-
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e launch_rviz:=true use_fake_hardware:=true
204+
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e launch_rviz:=true use_mock_hardware:=true
205205
206206
Robot frames
207207
------------

ur_robot_driver/launch/ur10.launch.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ def generate_launch_description():
4646
)
4747
declared_arguments.append(
4848
DeclareLaunchArgument(
49-
"use_fake_hardware",
49+
"use_mock_hardware",
5050
default_value="false",
51-
description="Start robot with fake hardware mirroring command to its states.",
51+
description="Start robot with mock hardware mirroring command to its states.",
5252
)
5353
)
5454
declared_arguments.append(
5555
DeclareLaunchArgument(
56-
"fake_sensor_commands",
56+
"mock_sensor_commands",
5757
default_value="false",
58-
description="Enable fake command interfaces for sensors used for simple simulations. \
59-
Used only if 'use_fake_hardware' parameter is true.",
58+
description="Enable mock command interfaces for sensors used for simple simulations. \
59+
Used only if 'use_mock_hardware' parameter is true.",
6060
)
6161
)
6262
declared_arguments.append(
@@ -82,8 +82,8 @@ def generate_launch_description():
8282

8383
# Initialize Arguments
8484
robot_ip = LaunchConfiguration("robot_ip")
85-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
86-
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
85+
use_mock_hardware = LaunchConfiguration("use_mock_hardware")
86+
mock_sensor_commands = LaunchConfiguration("mock_sensor_commands")
8787
initial_joint_controller = LaunchConfiguration("initial_joint_controller")
8888
activate_joint_controller = LaunchConfiguration("activate_joint_controller")
8989

@@ -92,8 +92,8 @@ def generate_launch_description():
9292
launch_arguments={
9393
"ur_type": "ur10",
9494
"robot_ip": robot_ip,
95-
"use_fake_hardware": use_fake_hardware,
96-
"fake_sensor_commands": fake_sensor_commands,
95+
"use_mock_hardware": use_mock_hardware,
96+
"mock_sensor_commands": mock_sensor_commands,
9797
"initial_joint_controller": initial_joint_controller,
9898
"activate_joint_controller": activate_joint_controller,
9999
}.items(),

ur_robot_driver/launch/ur10e.launch.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ def generate_launch_description():
4646
)
4747
declared_arguments.append(
4848
DeclareLaunchArgument(
49-
"use_fake_hardware",
49+
"use_mock_hardware",
5050
default_value="false",
51-
description="Start robot with fake hardware mirroring command to its states.",
51+
description="Start robot with mock hardware mirroring command to its states.",
5252
)
5353
)
5454
declared_arguments.append(
5555
DeclareLaunchArgument(
56-
"fake_sensor_commands",
56+
"mock_sensor_commands",
5757
default_value="false",
58-
description="Enable fake command interfaces for sensors used for simple simulations. \
59-
Used only if 'use_fake_hardware' parameter is true.",
58+
description="Enable mock command interfaces for sensors used for simple simulations. \
59+
Used only if 'use_mock_hardware' parameter is true.",
6060
)
6161
)
6262
declared_arguments.append(
@@ -82,8 +82,8 @@ def generate_launch_description():
8282

8383
# Initialize Arguments
8484
robot_ip = LaunchConfiguration("robot_ip")
85-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
86-
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
85+
use_mock_hardware = LaunchConfiguration("use_mock_hardware")
86+
mock_sensor_commands = LaunchConfiguration("mock_sensor_commands")
8787
initial_joint_controller = LaunchConfiguration("initial_joint_controller")
8888
activate_joint_controller = LaunchConfiguration("activate_joint_controller")
8989

@@ -92,8 +92,8 @@ def generate_launch_description():
9292
launch_arguments={
9393
"ur_type": "ur10e",
9494
"robot_ip": robot_ip,
95-
"use_fake_hardware": use_fake_hardware,
96-
"fake_sensor_commands": fake_sensor_commands,
95+
"use_mock_hardware": use_mock_hardware,
96+
"mock_sensor_commands": mock_sensor_commands,
9797
"initial_joint_controller": initial_joint_controller,
9898
"activate_joint_controller": activate_joint_controller,
9999
}.items(),

ur_robot_driver/launch/ur16e.launch.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ def generate_launch_description():
4646
)
4747
declared_arguments.append(
4848
DeclareLaunchArgument(
49-
"use_fake_hardware",
49+
"use_mock_hardware",
5050
default_value="false",
51-
description="Start robot with fake hardware mirroring command to its states.",
51+
description="Start robot with mock hardware mirroring command to its states.",
5252
)
5353
)
5454
declared_arguments.append(
5555
DeclareLaunchArgument(
56-
"fake_sensor_commands",
56+
"mock_sensor_commands",
5757
default_value="false",
58-
description="Enable fake command interfaces for sensors used for simple simulations. \
59-
Used only if 'use_fake_hardware' parameter is true.",
58+
description="Enable mock command interfaces for sensors used for simple simulations. \
59+
Used only if 'use_mock_hardware' parameter is true.",
6060
)
6161
)
6262
declared_arguments.append(
@@ -82,8 +82,8 @@ def generate_launch_description():
8282

8383
# Initialize Arguments
8484
robot_ip = LaunchConfiguration("robot_ip")
85-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
86-
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
85+
use_mock_hardware = LaunchConfiguration("use_mock_hardware")
86+
mock_sensor_commands = LaunchConfiguration("mock_sensor_commands")
8787
initial_joint_controller = LaunchConfiguration("initial_joint_controller")
8888
activate_joint_controller = LaunchConfiguration("activate_joint_controller")
8989

@@ -92,8 +92,8 @@ def generate_launch_description():
9292
launch_arguments={
9393
"ur_type": "ur16e",
9494
"robot_ip": robot_ip,
95-
"use_fake_hardware": use_fake_hardware,
96-
"fake_sensor_commands": fake_sensor_commands,
95+
"use_mock_hardware": use_mock_hardware,
96+
"mock_sensor_commands": mock_sensor_commands,
9797
"initial_joint_controller": initial_joint_controller,
9898
"activate_joint_controller": activate_joint_controller,
9999
}.items(),

ur_robot_driver/launch/ur3.launch.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ def generate_launch_description():
4646
)
4747
declared_arguments.append(
4848
DeclareLaunchArgument(
49-
"use_fake_hardware",
49+
"use_mock_hardware",
5050
default_value="false",
51-
description="Start robot with fake hardware mirroring command to its states.",
51+
description="Start robot with mock hardware mirroring command to its states.",
5252
)
5353
)
5454
declared_arguments.append(
5555
DeclareLaunchArgument(
56-
"fake_sensor_commands",
56+
"mock_sensor_commands",
5757
default_value="false",
58-
description="Enable fake command interfaces for sensors used for simple simulations. \
59-
Used only if 'use_fake_hardware' parameter is true.",
58+
description="Enable mock command interfaces for sensors used for simple simulations. \
59+
Used only if 'use_mock_hardware' parameter is true.",
6060
)
6161
)
6262
declared_arguments.append(
@@ -82,8 +82,8 @@ def generate_launch_description():
8282

8383
# Initialize Arguments
8484
robot_ip = LaunchConfiguration("robot_ip")
85-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
86-
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
85+
use_mock_hardware = LaunchConfiguration("use_mock_hardware")
86+
mock_sensor_commands = LaunchConfiguration("mock_sensor_commands")
8787
initial_joint_controller = LaunchConfiguration("initial_joint_controller")
8888
activate_joint_controller = LaunchConfiguration("activate_joint_controller")
8989

@@ -92,8 +92,8 @@ def generate_launch_description():
9292
launch_arguments={
9393
"ur_type": "ur3",
9494
"robot_ip": robot_ip,
95-
"use_fake_hardware": use_fake_hardware,
96-
"fake_sensor_commands": fake_sensor_commands,
95+
"use_mock_hardware": use_mock_hardware,
96+
"mock_sensor_commands": mock_sensor_commands,
9797
"initial_joint_controller": initial_joint_controller,
9898
"activate_joint_controller": activate_joint_controller,
9999
}.items(),

0 commit comments

Comments
 (0)