Skip to content

Commit f7b898c

Browse files
committed
Update test and docs to the empty action definition
1 parent c154ea5 commit f7b898c

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

ur_controllers/doc/index.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,24 +394,26 @@ The direction of tool contact will always be the current TCP direction of moveme
394394
Parameters
395395
""""""""""
396396

397-
+----------------------+--------+---------------+---------------------------------------------------------------------------------------+
398-
| Parameter name | Type | Default value | Description |
399-
| | | | |
400-
+----------------------+--------+---------------+---------------------------------------------------------------------------------------+
401-
| ``tf_prefix`` | string | <empty> | Urdf prefix of the corresponding arm |
402-
+----------------------+--------+---------------+---------------------------------------------------------------------------------------+
397+
+-------------------------+--------+---------------+---------------------------------------------------------------------------------------+
398+
| Parameter name | Type | Default value | Description |
399+
| | | | |
400+
+-------------------------+--------+---------------+---------------------------------------------------------------------------------------+
401+
| ``tf_prefix`` | string | <empty> | Urdf prefix of the corresponding arm |
402+
+-------------------------+--------+---------------+---------------------------------------------------------------------------------------+
403+
| ``action_monitor_rate`` | double | 20.0 | The rate at which the action should be monitored in Hz. |
404+
+-------------------------+--------+---------------+---------------------------------------------------------------------------------------+
403405

404406
Action interface / usage
405407
""""""""""""""""""""""""
406408
The controller provides one action for enabling tool contact. For the controller to accept action goals it needs to be in ``active`` state.
407409

408-
* ``~/enable_tool_contact [ur_msgs/action/ToolContact]``
410+
* ``~/detect_tool_contact [ur_msgs/action/ToolContact]``
409411

410-
The goal section of ``ur_msgs/action/ToolContact`` has no fields, as a call to the action implicitly means that tool contact should be enabled.
411-
The result section has one field ``result``, which contains the result from the tool contact in the form of an integer.
412+
The action definition of ``ur_msgs/action/ToolContact`` has no fields, as a call to the action implicitly means that tool contact should be enabled.
413+
The result of the action is available through the status of the action itself. If the action succeeds it means that tool contact was detected, otherwise tool contact will remain active until it is either cancelled by the user, or aborted by the hardware.
412414
The action provides no feedback.
413415

414416
The action can be called from the command line using the following command, when the controller is active:
415417
.. code-block::
416418
417-
ros2 action send_goal /tool_contact_controller/enable_tool_contact ur_msgs/action/ToolContact
419+
ros2 action send_goal /tool_contact_controller/detect_tool_contact ur_msgs/action/ToolContact

ur_robot_driver/test/integration_test_tool_contact.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
from controller_manager_msgs.srv import SwitchController
4242
from ur_msgs.action import ToolContact
43+
from action_msgs.msg import GoalStatus
4344

4445
sys.path.append(os.path.dirname(__file__))
4546
from test_common import ( # noqa: E402
@@ -130,9 +131,10 @@ def test_deactivate_controller_aborts_action(self):
130131
deactivate_controllers=["tool_contact_controller"],
131132
).ok
132133
)
133-
134-
result = self._tool_contact_interface.get_result(goal_handle, 5)
135-
self.assertEqual(result.result, ToolContact.Result.ABORTED)
134+
# Wait for action to finish
135+
self._tool_contact_interface.get_result(goal_handle, 5)
136+
# Check status of goal handle, as result does not contain information about the status of the action. Only the empty result definition.
137+
self.assertEqual(goal_handle._status, GoalStatus.STATUS_ABORTED)
136138

137139
def test_inactive_controller_rejects_actions(self):
138140
self.assertTrue(

0 commit comments

Comments
 (0)