Difference between pages "E-STOP and Enable Robot" and "Key Use Tips in Enable Robot"

(Difference between pages)
Jump to: navigation , search
(create page estop and enable robot)
 
(Edit Estop and Enable Robot)
 
Line 1: Line 1:
<div class="content-block">
+
'''Robot State'''  <br />
{{TOClimit|limit=2}}
+
<code>/robot/state</code> ([https://rethinkrobotics.github.io/intera_sdk_docs/5.0.4/intera_core_msgs/html/msg/AssemblyState.html intera_core_msgs/AssemblyState])
 +
* Subscribe to the Robot State for the enabled and error state of the robot hardware itself. It also includes information on the EStop.
 +
* The robot must be enabled (<code>enabled: true</code>) in order to move the robot. Use the [https://github.com/RethinkRobotics/intera_sdk/blob/master/intera_interface/scripts/enable_robot.py Enable Robot Script], or the "Enable Robot Topic" below, to enable the robot.
 +
* It is possible for the robot to have non-fatal errors, so <code>error</code> can be <code>true</code> while <code>enabled</code> is also <code>true</code>.
 +
* For more complete information on robot state, see [[E-STOP and Enable Robot]]
  
=Robot State and E-Stop =
+
'''Enable Robot'''  <br />
The "Robot State" refers to the state variable that shows whether the robot (motors) are enabled or disabled, if the e-stop is engaged, and if there are any hardware errors.
+
<code>/robot/set_super_enable</code> ([http://www.ros.org/doc/api/std_msgs/html/msg/Bool.html std_msgs/Bool]) 
 +
* <code>data</code>: <code>true</code> to Enable robot motors; <code>false</code> to disable.
 +
* You can check the Robot State Topic to see if the robot enabled properly or if it has an error.
  
[[File:E_stop.jpg|300px]]
+
'''Reset Robot State''' <br />
 
+
<code>/robot/set_super_reset</code> ([http://www.ros.org/doc/api/std_msgs/html/msg/Empty.html std_msgs/Empty])
Sawyer's Emergency Stop (E-Stop) button (the image showing above) is a hardware stop which will disallow power to the robot components. The E-Stop should always be available when running advanced control programs as a safety precaution. If the robot ever moves unexpectedly, press the E-Stop to prevent anyone from being hurt, or damaging the Sawyer hardware.
+
* Publish an Empty message to reset the state after an error.
 
+
* A reset will clear all pre-existing errors and the state (it will disable).
<div class="content-block">
 
== Quickstart ==
 
Use the [https://github.com/RethinkRobotics/intera_sdk/blob/master/intera_interface/scripts/enable_robot.py Enable Robot Script] with various arguments to enable the robot or check its current state.
 
</div>
 
 
 
<div class="content-block">
 
== Overview ==
 
The "Robot State" refers to the state variable that shows whether the robot (motors) are enabled or disabled, if the e-stop is engaged, and if there are any hardware errors.
 
</div>
 
 
 
<div class="content-block">
 
== EStop and State Message ==
 
Below are various state messages and what they mean and indicate. The third column tells you the Resolution to follow if having a problem and you see this message.
 
{| class="wikitable"
 
|-
 
! scope="col"|Message
 
! scope="col"|EStop State / Error Meaning
 
! scope="col"|Resolution
 
|-
 
| <code>enabled: False</code> || Robot is disabled; Power to motors is OFF  || [https://github.com/RethinkRobotics/intera_sdk/blob/master/intera_interface/scripts/enable_robot.py Enable Robot Script]
 
|-
 
| <code>estop_button: 1</code>  || E-Stop button is engaged or loose.      ||
 
|-
 
| <code>estop_button: 2</code>  || S/W Stop was called.            ||
 
|-
 
| <code>estop_button: 3</code> || E-Stop button now disengaged (released), but not reset yet.  ||
 
|}
 
 
 
=== EStop States ===
 
Below is the raw contents of the [<code>intera_core_msgs/AssemblyState</code>][intera_core_msgs-AssemblyState] Message from the <code>/robot/state</code> topic. The contents explain the meaning of the <code>estop_button</code> and <code>estop_source</code> fields.
 
<source lang="bash">
 
$ rosmsg show intera_core_msgs/AssemblyState -r
 
bool enabled            # true if enabled
 
bool stopped            # true if stopped -- e-stop asserted
 
bool error              # true if a component of the assembly has an error
 
#
 
= The following are specific to the robot top-level assembly: =
 
uint8  estop_button      # One of the following:
 
  uint8  ESTOP_BUTTON_UNPRESSED = 0  # Robot is not stopped and button is not pressed
 
  uint8  ESTOP_BUTTON_PRESSED  = 1
 
  uint8  ESTOP_BUTTON_UNKNOWN  = 2  # STATE_UNKNOWN when estop was asserted by a non-user source
 
  uint8  ESTOP_BUTTON_RELEASED  = 3  # Was pressed, is now known to be released, but robot is still stopped.
 
#
 
uint8  estop_source      # If stopped is true, the source of the e-stop.  One of the following:
 
  uint8  ESTOP_SOURCE_NONE      = 0  # e-stop is not asserted
 
  uint8  ESTOP_SOURCE_USER      = 1  # e-stop source is user input (the red button)
 
  uint8  ESTOP_SOURCE_UNKNOWN  = 2  # e-stop source is unknown
 
  uint8  ESTOP_SOURCE_FAULT    = 3  # MotorController asserted e-stop in response to a joint fault
 
  uint8  ESTOP_SOURCE_BRAIN    = 4  # MotorController asserted e-stop in response to a lapse of the brain heartbeat
 
 
 
</source>
 
 
 
This table shows example scenarios of various E-Stop states and the corresponding robot state message that would be published.
 
 
 
{| class="wikitable"
 
|-
 
! scope="col"|Message
 
! scope="col"|EStop State / Error
 
! scope="col"|Resolution
 
|-
 
| <source lang="python">enabled: True
 
stopped: False
 
error: False
 
estop_button: 0
 
estop_source: 0</source>
 
| (Good) Robot is enabled; E-Stop is connected and disengaged. ||
 
|-
 
| <source lang="python">enabled: False
 
stopped: False
 
error: False
 
estop_button: 0
 
estop_source: 0</source>
 
| (Good) EStop connected and not triggered; robot disabled; or robot reset.
 
| Use the [https://github.com/RethinkRobotics/intera_sdk/blob/master/intera_interface/scripts/enable_robot.py Enable Robot Script] to enable the robot:<br/>
 
  <code>$ rosrun intera_interface enable_robot.py -e</code>
 
|-
 
| <source lang="python">enabled: False
 
stopped: True
 
error: True
 
estop_button: 1
 
estop_source: 1</source>
 
| E-Stop is engaged; Or E-Stop has come loose.
 
| Disengage the E-Stop, make sure it is firmly connected to the robot, then reset the robot.
 
|-
 
| <source lang="python">enabled: False
 
stopped: True
 
error: False
 
estop_button: 3
 
estop_source: 1</source>
 
| E-Stop is released (or reconnected), but not reset.
 
| Reset the robot, then try again:<br/>
 
  <code>$ rosrun intera_interface enable_robot.py -r</code>
 
|-
 
| <source lang="python">enabled: False
 
stopped: True
 
error: True
 
estop_button: 2
 
estop_source: 1</source>
 
| User triggered (Software) E-Stop.
 
| Reset the robot, then try again:<br/>
 
  <code>$ rosrun intera_interface enable_robot.py -r</code>
 
|}
 
 
 
</div>
 
</div>
 
 
 
<div class="content-block">
 
 
 
= Enable Robot =
 
The enable robot example program will allow you to enable/disable/reset/stop the robot. You can also get the robot's current state.  The robot must be enabled in order to control the motors.
 
In order to control Sawyer's arms, the robot must be put in the 'Enabled' state.  Enabling the robot provides power to the joint motors, which are initially in the 'Disabled' state on start-up or after a serious error, such as an E-Stop (Emergency-Stop).  The robot's 'State' can be checked with the enable_robot tool.
 
 
 
'''Note:''' If an error has occurred, the robot state may need to be reset (<code>-r</code>) before being enabled again.
 
 
 
<div class="content-block">
 
== Basic Usage ==
 
To '''Enable''' the robot:
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -e
 
</syntaxhighlight>
 
 
 
To '''Disable''' the robot:
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -d
 
</syntaxhighlight>
 
</div>
 
<div class="content-block">
 
== Functions ==
 
To get help on enable_robot use the <code>-h</code> argument:
 
   
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -h
 
</syntaxhighlight>
 
 
 
Help screen:
 
 
 
enable_robot.py [ARGUMENTS]
 
 
 
*h, --help      show this help message and edit
 
*s, --state    Print current robot state
 
*e, --enable    Enable the robot
 
*d, --disable  Disable the robot
 
*r, --reset     Reset the robot
 
*S, --stop      Stop the robot
 
</div>
 
 
 
 
 
<div class="content-block">
 
 
 
== Robot State ==
 
To get the current robot state use <code>-s</code>:
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -s
 
 
 
enabled: False
 
stopped: False
 
error: False
 
estop_button: 0
 
estop_source: 0
 
</syntaxhighlight>
 
The state output above indicates a normal (all-clear) status, as you would see after power-up.  Once you enable the robot to control the arms, you should see the same status but with <code>enabled: True</code>.
 
</div>
 
 
 
<div class="content-block">
 
== Enable Robot ==
 
Use <code>-e</code> to enable the robot.
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -e
 
</syntaxhighlight>
 
 
 
The robot state <code>enabled</code> field should then switch to True.
 
 
 
</div>
 
 
 
<div class="content-block">
 
 
 
== Disable Robot ==
 
Use <code>-d</code> to disable the robot.
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -d
 
</syntaxhighlight>
 
 
 
The robot state <code>enabled</code> field should then switch to False.
 
 
 
</div>
 
 
 
<div class="content-block">
 
 
 
== Reset ==
 
Use <code>-r</code> to reset the robot after an error (if the robot state gives <code>error: True</code>).
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -r
 
</syntaxhighlight>
 
 
 
This should clear the <code>error</code> field, setting it back to <code>error: False</code>.
 
 
 
</div>
 
 
 
<div class="content-block">
 
 
 
== Stop ==
 
Use <code>-S</code> (capital S) to stop the robot.  This is similar to a "software" E-Stop.
 
 
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot.py -S
 
</syntaxhighlight>
 
 
 
This will disable the robot and also cause the <code>stopped</code> field and the <code>error</code> field to go True.  You will need to reset the robot before enabling it again.
 
 
 
</div>
 
 
 
<div class="content-block">
 
 
 
== Troubleshooting ==
 
=== Robot fails to enable or reset ===
 
If your robot "fails to reset" when you run robot enable, the first thing to check is if the E-Stop is engaged:
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot -s
 
 
 
enabled: False
 
stopped: True
 
error: True
 
estop_button: 1
 
estop_source: 1 
 
</syntaxhighlight>
 
If the <code>estop_button:</code> field says '<code>1</code>', it means the E-Stop is engaged (from [<code>intera_core_msgs/AssemblyState</code>][intera_core_msgs-AssemblyState] message: <code>uint8 ESTOP_BUTTON_PRESSED=1</code>).
 
Disengage the E-Stop by twisting the red top until it 'pops'-up, then try resetting the robot.
 
<syntaxhighlight lang="bash" enclose="div">
 
$ rosrun intera_interface enable_robot -r
 
$ rosrun intera_interface enable_robot -e 
 
</syntaxhighlight>
 
</div>
 
</div>
 
 
 
<div class="content-block">
 
 
 
= More Information =
 
See the [https://github.com/RethinkRobotics/intera_sdk/blob/master/intera_interface/scripts/enable_robot.py Enable Robot Script] for more information about the robot's state and dealing with errors.
 
</div>
 

Latest revision as of 18:30, 13 January 2017

Robot State
/robot/state (intera_core_msgs/AssemblyState)

  • Subscribe to the Robot State for the enabled and error state of the robot hardware itself. It also includes information on the EStop.
  • The robot must be enabled (enabled: true) in order to move the robot. Use the Enable Robot Script, or the "Enable Robot Topic" below, to enable the robot.
  • It is possible for the robot to have non-fatal errors, so error can be true while enabled is also true.
  • For more complete information on robot state, see E-STOP and Enable Robot

Enable Robot
/robot/set_super_enable (std_msgs/Bool)

  • data: true to Enable robot motors; false to disable.
  • You can check the Robot State Topic to see if the robot enabled properly or if it has an error.

Reset Robot State
/robot/set_super_reset (std_msgs/Empty)

  • Publish an Empty message to reset the state after an error.
  • A reset will clear all pre-existing errors and the state (it will disable).