|
| 1 | +.. _robot_state_helper: |
| 2 | + |
| 3 | +Robot state helper |
| 4 | +================== |
| 5 | +After switching on the robot, it has to be manually started, the brakes have to be released and a |
| 6 | +program has to be started in order to make the robot ready to use. This is usually done using the |
| 7 | +robot's teach pendant. |
| 8 | + |
| 9 | +Whenever the robot encounters an error, manual intervention is required to resolve the issue. For |
| 10 | +example, if the robot goes into a protective stop, the error has to be acknowledged and the robot |
| 11 | +program has to be unpaused. |
| 12 | + |
| 13 | +When the robot is in :ref:`remote_control_mode <operation_modes>`, most interaction with the robot can be done |
| 14 | +without using the teach pendant, many of that through the :ref:`dashboard client |
| 15 | +<dashboard_client_ros2>`. |
| 16 | + |
| 17 | +The ROS driver provides a helper node that can be used to automate some of these tasks. The |
| 18 | +``robot_state_helper`` node can be used to start the robot, release the brakes, and (re-)start the |
| 19 | +program through an action call. It is started by default and provides a |
| 20 | +`dashboard_msgs/action/SetMode |
| 21 | +<https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/main/ur_dashboard_msgs/action/SetMode.action>`_ action. |
| 22 | + |
| 23 | +For example, to make the robot ready to be used by the ROS driver, call |
| 24 | + |
| 25 | +.. code-block:: console |
| 26 | +
|
| 27 | + $ ros2 action send_goal /ur_robot_state_helper/set_mode ur_dashboard_msgs/action/SetMode "{ target_robot_mode: 7, stop_program: true, play_program: true}" |
| 28 | +
|
| 29 | +The ``target_robot_mode`` can be one of the following: |
| 30 | + |
| 31 | +.. table:: target_robot_mode |
| 32 | + :widths: auto |
| 33 | + |
| 34 | + ===== ===== |
| 35 | + index meaning |
| 36 | + ===== ===== |
| 37 | + 3 POWER_OFF -- Robot is powered off |
| 38 | + 5 IDLE -- Robot is powered on, but brakes are engaged |
| 39 | + 7 RUNNING -- Robot is powered on, brakes are released, ready to run a program |
| 40 | + ===== ===== |
| 41 | + |
| 42 | +.. note:: |
| 43 | + |
| 44 | + When the ROBOT_STATE is in ``RUNNING``, that is equivalent to the robot showing the green dot in |
| 45 | + the lower left corner of the teach pendant (On PolyScope 5). The program state is independent of |
| 46 | + that and shows with the text next to that button. |
| 47 | + |
| 48 | +The ``stop_program`` flag is used to stop the currently running program before changing the robot |
| 49 | +state. In combination with the :ref:`controller_stopper`, this will deactivate any motion |
| 50 | +controller and therefore stop any ROS action being active on those controllers. |
| 51 | + |
| 52 | +.. warning:: |
| 53 | + A robot's protective stop or emergency stop is only pausing the running program. If the program |
| 54 | + is resumed after the P-Stop or EM-Stop is released, the robot will continue executing what it |
| 55 | + has been doing. Therefore, it is advised to stop and re-start the program when recovering from a |
| 56 | + fault. |
| 57 | + |
| 58 | +The ``play_program`` flag is used to start the program after the robot state has been set. This has |
| 59 | +the same effects as explained in :ref:`continuation_after_interruptions`. |
0 commit comments