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.

409 lines
14 KiB

  1. # Command Line Tools
  2. This tutorial covers the command line tools included in the Stretch CLI. For a primer on using CLIs and the terminal, see [The Basics](basics.md#terminal) tutorial. The Stretch CLI is split among Stretch's Python packages. They are:
  3. - Stretch Body - Tools that perform common tasks that are useful when developing with Stretch.
  4. - Stretch PyFUNMAP - Tools that explore the capabilities of PyFUNMAP.
  5. - Stretch Diagnostics - Tools for diagnosing issues with your robot.
  6. - Stretch URDF - Tools for working with Stretch's URDFs.
  7. - Stretch Factory - Tools used at Hello Robot during the robot's bring-up.
  8. ## Stretch Body Tools
  9. These tools perform common tasks that are useful when working with Stretch (e.g. homing routine, joint jogging, etc.).
  10. ### `stretch_robot_system_check.py`
  11. [Link to source code](https://github.com/hello-robot/stretch_body/blob/master/tools/bin/stretch_robot_system_check.py)
  12. The robot system check tool runs a series of tests, such as if each subsystem is online, and reports pass or fail. If everything passes in the report, the robot is ready to be used. You would use this tool everytime you use the robot. A passing output should look like:
  13. <div class="shell-prompt highlight"><pre><span></span><code tabindex="0">stretch_robot_system_check.py<span class="w"> </span>
  14. For<span class="w"> </span>use<span class="w"> </span>with<span class="w"> </span>S<span class="w"> </span>T<span class="w"> </span>R<span class="w"> </span>E<span class="w"> </span>T<span class="w"> </span>C<span class="w"> </span>H<span class="w"> </span><span class="o">(</span>R<span class="o">)</span><span class="w"> </span>RESEARCH<span class="w"> </span>EDITION<span class="w"> </span>from<span class="w"> </span>Hello<span class="w"> </span>Robot<span class="w"> </span>Inc.
  15. ---------------------------------------------------------------------
  16. ----<span class="w"> </span>Checking<span class="w"> </span>Devices<span class="w"> </span>----
  17. <span class="s">[Pass] : hello-wacc</span>
  18. <span class="s">[Pass] : hello-motor-left-wheel</span>
  19. <span class="s">[Pass] : hello-pimu</span>
  20. <span class="s">[Pass] : hello-lrf</span>
  21. <span class="s">[Pass] : hello-dynamixel-head</span>
  22. <span class="s">[Pass] : hello-dynamixel-wrist</span>
  23. <span class="s">[Pass] : hello-motor-arm</span>
  24. <span class="s">[Pass] : hello-motor-right-wheel</span>
  25. <span class="s">[Pass] : hello-motor-lift</span>
  26. <span class="s">[Pass] : hello-respeaker</span>
  27. ----<span class="w"> </span>Checking<span class="w"> </span>Pimu<span class="w"> </span>----
  28. <span class="s">[Pass] Voltage = 12.863744497299194</span>
  29. <span class="s">[Pass] Current = 2.67002009121435</span>
  30. <span class="s">[Pass] Temperature = 23.45359845039172</span>
  31. <span class="s">[Pass] Cliff-0 = 16.7066650390625</span>
  32. <span class="s">[Pass] Cliff-1 = 0.47015380859375</span>
  33. <span class="s">[Pass] Cliff-2 = -15.3138427734375</span>
  34. <span class="s">[Pass] Cliff-3 = -5.50537109375</span>
  35. <span class="s">[Pass] IMU AZ = -9.81534139672</span>
  36. <span class="s">[Pass] IMU Pitch = 0.0</span>
  37. <span class="s">[Pass] IMU Roll = 0.0</span>
  38. ----<span class="w"> </span>Checking<span class="w"> </span>EndOfArm<span class="w"> </span>----
  39. <span class="s">[Pass] Ping of: wrist_pitch</span>
  40. <span class="s">[Pass] Ping of: wrist_roll</span>
  41. <span class="s">[Pass] Ping of: wrist_yaw</span>
  42. <span class="s">[Pass] Homed: wrist_yaw</span>
  43. <span class="s">[Pass] Ping of: stretch_gripper</span>
  44. <span class="s">[Pass] Homed: stretch_gripper</span>
  45. ----<span class="w"> </span>Checking<span class="w"> </span>Head<span class="w"> </span>----
  46. <span class="s">[Pass] Ping of: head_pan</span>
  47. <span class="s">[Pass] Ping of: head_tilt</span>
  48. ----<span class="w"> </span>Checking<span class="w"> </span>Wacc<span class="w"> </span>----
  49. <span class="s">[Pass] AX = 9.628660202026367</span>
  50. ----<span class="w"> </span>Checking<span class="w"> </span>hello-motor-left-wheel<span class="w"> </span>----
  51. <span class="s">[Pass] Position = -3.035825729370117</span>
  52. ----<span class="w"> </span>Checking<span class="w"> </span>hello-motor-right-wheel<span class="w"> </span>----
  53. <span class="s">[Pass] Position = 2.784149408340454</span>
  54. ----<span class="w"> </span>Checking<span class="w"> </span>hello-motor-arm<span class="w"> </span>----
  55. <span class="s">[Pass] Position = 0.013962420634925365</span>
  56. <span class="s">[Pass] Position Homed = True</span>
  57. ----<span class="w"> </span>Checking<span class="w"> </span>hello-motor-lift<span class="w"> </span>----
  58. <span class="s">[Pass] Position = 31.580163955688477</span>
  59. <span class="s">[Pass] Position Homed = True</span>
  60. ----<span class="w"> </span>Checking<span class="w"> </span><span class="w">for</span><span class="w"> </span>Intel<span class="w"> </span>D435i<span class="w"> </span>----
  61. <span class="w">Bus 002 Device 002: ID 8086:0b3a Intel Corp. Intel(R) RealSense(TM) Depth Camera 435i</span>
  62. <span class="s">[Pass] : Device found</span>
  63. ----<span class="w"> </span>Checking<span class="w"> </span>Software<span class="w"> </span>----
  64. <span class="s">[Pass] Ubuntu 22.04 is ready</span>
  65. <span class="s">[Pass] All APT pkgs are setup correctly</span>
  66. <span class="s">[Pass] Firmware is up-to-date</span>
  67. <span class="k"> hello-pimu = </span><span class="m">v0.6.2p4</span>
  68. <span class="k"> hello-wacc = </span><span class="m">v0.5.1p3</span>
  69. <span class="k"> hello-motor-arm = </span><span class="m">v0.6.2p4</span>
  70. <span class="k"> hello-motor-lift = </span><span class="m">v0.6.3p4</span>
  71. <span class="k"> hello-motor-left-wheel = </span><span class="m">v0.6.2p4</span>
  72. <span class="k"> hello-motor-right-wheel = </span><span class="m">v0.6.2p4</span>
  73. <span class="s">[Pass] Python pkgs are up-to-date</span>
  74. <span class="k"> hello-robot-stretch-body = </span><span class="m">0.6.8</span>
  75. <span class="k"> hello-robot-stretch-body-tools = </span><span class="m">.6.3</span>
  76. <span class="k"> hello-robot-stretch-tool-share = </span><span class="m">0.2.8</span>
  77. <span class="k"> hello-robot-stretch-factory = </span><span class="m">0.4.13</span>
  78. <span class="k"> hello-robot-stretch-diagnostics = </span><span class="m">0.0.14</span>
  79. <span class="k"> hello-robot-stretch-urdf = </span><span class="m">0.0.18</span>
  80. <span class="s">[Pass] ROS2 Humble is ready</span>
  81. <span class="k"> Workspace at ~/ament_ws/src/stretch_ros2</span>
  82. </code></pre></div>
  83. In addition to checking the robot's hardware, this tool also prints out a software report. This includes which version of Stretch's Python, ROS2, etc. software your system has installed. Check out the [Keeping your Software Up-to-date](../../../software/updating_software/#identifying-your-current-software) guide for a how-to on using this report to keep your robot's software up-to-date.
  84. ### `stretch_robot_home.py`
  85. [Link to source code](https://github.com/hello-robot/stretch_body/blob/master/tools/bin/stretch_robot_home.py)
  86. This tool will start Stretch's homing procedure, where every joint's zero is found. Robots with relative encoders (vs absolute encoders) need a homing procedure when they power on. For Stretch, it's a 30-second procedure that must occur everytime the robot is powered on before you may send motion commands to or read correct joint positions from Stretch's joints. Normal output from this tool looks like:
  87. ```{.whatever .shell-prompt}
  88. stretch_robot_home.py
  89. For use with S T R E T C H (R) RESEARCH EDITION from Hello Robot Inc.
  90. ---------------------------------------------------------------------
  91. --------- Homing Head ----
  92. --------- Homing Lift ----
  93. Homing Lift...
  94. Hardstop detected at motor position (rad) 105.44721221923828
  95. Marking Lift position to 1.096683 (m)
  96. Marking Lift position to 0.000000 (m)
  97. [INFO] [robot_monitor]: Guarded contact lift
  98. Lift homing successful
  99. --------- Homing Arm ----
  100. Homing Arm...
  101. Hardstop detected at motor position (rad) -1.5079643726348877
  102. Marking Arm position to 0.000000 (m)
  103. [INFO] [robot_monitor]: Guarded contact arm
  104. [INFO] [robot_monitor]: Wrist single tap: 9
  105. Arm homing successful
  106. Moving to first hardstop...
  107. First hardstop contact at position (ticks): 4097
  108. -----
  109. Homing offset was 3671
  110. Marking current position to zero ticks
  111. Homing offset is now -427 (ticks)
  112. -----
  113. Current position (ticks): 24
  114. Moving to calibrated zero: (rad)
  115. [INFO] [robot_monitor]: Wrist single tap: 11
  116. [INFO] [robot_monitor]: Wrist single tap: 15
  117. [INFO] [robot_monitor]: Wrist single tap: 21
  118. [INFO] [robot_monitor]: Wrist single tap: 27
  119. [INFO] [robot_monitor]: Wrist single tap: 28
  120. [INFO] [robot_monitor]: Wrist single tap: 33
  121. [INFO] [robot_monitor]: Wrist single tap: 38
  122. [INFO] [robot_monitor]: Wrist single tap: 40
  123. Moving to first hardstop...
  124. First hardstop contact at position (ticks): -9
  125. -----
  126. Homing offset was 2234
  127. Marking current position to zero ticks
  128. Homing offset is now 2237 (ticks)
  129. -----
  130. Current position (ticks): 35
  131. Moving to calibrated zero: (rad)
  132. ```
  133. ### `stretch_robot_stow.py`
  134. Useful to return the robot arm to a safe position within the base footprint. Normal output from this tool looks like:
  135. ```{.whatever .shell-prompt}
  136. stretch_robot_stow.py
  137. For use with S T R E T C H (R) RESEARCH EDITION from Hello Robot Inc.
  138. ---------------------------------------------------------------------
  139. --------- Stowing Arm ----
  140. --------- Stowing EOA_Wrist_DW3_Tool_SG3 ----
  141. --------- Stowing Lift ----
  142. ```
  143. ### `stretch_robot_battery_check.py`
  144. A quick way to check the robot's battery voltage / current consumption. Normal output from this tool looks like:
  145. <div class="shell-prompt highlight"><pre><span></span><code>stretch_robot_battery_check.py
  146. For use with S T R E T C H (R) RESEARCH EDITION from Hello Robot Inc.
  147. ---------------------------------------------------------------------
  148. <span class="s">[Pass] Voltage with 12.791140079498291</span>
  149. <span class="s">[Pass] Current with 6.154119995023523</span>
  150. <span class="s">[Pass] CPU Temp with 45</span>
  151. </code></pre></div>
  152. ### `stretch_robot_keyboard_teleop.py`
  153. This tool enables jogging of the robot's joints from the keyboard.
  154. 5
  155. What's the difference between jog and `stretch_robot_keyboard_teleop.py`
  156. ### `stretch_xbox_controller_teleop.py`
  157. 6
  158. Useful to quickly test if a robot can achieve a task by manually teleoperating the robot
  159. ### `stretch_gamepad_teleop.py`
  160. 7
  161. ### `stretch_free_robot_process.py`
  162. 8
  163. ### `stretch_params.py`
  164. 9
  165. This tool prints the Stretch parameters to the console.
  166. ### `stretch_realsense_visualizer.py`
  167. 10
  168. This is a tool to test the Realsense D435i Camera. Pass the '-h' flag along with the command to see optional arguments.
  169. ### `stretch_rp_lidar_jog.py`
  170. 11
  171. ### `stretch_audio_test.py`
  172. 12
  173. This tool allows you to test the audio system.
  174. ### `stretch_respeaker_test.py`
  175. 13
  176. This tool allows you to record and playback audio via Respeaker.
  177. ### `stretch_<device>_home.py`
  178. 14
  179. - stretch_arm_home.py
  180. - stretch_gripper_home.py
  181. - stretch_lift_home.py
  182. - stretch_wrist_yaw_home.py
  183. ### `stretch_<device>_jog.py`
  184. 15
  185. - stretch_arm_jog.py
  186. - stretch_base_jog.py
  187. - stretch_gripper_jog.py
  188. - stretch_head_jog.py
  189. - stretch_lift_jog.py
  190. - stretch_pimu_jog.py
  191. - stretch_wacc_jog.py
  192. - stretch_wrist_yaw_jog.py
  193. ### `stretch_<device>_scope.py`
  194. 16
  195. - stretch_pimu_scope.py
  196. - This tool allows you to visualize Pimu (Power+IMU) board data with an oscilloscope. Pass the '-h' flag along with the command to see optional arguments.
  197. - stretch_wacc_scope.py
  198. - This is a tool to visualize Wacc (Wrist+Accel) board data with an oscilloscope. Pass the '-h' flag along with the command to see optional arguments.
  199. ### `stretch_about.py`
  200. 17
  201. This tool displays the model and serial number information as an image.
  202. ### `stretch_about_text.py`
  203. 18
  204. This tool displays the model and serial number information as text.
  205. ### `stretch_hardware_echo.py`
  206. Can we get rid of this?
  207. This tool echoes the robot and computer hardware details to the console.
  208. ### `stretch_trajectory_jog.py`
  209. 19
  210. ### `stretch_robot_dynamixel_reboot.py`
  211. 20
  212. Resets all Dynamixels in the robot, which might be necessary if a servo overheats during use and enters an error state.
  213. This tool reboots all Dynamixel servos on the robot.
  214. ### `stretch_robot_monitor.py`
  215. 21
  216. What does this do?
  217. This tool runs the Robot Monitor and prints to the console.
  218. ### `stretch_robot_urdf_visualizer.py`
  219. Can we replace this with the new Stretch URDF tools?
  220. This tool allows you to visualize robot URDF.
  221. ### `stretch_version.sh`
  222. Can we get rid of this?
  223. This script prints the version information for various software packages on the robot.
  224. ## Stretch PyFUNMAP Tools
  225. ### pyfunmap_head_scan_visualizer.py
  226. ## Stretch Diagnostics Tools
  227. ### `stretch_diagnostic_check.py`
  228. ## Stretch URDF Tools
  229. ### stretch_urdf_example.py
  230. ### stretch_urdf_viz.py
  231. ## Stretch Factory Tools
  232. These tools are used at Hello Robot during the robot's system bring-up. They generally interact with the lowest level interface of the hardware, making measurements and writing calibration data to the robot's calibration folder.
  233. !!! warning
  234. It is possible to cause bodily harm and/or break your robot with these tools. Used improperly, these tools might not respect joint torque and position limits. They may overwrite existing calibration data as well.
  235. ### RE1_migrate_contacts.py
  236. ### RE1_migrate_params.py
  237. ### REx_D435i_check.py
  238. ### REx_base_calibrate_imu_collect.py
  239. ### REx_base_calibrate_imu_process.py
  240. ### REx_base_calibrate_wheel_separation.py
  241. ### REx_calibrate_gravity_comp.py
  242. ### REx_calibrate_guarded_contact.py
  243. ### REx_calibrate_range.py
  244. ### REx_cliff_sensor_calibrate.py
  245. ### REx_comm_rates.py
  246. ### REx_discover_hello_devices.py
  247. ### REx_dmesg_monitor.py
  248. ### REx_dynamixel_id_change.py
  249. ### REx_dynamixel_id_scan.py
  250. ### REx_dynamixel_jog.py
  251. ### REx_dynamixel_reboot.py
  252. ### REx_dynamixel_set_baud.py
  253. ### REx_firmware_flash.py
  254. ### REx_firmware_updater.py
  255. ### REx_gamepad_configure.py
  256. ### REx_gripper_calibrate.py
  257. ### REx_hello_dynamixel_jog.py
  258. ### REx_stepper_calibration_YAML_to_flash.py
  259. ### REx_stepper_calibration_flash_to_YAML.py
  260. ### REx_stepper_calibration_run.py
  261. ### REx_stepper_ctrl_tuning.py
  262. ### REx_stepper_gains.py
  263. ### REx_stepper_jog.py
  264. ### REx_stepper_mechaduino_menu.py
  265. ### REx_trace_firmware.py
  266. ### REx_trace_robot.py
  267. ### REx_usb_reset.py
  268. ### REx_wacc_calibrate.py