@ -25,26 +25,99 @@ In addition, check that the provided USB dongle is plugged into the robot USB po
Please review the troubleshooting section of the [Stretch 2 Battery Maintenance Guide](https://docs.hello-robot.com/0.2/stretch-hardware-guides/battery_maintenance_guide_re2).
## RPC Transport Errors (Stretch doesn't respond to commands)
## Port Busy or RPC Transport Errors
If more than one instance of Stretch Body's [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) class is instantiated at a time, Stretch Body will report communication errors and will not always execute motion commands as expected. This is because the [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) class manages communications with the robot hardware and it doesn't support multiple writes to the USB devices.
These errors can appear as
```{.bash .no-copy}
Transport RX Error on RPC_ACK_SEND_BLOCK_MORE False 0 102
Framer sent RPC_START_NEW_RPC
...
```
or as
```{.bash .no-copy}
IOError(None): None
...
```
<details>
<summary>Examples of busy port or RPC errors</summary>
```{.bash .no-copy}
[ERROR] [pimu]: Port /dev/hello-pimu is busy. Check if another Stretch Body process is already running
[WARNING] [pimu]: Unable to open serial port for device /dev/hello-pimu
[ERROR] [hello-motor-left-wheel]: Port /dev/hello-motor-left-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-left-wheel]: Unable to open serial port for device /dev/hello-motor-left-wheel
[ERROR] [hello-motor-right-wheel]: Port /dev/hello-motor-right-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-right-wheel]: Unable to open serial port for device /dev/hello-motor-right-wheel
[ERROR] [hello-motor-lift]: Port /dev/hello-motor-lift is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-lift]: Unable to open serial port for device /dev/hello-motor-lift
[ERROR] [hello-motor-arm]: Port /dev/hello-motor-arm is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-arm]: Unable to open serial port for device /dev/hello-motor-arm
[ERROR] [wacc]: Port /dev/hello-wacc is busy. Check if another Stretch Body process is already running
[WARNING] [wacc]: Unable to open serial port for device /dev/hello-wacc
[ERROR] [pimu]: Port /dev/hello-pimu is busy. Check if another Stretch Body process is already running
[WARNING] [pimu]: Unable to open serial port for device /dev/hello-pimu
[ERROR] [hello-motor-left-wheel]: Port /dev/hello-motor-left-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-left-wheel]: Unable to open serial port for device /dev/hello-motor-left-wheel
[ERROR] [hello-motor-lift]: Port /dev/hello-motor-lift is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-lift]: Unable to open serial port for device /dev/hello-motor-lift
[ERROR] [hello-motor-arm]: Port /dev/hello-motor-arm is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-arm]: Unable to open serial port for device /dev/hello-motor-arm
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
```
or
```{.bash .no-copy}
Transport RX Error on RPC_ACK_SEND_BLOCK_MORE False 0 102
---- Debug Exception
--------------- New RPC -------------------------
Framer sent RPC_START_NEW_RPC
...
```
or
```{.bash .no-copy}
IOError(None): None
...
```
</details>
To check if an instance of [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) is already instantiated, you may use the Unix [top](https://www.unixtutorial.org/commands/top) command to monitor active processes. You may use the Unix [pkill](https://linuxize.com/post/pkill-command-in-linux/) command to end the background instance of Robot.
@ -58,5 +131,45 @@ To turn it off, search for 'Startup' from Ubuntu Activities. Uncheck the box for
![](./images/xbox_off_rs.png)
## Invalid homing offset for single-turn mode Dynamixel
If you see a warning similar to:
```{.no-copy}
[WARNING] [head_tilt]: Dynamixel head_tilt: Servo is in single-turn mode yet has invalid homing offset of -1682.
This may cause unexpected results if not set to zero (using REx_dynamixel_jog.py)
Please contact Hello Robot support for more information
```
You have a "single-turn" Dynamixel servo (e.g. `head_tilt` in the above warning) that has an invalid "homing offset" saved to the servo's flash memory. This can lead to the motor returning its joint position incorrectly. In order to reset the homing offset to zero, create an instance of the Dynamixel class in Stretch Body and set the homing offset to zero. For example, doing this for the `head_tilt` servo looks like:
```{.python .no-copy}
hello-robot@stretch-re1-xxxx:~$ ipython3
Python 3.8.10 (default, Mar 13 2023, 10:26:41)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.7.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import stretch_body.dynamixel_hello_XL430
In [2]: servo = stretch_body.dynamixel_hello_XL430.DynamixelHelloXL430(name="head_tilt", chain=None)
In [3]: servo.startup()
[WARNING] [head_tilt]: Dynamixel head_tilt: Servo is in single-turn mode yet has invalid homing offset of -1682.
This may cause unexpected results if not set to zero (using REx_dynamixel_jog.py)
Please contact Hello Robot support for more information
Out[3]: True
In [4]: servo.disable_torque()
In [5]: servo.motor.set_homing_offset(0)
In [6]: servo.enable_torque()
In [7]: servo.stop()
In [8]:
Do you really want to exit ([y]/n)?
```
------
<divalign="center"> All materials are Copyright 2022 by Hello Robot Inc. Hello Robot and Stretch are registered trademarks.</div>