From 20d69df3ad5770660796b05580e3ad14d474d0f9 Mon Sep 17 00:00:00 2001 From: Aaron Edsinger Date: Fri, 26 Aug 2022 17:01:45 -0700 Subject: [PATCH] wip --- mkdocs.yml | 8 +- stretch_body/README.md | 36 ++-- stretch_body/stretch_body_guide.md | 260 ------------------------ stretch_body/tutorial_contact_models.md | 247 ++++++++++++++++++++++ stretch_body/tutorial_introduction.md | 6 +- stretch_body/tutorial_simple_coding.py | 1 - 6 files changed, 274 insertions(+), 284 deletions(-) delete mode 100644 stretch_body/stretch_body_guide.md create mode 100644 stretch_body/tutorial_contact_models.md delete mode 100644 stretch_body/tutorial_simple_coding.py diff --git a/mkdocs.yml b/mkdocs.yml index 8462186..a24efdc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -80,6 +80,7 @@ extra: - icon: material/linkedin link: https://linkedin.com/company/hello-robot-inc + nav: - Getting to Know Stretch: - Overview: ./getting_started/README.md @@ -94,9 +95,9 @@ nav: - Stretch Body: - Overview: ./stretch_body/README.md - Basics: - - Safe Coding: ./stretch_body/tutorial_safe_coding.md + - Introduction: ./stretch_body/tutorial_introduction.md - Command line Tools: ./stretch_body/tutorial_command_line_tools.md - - Simple Coding: ./stretch_body/tutorial_simple_coding.py + - Stretch Body API: ./stretch_body/tutorial_stretch_body_api.md - Robot Motion: ./stretch_body/tutorial_robot_motion.md - Robot Sensors: ./stretch_body/tutorial_robot_sensors.md - Advanced: @@ -104,7 +105,10 @@ nav: - Parameter Management: ./stretch_body/tutorial_parameter_management.md - Splined Trajectories: ./stretch_body/tutorial_splined_trajectories.md - Collision Avoidance: ./stretch_body/tutorial_collision_avoidance.md + - Contact Models: ./stretch_body/tutorial_contact_models.md - Changing Tools: ./stretch_body/tutorial_tool_change.md + - Custom Wrist DOF: ./stretch_body/tutorial_extending_wrist_dof.md + - Safety Features: ./stretch_body/tutorial_safe_coding.md - ROS1: - Overview: ./ros1/README.md - Basics: diff --git a/stretch_body/README.md b/stretch_body/README.md index 4eeb6fb..85ceb6b 100644 --- a/stretch_body/README.md +++ b/stretch_body/README.md @@ -1,6 +1,6 @@ ![](../images/banner.png) # Tutorial Track: Stretch Body -[Stretch Body](https://github.com/hello-robot/stretch_body) is a set of Python packages that allow a developer to directly program the hardware of the Stretch RE1 robot. The Stretch Body interface is intended for users who chose to not use ROS. +[Stretch Body](https://github.com/hello-robot/stretch_body) is a set of Python packages that allow a developer to directly program the hardware of the Stretch RE1 and RE2 robots. The Stretch Body interface is intended for users who choose to not use ROS. Stretch Body currently supports both Python2 and Python3. These tutorials assume a general familiarity with Python as well as basic robot motion control. @@ -8,24 +8,24 @@ Stretch Body currently supports both Python2 and Python3. These tutorials assume ## Basics -| | Tutorial | Description | -|-----|-------------------------------------------------------------|-----------------------------------------------------| -| 1 | [Introduction](tutorial_introduction.md) | Introduction to the Stretch Body package | -| 2 | [Command line Tools](tutorial_command_line_tools.md) | Introduction to the Stretch Body command line tools | -| 3 | [Deep dive: Stretch Body API](tutorial_stretch_body_api.md) | Deep dive on using the Stretch Body API | -| 4 | [Deep dive: Robot Motion](tutorial_robot_motion.md) | Deep dive on commanding robot motion | - +| | Tutorial | Description | +|-----|-------------------------------------------------------------|-------------------------------------------| +| 1 | [Introduction](tutorial_introduction.md) | Introduction to the Stretch Body package | +| 2 | [Command line Tools](tutorial_command_line_tools.md) | Using the Stretch Body command line tools | +| 3 | [Stretch Body API](tutorial_stretch_body_api.md) | Walk through of the Stretch Body API | +| 4 | [Robot Motion](tutorial_robot_motion.md) | How to command robot motion | +| 4 | [Robot Sensors](tutorial_robot_sensors.md) | How to read robot sensors | ## Advanced -| | Tutorial | Description | -|-----|------------------------------------------------------------|-------------------------------------------------------------| -| 1 | [Dynamixel Servos](tutorial_dynamixel_servos.md) | How to configure and work with the Stretch Dynamixel servos | -| 2 | [Parameter Management](tutorial_parameter_management.md) | How to work with Stretch's parameter system | -| 3 | [Splined Trajectories](tutorial_splined_trajectories.md) | How to generated coordinated, smooth, and full-body motion | -| 4 | [Collision Avoidance](tutorial_collision_avoidance.md) | How to work with Stretch's collision avoidance system | -| 5 | [Contact Models](tutorial_contact_models.md) | How to work with Stretch's contact detection system | -| 6 | [Changing Tools](tutorial_tool_change.md) | How to configure Stretch to work with a different tool | -| 7 | [Adding Custom Wrist DOF](tutorial_extending_wrist_dof.md) | How to integrate custom DOF onto the wrist | -| 8 | [Safety Features](tutorial_safe_coding.md) | Learn about Stretch Body features that keep the robot safe | +| | Tutorial | Description | +|-----|------------------------------------------------------------|------------------------------------------------------------| +| 1 | [Dynamixel Servos](tutorial_dynamixel_servos.md) | How to configure and work with the Dynamixel servos | +| 2 | [Parameter Management](tutorial_parameter_management.md) | How to work with parameter system | +| 3 | [Splined Trajectories](tutorial_splined_trajectories.md) | How to generated coordinated, smooth, and full-body motion | +| 4 | [Collision Avoidance](tutorial_collision_avoidance.md) | How to work with the collision avoidance system | +| 5 | [Contact Models](tutorial_contact_models.md) | How to work with the contact detection system | +| 6 | [Changing Tools](tutorial_tool_change.md) | How to configure Stretch to work with a different tool | +| 7 | [Custom Wrist DOF](tutorial_extending_wrist_dof.md) | How to integrate custom DOF onto the wrist | +| 8 | [Safety Features](tutorial_safe_coding.md) | Learn about Stretch Body features that keep the robot safe | diff --git a/stretch_body/stretch_body_guide.md b/stretch_body/stretch_body_guide.md deleted file mode 100644 index dfa0d8c..0000000 --- a/stretch_body/stretch_body_guide.md +++ /dev/null @@ -1,260 +0,0 @@ -![](./images/banner.png) -# Working with Stretch Body -The Stretch_Body package provides a low level Python API to the Stretch RE1 hardware. - -The package is available on [Git and installable via Pip](https://github.com/hello-robot/stretch_body). - -It encapsulates - -* Mobile base -* Arm -* Lift -* Head actuators -* Wrist and tool actuators -* Wrist accelerometer and Arduino -* Base power and IMU board - -The robot's 3rd party hardware devices are intended to be accessed through ROS and not Stretch_Body. However, it is possible to directly access this hardware through open-source Python packages: - -* Laser range finder: [rplidar](https://github.com/SkoltechRobotics/rplidar) -* Respeaker: [respeaker_python_library](https://github.com/respeaker/respeaker_python_library) -* D435i: [pyrealsense2](https://pypi.org/project/pyrealsense2/) - -The Stretch_Body package is intended for advanced users who prefer to not use ROS to control the robot. It assumes a moderate level of experience programming robot sensors and actuators. - - -## Robot Interface - -The primary developer interface to Stretch_Body is the [Robot class](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py). - -As an example, the Python script below prints all Robot sensor and state data to the console every 250ms. - -```python linenums="1" -import time -import stretch_body.robot - -robot=stretch_body.robot.Robot() -robot.startup() - -for i in range(10): - robot.pretty_print() - time.sleep(0.25) - -robot.stop() - -``` - -Looking at this in detail: - -```python linenums="2" -import stretch_body.robot -``` - -The package stretch_body includes the Python module for Robot as well as other Devices such as Lift and Arm. - -```python linenums="4" -robot=stretch_body.robot.Robot() -robot.startup() -``` - -Here we instantiate an instance of our Robot. The call to `startup()` opens the serial ports to the various devices, loads the Robot YAML parameters, and launches a few helper threads. - -```python linenums="7" -for i in range(10): - robot.pretty_print() - time.sleep(0.25) -``` - -The call to `pretty_print()` prints to console all of the robot's sensor and state data. - -```python linenums="11" -robot.stop() -``` - -Finally, the `stop()` method shuts down the Robot threads and cleanly closes the open serial ports. - -### Units - -The Robot API uses SI units of: - -* meters -* radians -* seconds -* Newtons -* Amps -* Volts - -Parameters may be named with a suffix to help describe the unit type. For example: - -* pos_m : meters -* pos_r: radians - -### The Robot Status - -The Robot derives from the [Device class](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/device.py). It also encapsulates a number of other Devices: - -* [robot.head](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/head.py) -* [robot.arm](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/arm.py) -* [robot.lift](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/lift.py) -* [robot.base](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/base.py) -* [robot.wacc](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/wacc.py) -* [robot.pimu](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/pimu.py) -* [robot.end_of_arm](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/end_of_arm.py) - -All devices contain a Status dictionary. The Status contains the most recent sensor and state data of that device. For example, looking at the Arm class we see: - -```python -class Arm(Device): - def __init__(self): - ... - self.status = {'pos': 0.0, 'vel': 0.0, 'force':0.0, \ - 'motor':self.motor.status,'timestamp_pc':0} -``` - -The Status dictionaries are automatically updated by a background thread of the Robot at 25Hz. The Status data can be accessed via the Robot. For example: - -```python -if robot.arm.status['pos']>0.25: - print('Arm extension greater than 0.25m') -``` - -If an instantaneous snapshot of the entire Robot Status is needed, the `get_status()` method can be used instead: - -```python -status=robot.get_status() -if status['arm']['pos']>0.25: - print('Arm extension greater than 0.25m') -``` - -### The Robot Command - -In contrast to the Robot Status which pulls data from the Devices, the Robot Command pushes data to the Devices. - -Consider the following example which extends and then retracts the arm by 0.1 meters: - -```python linenums="1" -import time -import stretch_body.robot - -robot=stretch_body.robot.Robot() -robot.startup() - -robot.arm.move_by(0.1) -robot.push_command() -time.sleep(2.0) - -robot.arm.move_by(-0.1) -robot.push_command() -time.sleep(2.0) - -robot.stop() -``` - -A few important things are going on: - -```python linenums="7" -robot.arm.move_by(0.1) -``` - -The `move_by()` method queues up an RPC command to the stepper motor controller. However, the command does not yet execute. - -```python linenums="8" -robot.push_command() -``` - -The `push_command()` causes all queued up RPC commands to be executed at once. In this example we call `sleep()` to allow time for the motion to complete before initiating a new motion. - -**NOTE**: The Dynamixel servos do not use the Hello Robot RPC protocol. As such, the head, wrist, and gripper will move immediately upon issuing a motion command. - -The stepper actuators support a synchronous mode, allowing the base, arm, and lift to synchronously track trajectories. Thus, the following code will cause the base, arm, and lift to initiate motion simultaneously: - -```python -robot.arm.move_by(0.1) -robot.lift.move_by(0.1) -robot.base.translate_by(0.1) -robot.push_command() -``` - -Commanding robot motion through the Stretch_Body interface is covered in more detail in the Robot Motion section. - -### Stowing and Homing - -After power up the robot requires homing in order for its joint encoders to find their zero position. The homing procedure will run the robot through a series of moves to find these zeros. It can be done programatically: - -```python -if not robot.is_calibrated(): - robot.home() #blocking -``` - -Or it can be done manually after boot using the command line tool: - -```console -$ stretch_robot_home.py -``` - -Likewise, stowing is a robot procedure that will cause it to move its arm and tool safely within the footprint of the base. - -```python -robot.stow() #blocking -``` - -Or it can be done manually from the command line when needed: - -```console -$ stretch_robot_stow.py -``` - -## Scripting the Robot - -A simplified design pattern to script the Robot is as follows - -```python linenums="1" -#!/usr/bin/env python -import time -import stretch_body.robot -from stretch_body.hello_utils import ThreadServiceExit - -robot=stretch_body.robot.Robot() -robot.startup() - -x_move_base = 0 -x_move_arm = 0 -x_move_lift = 0 -x_move_head_pan = 0 -x_move_head_tilt = 0 -x_move_wrist_yaw = 0 -x_move_gripper = 0 - -def update_my_behavior(status): - #Update the joint commands based on the status data - pass - -try: - while True: - #Get a snapshot of the robot status data - status=robot.get_status() - - #Compute new position targets based on sensor data - update_my_behavior(status) - - #Queue new targets to devices - robot.base.translate_by(x_move_base) #or robot.base.rotate_by() - robot.arm.move_by(x_move_arm) - robot.lift.move_by(x_move_lift) - robot.head.move_by('head_pan', x_move_head_pan) - robot.head.move_by('head_tilt', x_move_head_tilt) - robot.end_of_arm.move_by('wrist_yaw', x_move_wrist_yaw) - robot.end_of_arm.move_by('stretch_gripper', x_move_gripper) - - #Synchronized send of new position targets - robot.push_command() - - #Wait for next control cycle - time.sleep(0.1) -except (KeyboardInterrupt, SystemExit, ThreadServiceExit) - pass - -robot.stop() - -``` - diff --git a/stretch_body/tutorial_contact_models.md b/stretch_body/tutorial_contact_models.md new file mode 100644 index 0000000..befdfd2 --- /dev/null +++ b/stretch_body/tutorial_contact_models.md @@ -0,0 +1,247 @@ +# Stretch RE1: Tool Change Tutorial + +Many users will want to work with tools other than the default Stretch Gripper that ships with the robot. In this tutorial you will learn how to configure the Stretch software interfaces to support other tools. + +## Changing Tool Interfaces in Stretch Body + +Stretch Body v0.1.x and later supports a plug-in based architecture for tools. A tool interface is an extension of the [EndOfArm](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/end_of_arm.py) class that supports additional degrees of freedom. + +### Standard Tools + +Stretch Body supports two tool interfaces by default: The [ToolNone & ToolStretchGripper](https://github.com/hello-robot/stretch_body/tree/master/body/end_of_arm_tools.py). We will explore swapping between these default tools. + +#### ToolStretchGripper + +The RE1 is configured to load the ToolStretchGripper interface by default. This tool is loaded according to the `stretch_re1_user_params.yaml` field: + +```yaml +robot: + tool: tool_stretch_gripper +``` + +We can interact with this tool from iPython + +```python +In [1]: import stretch_body.robot as robot + +In [2]: r=robot.Robot() + +In [3]: r.startup() + +In [4]: r.end_of_arm +Out[4]: + +In [5]: r.end_of_arm.motors +Out[5]: +{'stretch_gripper': , + 'wrist_yaw': } + +In [6]: r.end_of_arm.stow() +--------- Stowing Wrist Yaw ---- +--------- Stowing Gripper ---- +In [7]: r.stop() +``` + +#### ToolNone + +The ToolNone interface can be loaded when no tool is attached to the Wrist Yaw joint. To switch to this interface, simply update the field in your `stretch_re1_user_params.yaml` to: + +```yaml +robot: + tool: tool_none +``` + +After updating the YAML we can interact with the ToolNone via iPython + +```python +In [1]: import stretch_body.robot as robot + +In [2]: r=robot.Robot() + +In [3]: r.startup() + +In [4]: r.end_of_arm +Out[4]: + +In [5]: r.end_of_arm.motors +Out[5]: {'wrist_yaw': } + +In [6]: r.end_of_arm.stow() +--------- Stowing Wrist Yaw ---- +In [7]: r.stop() +``` + +## Loading Tool Interfaces from the Stretch Tool Share + +The [Stretch Tool Share](https://github.com/hello-robot/stretch_tool_share/) is an open Git repository for non-standard RE1 tools. It hosts the CAD, URDF, and Python files needed to integrate these tools onto your robot. + +To use Stretch Tool Share tools, first update your installation: + +```console +$ pip2 install hello-robot-stretch-tool-share +``` + +As an example, we see on the Tool Share that there is a tool, the [ToolDryEraseToolHolderV1](https://github.com/hello-robot/stretch_tool_share/blob/master/python/stretch_tool_share/dry_erase_holder_v1/tool.py) which [extends the EndOfArm](https://github.com/hello-robot/stretch_tool_share/blob/master/python/stretch_tool_share/usbcam_wrist_v1/tool.py) class. In order to load this tool interface , modify your `stretch_re1_user_params.yaml` to load the tool as before. We will also need to tell it where to find the tool's [parameter file](https://github.com/hello-robot/stretch_tool_share/blob/master/python/stretch_tool_share/dry_erase_holder_v1/params.py): + +```yaml +robot: + tool: tool_dry_erase_holder_v1 +params: +- stretch_tool_share.dry_erase_holder_v1.params +``` + +We can now interact with the tool in iPython: + +```python +In [1]: import stretch_body.robot as robot + +In [2]: r=robot.Robot() + +In [3]: r.startup() + +In [4]: r.end_of_arm +Out[4]: + +In [5]: r.end_of_arm.motors +Out[5]: {'wrist_yaw': } + +In [6]: r.end_of_arm.stow() +--------- Stowing Wrist Yaw ---- + +``` + +# Changing Tool Interfaces in Stretch ROS + +Next we'll show how to change the ROS interface for a tool. Here we will continue with the [ToolDryEraseHolderV1](https://github.com/hello-robot/stretch_tool_share/blob/master/python/stretch_tool_share/dry_erase_holder_v1/tool.py#L3) example. First, configure Stretch Body to use the tool as in the previous exercise. + +Next, ensure your ROS is up to date: + +```console +$ cd ~/catkin_ws/src/stretch_ros/ +$ git pull +``` + +To access the URDF data for the [ToolDryEraseHolderV1](https://github.com/hello-robot/stretch_tool_share/blob/master/python/stretch_tool_share/dry_erase_holder_v1/tool.py#L3) we'll need to clone the Tool Share repository: + +```console +$ cd ~/repos +$ git clone https://github.com/hello-robot/stretch_tool_share +``` + +Copy in the tool's URDF data into the Stretch ROS repository: + +```console +$ cd ~/repos/stretch_tool_share/tool_share/dry_erase_holder_v1 +$ cp stretch_description/urdf/*.xacro ~/catkin_ws/src/stretch_ros/stretch_description/urdf/ +$ cp stretch_description/meshes/*.STL ~/catkin_ws/src/stretch_ros/stretch_description/meshes/ +``` + +Now we will update the tool Xacro for Stretch. Open the file `~/catkin_ws/src/stretch_ros/stretch_description/urdf/stretch_description.xacro` in an editor. Comment out the current tool Xacro and include the Xacro for the dry erase holder. + +```xml + + + + + + + + + + + + +``` + +Finally, we'll update our already calibrated URDF to use this new tool: + +```console +$ cd ~/catkin_ws/src/stretch_ros/stretch_description/urdf +$ cp stretch.urdf stretch.urdf.bak +$ rosrun stretch_calibration update_urdf_after_xacro_change.sh +``` + +Ctrl-C when the `rosrun` command terminates and you're ready to visualize the tool in RViz: + +```console +$ roslaunch stretch_calibration simple_test_head_calibration.launch +``` + +![](./images/dry_erase_rviz.png) + +# Advanced Topics + +## Understanding How the Tool Plug-In Works + +For users looking to create their own custom tools it can be useful to understand how the tool plug-in architecture works. Here we will walk through the basics of the system for both Stretch Body and Stretch ROS + +### Stretch Body + +The [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py#L97) class expects an instance of EndOfArm tool to be present. The EndOfArm tool is an extension of the [DynamixelXChain](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/dynamixel_X_chain.py#L16) class, which manages a chain of Dynamixel servos. + +A tool is defined via its parameters (either in user YAML or Python). For example, the ToolStretchGripper is defined in [robot_params.py](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot_params.py). These parameters tell the plug-in which [DynamixelHelloXL430](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/dynamixel_hello_XL430.py) instances to load and manage. Here we see: + +```python +"tool_stretch_gripper": { + 'use_group_sync_read': 1, + 'retry_on_comm_failure': 1, + 'baud':115200, + 'verbose':0, + 'py_class_name': 'ToolStretchGripper', + 'py_module_name': 'stretch_body.end_of_arm_tools', + 'stow': {'stretch_gripper': 0, 'wrist_yaw': 3.4}, + 'devices': { + 'stretch_gripper': { + 'py_class_name': 'StretchGripper', + 'py_module_name': 'stretch_body.stretch_gripper' + }, + 'wrist_yaw': { + 'py_class_name': 'WristYaw', + 'py_module_name': 'stretch_body.wrist_yaw' + } + } +}, +``` + +This dictionary defines a tool of class ToolStretchGripper with two [DynamixelHelloXL430](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/dynamixel_hello_XL430.py) devices on its bus (StretchGripper and WristYaw). + +We see that the [ToolStretchGripper](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/end_of_arm_tools.py#L7) class extends the EndOfArm class and provides its own stowing behavior: + +```python +class ToolStretchGripper(EndOfArm): + def __init__(self, name='tool_stretch_gripper'): + EndOfArm.__init__(self,name) + + def stow(self): + # Fold in wrist and gripper + print('--------- Stowing Wrist Yaw ----') + self.move_to('wrist_yaw', self.params['stow']['wrist_yaw']) + print('--------- Stowing Gripper ----') + self.move_to('stretch_gripper', self.params['stow']['stretch_gripper']) +``` + +For tools that are not a part of Stretch Body, such as from the Tool Share, you must include the tool parameters as well in your `stretch_re1_user_params.yaml`. A robot that must support many tools may have user YAML that looks like: + +```yaml +params: +- stretch_tool_share.usbcam_wrist_v1.params +- stretch_tool_share.stretch_dex_wrist_beta.params +- stretch_tool_share.dry_erase_holder_v1.params +robot: + tool: tool_dry_erase_holder_v1 + #tool: tool_none + #tool: tool_stretch_gripper + #tool: tool_usbcam_wrist_v1 + #tool: tool_stretch_dex_wrist_beta +``` + +For a more complex implementation of a tool we recommend reviewing the Stretch Dex Wrist implementation on the Stretch Tool Share. + +### Stretch ROS + +Stretch ROS also supports the tool plug-in architecture. Under ROS this is managed by extending the [SimpleCommandGroup](https://github.com/hello-robot/stretch_ros/blob/master/hello_helpers/src/hello_helpers/simple_command_group.py). + +More coming soon. + +------ +
All materials are Copyright 2020 by Hello Robot Inc. The Stretch RE1 robot has patents pending
diff --git a/stretch_body/tutorial_introduction.md b/stretch_body/tutorial_introduction.md index 691fdc4..38e24d2 100644 --- a/stretch_body/tutorial_introduction.md +++ b/stretch_body/tutorial_introduction.md @@ -13,7 +13,7 @@ It encapsulates the: * Wrist board with accelerometer (Wacc) * Base power and IMU board (Pimu) -As shown below, the primary programming interface to Stretch Body s the [Robot class](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py). This class encapsulates the various hardware module classes (e.g. Lift, Arm, etc). Each of these modules then communicate the robot's firmware over USB using various utility classes. +As shown below, the primary programming interface to Stretch Body is the [Robot class](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py). This class encapsulates the various hardware module classes (e.g. Lift, Arm, etc). Each of these modules then communicate the robot's firmware over USB using various utility classes. ![alt_text](images/stretch_body_overview.png "image_tooltip") @@ -31,7 +31,7 @@ Stretch also includes 3rd party hardware devices that are not accessible through The primary developer interface to Stretch_Body is the [Robot class](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py). Let's write some code to explore the interface. Launch an interactive Python terminal: ```bash -hello-robot@stretch-re2-9999:~$ ipython +>>$ ipython In [1]: ``` @@ -118,7 +118,7 @@ class Arm(Device): 'motor':self.motor.status,'timestamp_pc':0} ``` -The Status dictionaries are automatically updated by a background thread of the Robot at around 20Hz. The Status data can be accessed via the Robot. For example: +The Status dictionaries are automatically updated by a background thread of the Robot at around 25Hz. The Status data can be accessed via the Robot. For example: ```python if robot.arm.status['pos']>0.25: diff --git a/stretch_body/tutorial_simple_coding.py b/stretch_body/tutorial_simple_coding.py deleted file mode 100644 index 3c0b0b0..0000000 --- a/stretch_body/tutorial_simple_coding.py +++ /dev/null @@ -1 +0,0 @@ -Coming soon