From ae2af3ebad7d1e9dc8586b5ded329b69dbce6fe8 Mon Sep 17 00:00:00 2001 From: Jesus Eduardo Rodriguez <141784078+hello-jesus@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:22:23 -0700 Subject: [PATCH] Update the basic tutorials for teleoperation changing the commands to ROS2 --- ros2/teleoperating_stretch.md | 40 ++++++----------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/ros2/teleoperating_stretch.md b/ros2/teleoperating_stretch.md index 579c204..526a3c5 100644 --- a/ros2/teleoperating_stretch.md +++ b/ros2/teleoperating_stretch.md @@ -3,23 +3,21 @@ !!! note Teleoperation support for Stretch in ROS 2 is under active development. Please reach out to us if you want to teleoperate Stretch in ROS 2. -Refer to the instructions below if you want to test this functionality in ROS 1. - ### Xbox Controller Teleoperating If you have not already had a look at the [Xbox Controller Teleoperation](https://docs.hello-robot.com/0.2/stretch-tutorials/getting_started/quick_start_guide_re2/#hello-world-demo) section in the Quick Start guide, now might be a good time to try it. ### Keyboard Teleoperating: Full Body -For full-body teleoperation with the keyboard, you first need to run the `stretch_driver.launch` in a terminal. +For full-body teleoperation with the keyboard, you first need to run the `stretch_driver.launch.py` in a terminal. ```{.bash .shell-prompt} -roslaunch stretch_core stretch_driver.launch +ros2 launch stretch_core stretch_driver.launch.py ``` Then in a new terminal, type the following command ```{.bash .shell-prompt} -rosrun stretch_core keyboard_teleop +ros2 run stretch_core keyboard_teleop ``` Below are the keyboard commands that allow a user to control all of Stretch's joints. @@ -66,14 +64,13 @@ To stop the node from sending twist messages, type **Ctrl** + **c**. Begin by running the following command in your terminal: ```{.bash .shell-prompt} -roslaunch stretch_core stretch_driver.launch +ros2 launch stretch_core stretch_driver.launch.py mode:=navigation ``` -To teleoperate a Stretch's mobile base with the keyboard, you first need to switch the mode to *nagivation* for the robot to receive *Twist* messages. This is done using a rosservice call in a new terminal. In the same terminal run the teleop_twist_keyboard node with the argument remapping the *cmd_vel* topic name to *stretch/cmd_vel*. +To teleoperate a Stretch's mobile base with the keyboard, you first need to switch the mode to *nagivation* for the robot to receive *Twist* messages. In comparison with ROS1 that we needed to use the rosservice command, we can do it in the same driver launch as you can see in the command you just input! Now in other terminal run the teleop_twist_keyboard node with the argument remapping the *cmd_vel* topic name to *stretch/cmd_vel*. ```{.bash .shell-prompt} -rosservice call /switch_to_navigation_mode -rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=stretch/cmd_vel +ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=stretch/cmd_vel ``` Below are the keyboard commands that allow a user to move Stretch's base. @@ -112,28 +109,3 @@ To stop the node from sending twist messages, type **Ctrl** + **c**. ### Create a node for Mobile Base Teleoperating To move Stretch's mobile base using a python script, please look at [example 1](example_1.md) for reference. - -