diff --git a/ros2/README.md b/ros2/README.md index 04f5959..8496d23 100644 --- a/ros2/README.md +++ b/ros2/README.md @@ -14,11 +14,11 @@ This tutorial track is for users looking to become familiar with programming the | | Tutorial | Description | |--|---------------------------------------------------------------------------------|----------------------------------------------------| | 1 | [Getting Started](getting_started.md) | Setup instructions for ROS 2 on Stretch| -| 8 | [Follow Joint Trajectory Commands](follow_joint_trajectory.md) | Control joints using joint trajectory server. | -| 4 | [Internal State of Stretch](internal_state_of_stretch.md) | Monitor the joint states of Stretch. | -| 5 | [RViz Basics](rviz_basics.md) | Visualize topics in Stretch. | -| 7 | [MoveIt2 Basics](moveit_basics.md) | Motion planning and control for the arm using MoveIt. | -| 7 | [MoveIt2 with Rviz](moveit_rviz_demo.md) | Motion planning and control for the arm using MoveIt. | +| 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. | +| 6 | [MoveIt2 with Rviz](moveit_rviz_demo.md) | Motion planning and control for the arm using MoveIt. | | 7 | [MoveIt2 MoveGroup C++ API](moveit_movegroup_demo.md) | Motion planning and control for the arm using MoveIt. | +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. + +## 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 +ros2 launch stretch_core stretch_driver.launch.py mode:=manipulation +``` + +In the second terminal, launch the keyboard teleop node using: +```bash +ros2 run stretch_core keyboard_teleop +``` + +The following menu will be outputted to the terminal and you can press a key to move the corresponding joint on the robot. When you're ready to exit, press **Ctrl + C**. + +``` +[INFO] [1672878953.011453154] [keyboard_teleop]: keyboard_teleop started +[INFO] [1672878953.041154084] [keyboard_teleop]: Node keyboard_teleop connected to /stop_the_robot service. +---------- KEYBOARD TELEOP MENU ----------- + + i HEAD UP + j HEAD LEFT l HEAD RIGHT + , HEAD DOWN + + + 7 BASE ROTATE LEFT 9 BASE ROTATE RIGHT + home page-up + + + 8 LIFT UP + up-arrow + 4 BASE FORWARD 6 BASE BACK + left-arrow right-arrow + 2 LIFT DOWN + down-arrow + + + w ARM OUT + a WRIST FORWARD d WRIST BACK + x ARM IN + + + 5 GRIPPER CLOSE + 0 GRIPPER OPEN + + step size: b BIG, m MEDIUM, s SMALL + + q QUIT + +------------------------------------------- +``` + +ROS2 is setup! Move onto the next tutorial: [Follow Joint Trajectory Commands](follow_joint_trajectory.md). diff --git a/ros2/images/bashrc_setup_galactic.png b/ros2/images/bashrc_setup_galactic.png new file mode 100644 index 0000000..c468cc2 Binary files /dev/null and b/ros2/images/bashrc_setup_galactic.png differ diff --git a/ros2/images/bashrc_setup_noetic.png b/ros2/images/bashrc_setup_noetic.png new file mode 100644 index 0000000..3a92751 Binary files /dev/null and b/ros2/images/bashrc_setup_noetic.png differ