From 3fd117339d3dee835998ceda5b2bd14ca6f9cbf9 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:13:23 -0700 Subject: [PATCH 01/44] example_2.md Change the path of the RViz configuration and added a note. --- ros2/example_2.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ros2/example_2.md b/ros2/example_2.md index ed71c8f..9bd3e7f 100644 --- a/ros2/example_2.md +++ b/ros2/example_2.md @@ -59,9 +59,11 @@ ros2 run stretch_ros_tutorials scan_filter Then run the following command to bring up a simple RViz configuration of the Stretch robot. ```{.bash .shell-prompt} -ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/rviz/stretch_simple_test.rviz +ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/share/stretch_calibration/rviz/stretch_simple_test.rviz ``` - +!!! note + If the laser scan or the filter doesn't appear, you can add it manually in Add, By Topic and you can find the filter_scan there. + Change the topic name from the LaserScan display from */scan* to */filter_scan*.
From c47e271f577de534993083f43136e967c5162ff6 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:16:16 -0700 Subject: [PATCH 02/44] example_4.md Change a typo and the path was incorrect --- ros2/example_4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros2/example_4.md b/ros2/example_4.md index 8e8db34..b768420 100644 --- a/ros2/example_4.md +++ b/ros2/example_4.md @@ -9,7 +9,7 @@ Let's bring up Stretch in RViz by using the following command. ```{.bash .shell-prompt} ros2 launch stretch_core stretch_driver.launch.py -ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibrtion`/rviz/stretch_simple_test.rviz +ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/share/stretch_calibration/rviz/stretch_simple_test.rviz ``` In a new terminal run the following commands to create a marker. From 2293d0a1102f092016dccf14b79cac2e5a5d6c3b Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:39:47 -0700 Subject: [PATCH 03/44] example_10.md Only minor edits like the tf instead of tf2 --- ros2/example_10.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ros2/example_10.md b/ros2/example_10.md index 7a2a5de..8728584 100644 --- a/ros2/example_10.md +++ b/ros2/example_10.md @@ -21,7 +21,7 @@ ros2 run rviz2 rviz2 Then run the tf2 broadcaster node to visualize three static frames. ```{.bash .shell-prompt} -ros2 run stretch_ros_tutorials tf2_broadcaster +ros2 run stretch_ros_tutorials tf_broadcaster ``` The GIF below visualizes what happens when running the previous node. @@ -222,13 +222,13 @@ ros2 launch stretch_core stretch_driver.launch.py Then run the tf2 broadcaster node to create the three static frames. ```{.bash .shell-prompt} -ros2 run stretch_ros_tutorials tf2_broadcaster +ros2 run stretch_ros_tutorials tf_broadcaster ``` Finally, run the tf2 listener node to print the transform between two links. ```{.bash .shell-prompt} -ros2 run stretch_ros_tutorials tf2_listener +ros2 run stretch_ros_tutorials tf_listener ``` Within the terminal the transform will be printed every 1 second. Below is an example of what will be printed in the terminal. There is also an image for reference of the two frames. From 69b6fde1c0a6e7d4f3d1bf8d037f86b7e1578004 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:50:04 -0700 Subject: [PATCH 04/44] Update getting_started.md Change the deprecated mode from manipulation to trajectory and added how to build in ROS2 --- ros2/getting_started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ros2/getting_started.md b/ros2/getting_started.md index 3d0af01..f88818f 100644 --- a/ros2/getting_started.md +++ b/ros2/getting_started.md @@ -22,13 +22,13 @@ We will disable ROS1 by commenting out the ROS1 related lines by adding '#' in f Save this configuration using **Ctrl + S**. Close out of the current terminal and open a new one. ROS2 is now enabled! ## Refreshing the ROS2 workspace -While Stretch ROS2 is in beta, there will be frequent updates to the ROS2 software. Therefore, it makes sense to refresh the ROS2 software to the latest available release. In the ROS and ROS2 world, software is organized into "ROS Workspaces", where packages can be developed, compiled, and be made available to run from the command line. We are going to refresh the ROS2 workspace, which is called "~/ament_ws" and available in the home directory. Follow the [Create a new ROS Workspace guide](https://docs.hello-robot.com/0.2/stretch-install/docs/ros_workspace/) to run the `stretch_create_ament_workspace.sh` script. This will delete the existing "~/ament_ws", create a new one with all of the required ROS2 packages for Stretch, and compile it. +While Stretch ROS2 is in beta, there will be frequent updates to the ROS2 software. Therefore, it makes sense to refresh the ROS2 software to the latest available release. In the ROS and ROS2 world, software is organized into "ROS Workspaces", where packages can be developed, compiled, and be made available to run from the command line. We are going to refresh the ROS2 workspace, which is called "~/ament_ws" and available in the home directory. Follow the [Create a new ROS Workspace guide](https://docs.hello-robot.com/0.2/stretch-install/docs/ros_workspace/) to run the `stretch_create_ament_workspace.sh` script. This will delete the existing "~/ament_ws", create a new one with all of the required ROS2 packages for Stretch, and compile it. Also we need to take into account that building the workspace is different in ROS2, we need to type colcon build instead of catkin make for it to work. ## Testing Keyboard Teleop We can test whether the ROS2 workspace was enabled successfully by testing out the ROS2 drivers package, called "stretch_core", with keyboard teleop. In one terminal, we'll launch Stretch's ROS2 drivers using: ```{.bash .shell-prompt} -ros2 launch stretch_core stretch_driver.launch.py mode:=manipulation +ros2 launch stretch_core stretch_driver.launch.py mode:=trajectory ``` In the second terminal, launch the keyboard teleop node using: From 5759b50840bfc6dccc72bd6939534b6667eb1d17 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:55:22 -0700 Subject: [PATCH 05/44] Update follow_joint_trajectory.md Added a note and a preference of the stretch driver --- ros2/follow_joint_trajectory.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ros2/follow_joint_trajectory.md b/ros2/follow_joint_trajectory.md index b82a538..8dd66f7 100644 --- a/ros2/follow_joint_trajectory.md +++ b/ros2/follow_joint_trajectory.md @@ -1,8 +1,10 @@ ## FollowJointTrajectory Commands !!! note ROS 2 tutorials are still under active development. +!!! note 2 + For this exercise you'll need to have Ubuntu 22.04 and ROS Iron for it to work completly. -Stretch driver offers a [`FollowJointTrajectory`](http://docs.ros.org/en/api/control_msgs/html/action/FollowJointTrajectory.html) action service for its arm. Within this tutorial, we will have a simple FollowJointTrajectory command sent to a Stretch robot to execute. +Stretch driver offers a [`FollowJointTrajectory`](http://docs.ros.org/en/api/control_msgs/html/action/FollowJointTrajectory.html) action service for its arm. Within this tutorial, we will have a simple FollowJointTrajectory command sent to a Stretch robot to execute. And just as the past practice, it's preferable to have the stretch driver in trajectory mode. ## Stow Command Example From 63046cbcf459c64af8cd6b96fd9979810fec7ed0 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:57:00 -0700 Subject: [PATCH 06/44] Update follow_joint_trajectory.md --- ros2/follow_joint_trajectory.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ros2/follow_joint_trajectory.md b/ros2/follow_joint_trajectory.md index 8dd66f7..5897f04 100644 --- a/ros2/follow_joint_trajectory.md +++ b/ros2/follow_joint_trajectory.md @@ -1,6 +1,7 @@ ## FollowJointTrajectory Commands !!! note ROS 2 tutorials are still under active development. + !!! note 2 For this exercise you'll need to have Ubuntu 22.04 and ROS Iron for it to work completly. From 50047a886b35e87b04a162dba901f3f9fa61e194 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:01:18 -0700 Subject: [PATCH 07/44] Update internal_state_of_stretch.md Added an updated image --- ros2/internal_state_of_stretch.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ros2/internal_state_of_stretch.md b/ros2/internal_state_of_stretch.md index ccb3889..05aaf3c 100644 --- a/ros2/internal_state_of_stretch.md +++ b/ros2/internal_state_of_stretch.md @@ -42,5 +42,8 @@ ros2 run rqt_graph rqt_graph ``` ![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rqt_graph.png) +![image](https://github.com/hello-robot/stretch_tutorials/assets/141784078/f34876b8-775c-4c25-9e63-5aa53b2fb006) + + The graph allows a user to observe and affirm if topics are broadcasted to the correct nodes. This method can also be utilized to debug communication issues. From 9bc09f043ff615b5ce9cab0bc9d8538d73155f9a Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:04:11 -0700 Subject: [PATCH 08/44] Update internal_state_of_stretch.md Change the updated image to see changes --- ros2/internal_state_of_stretch.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ros2/internal_state_of_stretch.md b/ros2/internal_state_of_stretch.md index 05aaf3c..9a0b15e 100644 --- a/ros2/internal_state_of_stretch.md +++ b/ros2/internal_state_of_stretch.md @@ -42,7 +42,8 @@ ros2 run rqt_graph rqt_graph ``` ![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rqt_graph.png) -![image](https://github.com/hello-robot/stretch_tutorials/assets/141784078/f34876b8-775c-4c25-9e63-5aa53b2fb006) +![image](https://github.com/hello-robot/stretch_tutorials/assets/141784078/ab033d89-d861-44f4-92f3-966dba2d98de) + From 2e0bbeacb3a5a9bf7cb24c96dac9fe8358851e61 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:05:09 -0700 Subject: [PATCH 09/44] Update internal_state_of_stretch.md Now it is a better image --- ros2/internal_state_of_stretch.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ros2/internal_state_of_stretch.md b/ros2/internal_state_of_stretch.md index 9a0b15e..3c816a3 100644 --- a/ros2/internal_state_of_stretch.md +++ b/ros2/internal_state_of_stretch.md @@ -42,7 +42,8 @@ ros2 run rqt_graph rqt_graph ``` ![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rqt_graph.png) -![image](https://github.com/hello-robot/stretch_tutorials/assets/141784078/ab033d89-d861-44f4-92f3-966dba2d98de) +![image](https://github.com/hello-robot/stretch_tutorials/assets/141784078/9d6a303c-1681-4723-932c-212f5ced1044) + From 813350fa94a348e48cda5d7c5a7f7d19020c4d97 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:06:00 -0700 Subject: [PATCH 10/44] Update internal_state_of_stretch.md Deleted old image and change it for an updated one --- ros2/internal_state_of_stretch.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ros2/internal_state_of_stretch.md b/ros2/internal_state_of_stretch.md index 3c816a3..ddc311b 100644 --- a/ros2/internal_state_of_stretch.md +++ b/ros2/internal_state_of_stretch.md @@ -41,7 +41,6 @@ A powerful tool to visualize the ROS communication is through the rqt_graph pack ros2 run rqt_graph rqt_graph ``` -![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rqt_graph.png) ![image](https://github.com/hello-robot/stretch_tutorials/assets/141784078/9d6a303c-1681-4723-932c-212f5ced1044) From 25010666303dd702e7b415a0d7e9b39df13e020e Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 08:48:09 -0700 Subject: [PATCH 11/44] Update align_to_aruco.md Fixed a typo and differentiation in the angle and distance in bold. --- ros2/align_to_aruco.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ros2/align_to_aruco.md b/ros2/align_to_aruco.md index 2ed21b6..4c0e879 100644 --- a/ros2/align_to_aruco.md +++ b/ros2/align_to_aruco.md @@ -84,7 +84,7 @@ The joint_states_callback is the callback method that receives the most recent j self.joint_state = joint_state ``` -The copute_difference() method is where we call the get_transform() method from the FrameListener class to compute the difference between the base_link and base_right frame with an offset of 0.5 m in the negative y-axis. +The compute_difference() method is where we call the get_transform() method from the FrameListener class to compute the difference between the base_link and base_right frame with an offset of 0.5 m in the negative y-axis. ```python def compute_difference(self): self.trans_base, self.trans_camera = self.node.get_transforms() @@ -103,7 +103,7 @@ To compute the (x, y) coordinates of the SE2 pose goal, we compute the transform base_position_y = P_base[1, 0] ``` -From this, it is relatively straightforward to compute the angle phi and the euclidean distance dist. We then compute the angle z_rot_base to perform the last angle correction. +From this, it is relatively straightforward to compute the angle **ph**i and the euclidean distance **dist**. We then compute the angle z_rot_base to perform the last angle correction. ```python phi = atan2(base_position_y, base_position_x) From 0bfd6bd839b2fe3ab97bda8ddc9555e9a91ea6c8 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 08:48:40 -0700 Subject: [PATCH 12/44] Update align_to_aruco.md --- ros2/align_to_aruco.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros2/align_to_aruco.md b/ros2/align_to_aruco.md index 4c0e879..7d0c867 100644 --- a/ros2/align_to_aruco.md +++ b/ros2/align_to_aruco.md @@ -103,7 +103,7 @@ To compute the (x, y) coordinates of the SE2 pose goal, we compute the transform base_position_y = P_base[1, 0] ``` -From this, it is relatively straightforward to compute the angle **ph**i and the euclidean distance **dist**. We then compute the angle z_rot_base to perform the last angle correction. +From this, it is relatively straightforward to compute the angle **phi** and the euclidean distance **dist**. We then compute the angle z_rot_base to perform the last angle correction. ```python phi = atan2(base_position_y, base_position_x) From c08cfd68faeba9830a279c63bd5f71e665fe8d85 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 09:51:53 -0700 Subject: [PATCH 13/44] Fix a typo --- ros2/deep_perception.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros2/deep_perception.md b/ros2/deep_perception.md index 5018635..1dd6f28 100644 --- a/ros2/deep_perception.md +++ b/ros2/deep_perception.md @@ -134,7 +134,7 @@ ros2 launch stretch_deep_perception stretch_detect_faces.launch.py ![detect_faces](https://user-images.githubusercontent.com/97639181/196327737-7091cd61-f79a-4ff0-a291-039ab3f7127a.gif) ## Code Breakdown -Ain't that something! If you followed the breakdown in object detection, you'll find that the only change if you are looking to detect faces, facial landmarks or estimat head pose instead of detecting objects is in using a different deep learning model that does just that. For this, we will explore how to use the OpenVINO toolkit. Let's head to the detect_faces.py [node](https://github.com/hello-robot/stretch_ros2/blob/galactic/stretch_deep_perception/stretch_deep_perception/detect_faces.py) to begin. +Ain't that something! If you followed the breakdown in object detection, you'll find that the only change if you are looking to detect faces, facial landmarks or estimate head pose instead of detecting objects is in using a different deep learning model that does just that. For this, we will explore how to use the OpenVINO toolkit. Let's head to the detect_faces.py [node](https://github.com/hello-robot/stretch_ros2/blob/galactic/stretch_deep_perception/stretch_deep_perception/detect_faces.py) to begin. In the main() method, we see a similar structure as with the object detction node. We first create an instance of the detector using the HeadPoseEstimator class from the [head_estimator.py](https://github.com/hello-robot/stretch_ros2/blob/galactic/stretch_deep_perception/stretch_deep_perception/head_estimator.py) script to configure the deep learning models. Next, we pass this to an instance of the DetectionNode class from the detection_node.py script and call the main function. ```python From f57b92796e6ca571c0302f3f5b90f70100cd7231 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:13:30 -0700 Subject: [PATCH 14/44] Note with more information Added a little more information if the people haven't used iPython before on how to exit or how to experiment with this tutorials. --- getting_started/quick_start_guide_re1.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/getting_started/quick_start_guide_re1.md b/getting_started/quick_start_guide_re1.md index 94f51f7..435eb46 100644 --- a/getting_started/quick_start_guide_re1.md +++ b/getting_started/quick_start_guide_re1.md @@ -143,7 +143,7 @@ Once the robot has homed, let's write some quick test code: ```{.bash .shell-prompt} ipython ``` - + Now let's move the robot around using the Robot API. Try typing in these interactive commands at the iPython prompt: ```{.python .no-copy} @@ -177,7 +177,8 @@ robot.end_of_arm.move_to('stretch_gripper',-50) robot.stow() robot.stop() ``` - +!!! note + If you haven't use iPython before you can copy all the code and paste it in the terminal instead of line by line! Also if you want to exit the iPython prompt write exit() ## Change Credentials Finally, we recommend that you change the login credentials for the default user, hello-robot. From cfba23f2c38e460896f2a73ed89f7c2a86b7db9a Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:15:47 -0700 Subject: [PATCH 15/44] Added a note for more information of iPython Just the same as quick start guide for RE1, added a note with more information about how to use iPython. --- getting_started/quick_start_guide_re2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/getting_started/quick_start_guide_re2.md b/getting_started/quick_start_guide_re2.md index eb3e5ae..0dbf37d 100644 --- a/getting_started/quick_start_guide_re2.md +++ b/getting_started/quick_start_guide_re2.md @@ -194,6 +194,7 @@ robot.end_of_arm.move_to('stretch_gripper',-50) robot.stow() robot.stop() ``` +!!! note If you haven't use iPython before you can copy all the code and paste it in the terminal instead of line by line! Also if you want to exit the iPython prompt write exit() ## Change Credentials From 6e5c99a9af90fb0c70d9b8178f3ed651651b7aac Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:54:38 -0700 Subject: [PATCH 16/44] minor edit --- stretch_body/tutorial_robot_motion.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stretch_body/tutorial_robot_motion.md b/stretch_body/tutorial_robot_motion.md index ea46850..5236a00 100644 --- a/stretch_body/tutorial_robot_motion.md +++ b/stretch_body/tutorial_robot_motion.md @@ -4,6 +4,7 @@ As we've seen in previous tutorials, commanding robot motion is simple and strai ```python linenums="1" import stretch_body.robot +import time robot=stretch_body.robot.Robot() robot.startup() @@ -18,6 +19,7 @@ The absolute motion can be commanded by: ```python linenums="1" import stretch_body.robot +import time robot=stretch_body.robot.Robot() robot.startup() @@ -34,6 +36,7 @@ In the above examples, we executed a `time.sleep()` after `robot.push_command()` ```python linenums="1" import stretch_body.robot +import time robot=stretch_body.robot.Robot() robot.startup() @@ -130,6 +133,7 @@ As we see here, the `robot.push_command()` call is not required as the motion be ```python import stretch_body.robot +import time from stretch_body.hello_utils import deg_to_rad robot=stretch_body.robot.Robot() @@ -152,6 +156,7 @@ Similar to the stepper joints, the Dynamixel joints accept motion profile and mo ```python import stretch_body.robot +import time robot=stretch_body.robot.Robot() robot.startup() From 1ecd0904da5ef0b2e0b174467c8b34212f6a70a9 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 9 Aug 2023 11:54:26 -0700 Subject: [PATCH 17/44] Updated the robot status part Updated the robot status part making a difference on the subclasses that changed, meaning Prismatic Joint and Dynamixel adding there the corresponding codes and make a difference in the example of the arm class. --- stretch_body/tutorial_introduction.md | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/stretch_body/tutorial_introduction.md b/stretch_body/tutorial_introduction.md index e257191..5d93b66 100644 --- a/stretch_body/tutorial_introduction.md +++ b/stretch_body/tutorial_introduction.md @@ -95,24 +95,36 @@ Parameters may be named with a suffix to help describe the unit type. For exampl ### 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 several other Devices: +The Robot derives from the [Device class](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/device.py) and we have subclasses that derives from this Device class such as the [Prismatic Joint](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/prismatic_joint.py) and the [Dynamixel XL460](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/dynamixel_hello_XL430.py). It also encapsulates several 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) +**Device** * [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) + +**Prismatic Joint** +* [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) + +**Dynamixel XL460** +* [robot.head](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/head.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): +class Arm(PrismaticJoint): + def __init__(self,usb=None): + +``` +As we can see the arm class is part of the PrismaticJoint class but this is also part of the Device class as we can see here: + +```python +class PrismaticJoint(Device): + def __init__(self,name,usb=None): ... - self.status = {'pos': 0.0, 'vel': 0.0, 'force':0.0, \ - 'motor':self.motor.status,'timestamp_pc':0} + self.status = {'timestamp_pc':0,'pos':0.0, 'vel':0.0, \ + 'force':0.0,'motor':self.motor.status} ``` The Status dictionaries are automatically updated by a background thread of the Robot class at around 25Hz. The Status data can be accessed via the Robot class as below: @@ -189,4 +201,4 @@ robot.stop() The Dynamixel servos do not use the Hello Robot communication protocol. As such, the head, wrist, and gripper will move immediately upon issuing a motion command. ------ -
+ +
+ +### Image Display +The `Image` display when toggled creates a new rendering window that visualizes a [sensor_msgs/Image](http://docs.ros.org/en/lunar/api/sensor_msgs/html/msg/Image.html) messaged, */camera/color/image_raw*. This feature shows the image data from the camera; however, the image comes out sideways. Thus, you can select the */camera/color/image_raw_upright_view* from the **Image Topic** options to get an upright view of the image. + ++ +
+ +### DepthCloud Display +The `DepthCloud` display is visualized in the main RViz window. This display takes in the depth image and RGB image provided by RealSense to visualize and register a point cloud. + ++ +
+ +## Deep Perception +Hello Robot also has a ROS package that uses deep learning models for various detection demos. A link to the tutorials to try and run this models is provided: [stretch_deep_perception](https://docs.hello-robot.com/0.2/stretch-tutorials/ros2/deep_perception/). From dda63e747c4da3d3d2c67de7cdf5f8e60bc4fe58 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:10:25 -0700 Subject: [PATCH 33/44] Change teleop stretch with a node title for mobile base velocity control It's because it's note a teleop but just movement --- mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 2f831d4..65fdb12 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -130,7 +130,7 @@ nav: - FUNMAP: https://github.com/hello-robot/stretch_ros/tree/master/stretch_funmap - Gazebo Basics: ./ros1/gazebo_basics.md - Other Examples: - - Teleoperate Stretch with a Node: ./ros1/example_1.md + - Mobile Base Velocity Control: ./ros1/example_1.md - Filter Laser Scans: ./ros1/example_2.md - Mobile Base Collision Avoidance: ./ros1/example_3.md - Give Stretch a Balloon: ./ros1/example_4.md @@ -168,7 +168,7 @@ nav: # - Other Nav Stack Features: ./ros2/other_nav_features.md # - Gazebo Basics: ./ros2/gazebo_basics.md - Other Examples: - - Teleoperate Stretch with a Node: ./ros2/example_1.md + - Mobile Base Velocity Control: ./ros2/example_1.md - Filter Laser Scans: ./ros2/example_2.md - Mobile Base Collision Avoidance: ./ros2/example_3.md - Give Stretch a Balloon: ./ros2/example_4.md From b97e7173c91e99b3b5024b5593c466c4cb1cd329 Mon Sep 17 00:00:00 2001 From: hello-jesus <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:24:12 -0700 Subject: [PATCH 34/44] Updated the names and ways to run the commands, also quit the vertical image description because it doesn't appear. --- ros2/perception.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ros2/perception.md b/ros2/perception.md index 7f1569d..2519b63 100644 --- a/ros2/perception.md +++ b/ros2/perception.md @@ -2,7 +2,7 @@ The Stretch robot is equipped with the [Intel RealSense D435i camera](https://www.intelrealsense.com/depth-camera-d435i/), an essential component that allows the robot to measure and analyze the world around it. In this tutorial, we are going to showcase how to visualize the various topics published by the camera. -Begin by running the stretch `driver.launch` file. +Begin by running the stretch `driver.launch.py` file. ```{.bash .shell-prompt} ros2 launch stretch_core stretch_driver.launch.py @@ -17,7 +17,7 @@ ros2 launch stretch_core d435i_low_resolution.launch.py Within this tutorial package, there is an [RViz config file](https://github.com/hello-robot/stretch_tutorials/blob/noetic/rviz/perception_example.rviz) with the topics for perception already in the Display tree. You can visualize these topics and the robot model by running the command below in a new terminal. ```{.bash .shell-prompt} -ros2 run rviz2 rviz2 -d /home/hello-robot/ament_ws/src/stretch_tutorials/rviz/perception_example.rviz +ros2 run rviz2 rviz2 -d `ros2 pkg prefix --share stretch_tutorials`/rviz/perception_example.rviz ``` ### PointCloud2 Display @@ -31,7 +31,7 @@ For the `PointCloud2` display, a [sensor_msgs/pointCloud2](http://docs.ros.org/e ### Image Display -The `Image` display when toggled creates a new rendering window that visualizes a [sensor_msgs/Image](http://docs.ros.org/en/lunar/api/sensor_msgs/html/msg/Image.html) messaged, */camera/color/image_raw*. This feature shows the image data from the camera; however, the image comes out sideways. Thus, you can select the */camera/color/image_raw_upright_view* from the **Image Topic** options to get an upright view of the image. +The `Image` display when toggled creates a new rendering window that visualizes a [sensor_msgs/Image](http://docs.ros.org/en/lunar/api/sensor_msgs/html/msg/Image.html) messaged, */camera/color/image_raw*. This feature shows the image data from the camera; however, the image comes out sideways.@@ -45,4 +45,4 @@ The `DepthCloud` display is visualized in the main RViz window. This display tak
## Deep Perception -Hello Robot also has a ROS package that uses deep learning models for various detection demos. A link to the tutorials to try and run this models is provided: [stretch_deep_perception](https://docs.hello-robot.com/0.2/stretch-tutorials/ros2/deep_perception/). +Hello Robot also has a ROS package that uses deep learning models for various detection demos. A link to the tutorials is provided: [stretch_deep_perception](https://docs.hello-robot.com/0.2/stretch-tutorials/ros2/deep_perception/). From 2fb1270b2bb4345286d54a84cb86c419597ac1d7 Mon Sep 17 00:00:00 2001 From: Jesus Eduardo Rodriguez <141784078+hello-jesus@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:46:27 -0700 Subject: [PATCH 35/44] Modify the iPython note writing, it was not the correct way. --- getting_started/quick_start_guide_re2.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/getting_started/quick_start_guide_re2.md b/getting_started/quick_start_guide_re2.md index 0dbf37d..87851e9 100644 --- a/getting_started/quick_start_guide_re2.md +++ b/getting_started/quick_start_guide_re2.md @@ -194,7 +194,8 @@ robot.end_of_arm.move_to('stretch_gripper',-50) robot.stow() robot.stop() ``` -!!! note If you haven't use iPython before you can copy all the code and paste it in the terminal instead of line by line! Also if you want to exit the iPython prompt write exit() +!!! note + If you haven't use iPython before you can copy all the code and paste it in the terminal instead of line by line! Also if you want to exit the iPython prompt write exit() ## Change Credentials From 67d598ea77ea9356d36d0d3653c8f67be54d9c96 Mon Sep 17 00:00:00 2001 From: Jesus Eduardo Rodriguez <141784078+hello-jesus@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:53:23 -0700 Subject: [PATCH 36/44] Combine both initial notes, I think is better to have 1 with all the information. --- ros2/follow_joint_trajectory.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ros2/follow_joint_trajectory.md b/ros2/follow_joint_trajectory.md index 5897f04..ad474d8 100644 --- a/ros2/follow_joint_trajectory.md +++ b/ros2/follow_joint_trajectory.md @@ -1,9 +1,6 @@ ## FollowJointTrajectory Commands !!! note - ROS 2 tutorials are still under active development. - -!!! note 2 - For this exercise you'll need to have Ubuntu 22.04 and ROS Iron for it to work completly. + ROS 2 tutorials are still under active development. For this exercise you'll need to have Ubuntu 22.04 and ROS Iron for it to work completly. Stretch driver offers a [`FollowJointTrajectory`](http://docs.ros.org/en/api/control_msgs/html/action/FollowJointTrajectory.html) action service for its arm. Within this tutorial, we will have a simple FollowJointTrajectory command sent to a Stretch robot to execute. And just as the past practice, it's preferable to have the stretch driver in trajectory mode. From b25e889ced2e9601db077e9164f52f211f618946 Mon Sep 17 00:00:00 2001 From: Jesus Eduardo Rodriguez <141784078+hello-jesus@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:18:48 -0700 Subject: [PATCH 37/44] Fix the 3 GIFs that weren't showing adding them from the ROS1 tutorials --- ros2/example_10.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ros2/example_10.md b/ros2/example_10.md index 92659ee..576b37b 100644 --- a/ros2/example_10.md +++ b/ros2/example_10.md @@ -27,7 +27,7 @@ ros2 run stretch_ros_tutorials tf_broadcaster The GIF below visualizes what happens when running the previous node.- +
**OPTIONAL**: If you would like to see how the static frames update while the robot is in motion, run the stow command node and observe the tf frames in RViz. @@ -35,9 +35,8 @@ The GIF below visualizes what happens when running the previous node. ```{.bash .shell-prompt} ros2 run stretch_ros_tutorials stow_command ``` -- +
### The Code @@ -247,7 +246,7 @@ rotation: ```- +
### The Code From e28dea9e8b4ff777c7200f444d182fb9690e2657 Mon Sep 17 00:00:00 2001 From: Jesus Eduardo Rodriguez <141784078+hello-jesus@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:40:04 -0700 Subject: [PATCH 38/44] Commented the MoveIt2 tutorials from the README file (overview in the documentation) --- ros2/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ros2/README.md b/ros2/README.md index f02c104..f3e81aa 100644 --- a/ros2/README.md +++ b/ros2/README.md @@ -18,10 +18,10 @@ This tutorial track is for users looking to get familiar with programming Stretc | 2 | [Follow Joint Trajectory Commands](follow_joint_trajectory.md) | Control joints using joint trajectory server. | | 3 | [Internal State of Stretch](internal_state_of_stretch.md) | Monitor the joint states of Stretch. | | 4 | [RViz Basics](rviz_basics.md) | Visualize topics in Stretch. | -| 5 | [MoveIt2 Basics](moveit_basics.md) | Motion planning and control for the arm using MoveIt. | +