Browse Source

Add stretch_driver docs todos

feature/stretch_core_docs
Binit Shah 1 year ago
parent
commit
0f1a554e56
2 changed files with 67 additions and 6 deletions
  1. +67
    -3
      stretch_core/API.md
  2. +0
    -3
      stretch_core/nodes/stretch_driver

+ 67
- 3
stretch_core/API.md View File

@ -1,4 +1,4 @@
# API for Stretch Core
# ROS API for Stretch Core
*stretch_core* includes everything needed to interface with the sensors and actuators on Stretch. The API for the launch files, nodes, etc. are documented in this file.
@ -52,19 +52,83 @@ This node communicates with the low-level Python library (stretch_body) to inter
#### Parameters
##### broadcast_odom_tf
##### mode (string)
TODO
##### broadcast_odom_tf (boolean)
If set to true, stretch_driver will publish an odom to base_link TF.
##### rate (float)
TODO
##### timeout (float)
TODO
##### fail_out_of_range_goal (boolean)
TODO
#### Published Topics
##### /stretch/joint_states (sensor_msgs/JointState)
TODO
##### /odom (nav_msgs/Odometry)
TODO
##### /battery ([sensor_msgs/BatteryState](https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/BatteryState.html))
This topic publishes Stretch's battery and charge status. Charging status, the `power_supply_status` field, is estimated by looking at changes in voltage readings over time, where plugging-in causes the voltage to jump up (i.e. status becomes 'charging') and pulling the plug out is detected by a voltage dip (i.e. status becomes 'discharging'). Estimation of charging status is most reliable when the charger is in SUPPLY mode (see [docs here](https://docs.hello-robot.com/0.2/stretch-hardware-guides/docs/battery_maintenance_guide_re1/#charger) for how to change charging modes). Charging status is unknown at boot of this node. Consequently, the `current` field is positive at boot of this node, regardless of whether the robot is charging/discharging. After a charging state change, there is a ~10 second timeout where state changes won't be detected. Additionally, outlier voltage readings can slip past the filters and incorrectly indicate a charging state change (albeit rarely). Finally, voltage readings are affected by power draw (e.g. the onboard computer starts a computationally taxing program), which can lead to incorrect indications of charging state change. Stretch RE2s have a hardware switch in the charging port that can detect when a plug has been plugged in, regardless of whether the plug is providing any power. Therefore, this node combines the previous voltage-based estimate with readings from this hardware switch to make better charging state estimates on RE2s (effectively eliminating the false positive case where a computational load draws more power).
Since a battery is always present on a Stretch system, we instead misuse the `present` field to indicate whether a plug is plugged in to the charging port (regardless of whether it's providing power) on RE2 robots. This field is always false on RE1s. The unmeasured fields (e.g. charge in Ah) return a NaN, or 'not a number'.
#### Published Services
##### /magnetometer_mobile_base (sensor_msgs/MagneticField)
TODO
##### /imu_mobile_base (sensor_msgs/Imu)
TODO
##### /imu_wrist (sensor_msgs/Imu)
TODO
##### /is_calibrated (std_msgs/Bool)
TODO
##### /mode (std_msgs/String)
TODO
#### Subscribed Topics
##### /stretch/cmd_vel (geometry_msgs/Twist)
#### Available Services
##### /switch_to_position_mode ([std_srvs/Trigger](https://docs.ros.org/en/noetic/api/std_srvs/html/srv/Trigger.html))
TODO
##### /switch_to_navigation_mode ([std_srvs/Trigger](https://docs.ros.org/en/noetic/api/std_srvs/html/srv/Trigger.html))
TODO
##### /stop_the_robot ([std_srvs/Trigger](https://docs.ros.org/en/noetic/api/std_srvs/html/srv/Trigger.html))
TODO
##### /runstop ([std_srvs/SetBool](https://docs.ros.org/en/noetic/api/std_srvs/html/srv/SetBool.html))
TODO
##### /calibrate_the_robot ([std_srvs/Trigger](https://docs.ros.org/en/noetic/api/std_srvs/html/srv/Trigger.html))

+ 0
- 3
stretch_core/nodes/stretch_driver View File

@ -480,9 +480,6 @@ class StretchDriverNode:
rospy.loginfo("{0} rate = {1} Hz".format(self.node_name, self.joint_state_rate))
rospy.loginfo("{0} timeout = {1} s".format(self.node_name, self.timeout))
self.use_fake_mechaduinos = rospy.get_param('~use_fake_mechaduinos', False)
rospy.loginfo("{0} use_fake_mechaduinos = {1}".format(rospy.get_name(), self.use_fake_mechaduinos))
self.base_frame_id = 'base_link'
rospy.loginfo("{0} base_frame_id = {1}".format(self.node_name, self.base_frame_id))
self.odom_frame_id = 'odom'

Loading…
Cancel
Save