UniversalRobots / Universal_Robots_ROS2_Description

ROS2 URDF description for Universal Robots
BSD 3-Clause "New" or "Revised" License
100 stars 95 forks source link

Add "calculate_dynamics" mock_components parameter to urdf files #132

Closed tpoignonec closed 2 months ago

tpoignonec commented 5 months ago

Since this recent ros2_control commit, the MockHardware component has a calculate_dynamics functionnality to derive state values from available data. For instance, if only the position command interface is used, the velocity is automatically estimated by numerical derivation. This feature is not yet used by the UR decription file, but only minor changes are required (see PR's modified files). The only real change for the humble branch is in the ros2_control description:

...
<xacro:if value="${use_fake_hardware}">
  <plugin>mock_components/GenericSystem</plugin>
  <param name="fake_sensor_commands">${fake_sensor_commands}</param>
+  <param name="calculate_dynamics">${calculate_dynamics}</param>
  <param name="state_following_offset">0.0</param>
</xacro:if>
...

Note: the PR is targeted at the humble branch, because the file structure has changed in the meantime (ros2_control_mock_hardware.xacro instead of ur.ros2_control.xacro), but the same applies to rolling/iron branches.