You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.4 KiB

  1. ## Teleoperating Stretch
  2. !!! note
  3. 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.
  4. ### Xbox Controller Teleoperating
  5. 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.
  6. ### Keyboard Teleoperating: Full Body
  7. For full-body teleoperation with the keyboard, you first need to run the `stretch_driver.launch.py` in a terminal.
  8. ```{.bash .shell-prompt}
  9. ros2 launch stretch_core stretch_driver.launch.py
  10. ```
  11. Then in a new terminal, type the following command
  12. ```{.bash .shell-prompt}
  13. ros2 run stretch_core keyboard_teleop
  14. ```
  15. Below are the keyboard commands that allow a user to control all of Stretch's joints.
  16. ```{.bash .no-copy}
  17. ---------- KEYBOARD TELEOP MENU -----------
  18. i HEAD UP
  19. j HEAD LEFT l HEAD RIGHT
  20. , HEAD DOWN
  21. 7 BASE ROTATE LEFT 9 BASE ROTATE RIGHT
  22. home page-up
  23. 8 LIFT UP
  24. up-arrow
  25. 4 BASE FORWARD 6 BASE BACK
  26. left-arrow right-arrow
  27. 2 LIFT DOWN
  28. down-arrow
  29. w ARM OUT
  30. a WRIST FORWARD d WRIST BACK
  31. x ARM IN
  32. 5 GRIPPER CLOSE
  33. 0 GRIPPER OPEN
  34. step size: b BIG, m MEDIUM, s SMALL
  35. q QUIT
  36. -------------------------------------------
  37. ```
  38. To stop the node from sending twist messages, type **Ctrl** + **c**.
  39. ### Keyboard Teleoperating: Mobile Base
  40. Begin by running the following command in your terminal:
  41. ```{.bash .shell-prompt}
  42. ros2 launch stretch_core stretch_driver.launch.py mode:=navigation
  43. ```
  44. 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*.
  45. ```{.bash .shell-prompt}
  46. ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=stretch/cmd_vel
  47. ```
  48. Below are the keyboard commands that allow a user to move Stretch's base.
  49. ```{.bash .no-copy}
  50. Reading from the keyboard and Publishing to Twist!
  51. ---------------------------
  52. Moving around:
  53. u i o
  54. j k l
  55. m , .
  56. For Holonomic mode (strafing), hold down the shift key:
  57. ---------------------------
  58. U I O
  59. J K L
  60. M < >
  61. t : up (+z)
  62. b : down (-z)
  63. anything else : stop
  64. q/z : increase/decrease max speeds by 10%
  65. w/x : increase/decrease only linear speed by 10%
  66. e/c : increase/decrease only angular speed by 10%
  67. CTRL-C to quit
  68. currently: speed 0.5 turn 1.0
  69. ```
  70. To stop the node from sending twist messages, type **Ctrl** + **c**.
  71. ### Create a node for Mobile Base Teleoperating
  72. To move Stretch's mobile base using a python script, please look at [example 1](example_1.md) for reference.