Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic update checking to command line tools #213

Merged
merged 18 commits into from
Dec 7, 2023

Conversation

hello-binit
Copy link
Contributor

@hello-binit hello-binit commented Nov 28, 2023

This PR introduces automatic checking for software updates to the Stretch Body command line tools. The aim is to enable the stretch_robot_system_check.py tool (commonly used by Stretch users) to inform the user when SDK-level updates are available (i.e. updates to the Python or ROS packages). The user doesn't need to do anything special.

The changes in this PR are primarily made to the stretch_robot_system_check.py and stretch_robot_home.py tools. Checking for updates requires an internet connection and can be slow. To avoid slowing down the system check, the checking for software updates happens in the background while the robot is homing. When the stretch_robot_home.py tool is called, a background process begins, checks for an internet connection, looks for updates online, and saves the result to "~/stretch_user/log/updates_logger". This usually takes <10 seconds on a good connection, while a homing procedure takes ~30 seconds. However, if the process takes longer than the homing procedure takes, the process is sent a SIGTERM, the results are not saved, and homing completes normally.

When the stretch_robot_system_check.py tool is called, it looks in the "~/stretch_user/log/updates_logger" directory for information about these updates and informs the user accordingly. Here's an example output from the tool:

Screenshot from 2023-11-28 02-51-28

The output informs you if your firmware, Python pkgs, or Stretch ROS git repo, are out-of-date.

Testing

Tested on an RE2, running Ubuntu 22.04, and the above SDK configuration.

TODOs

  • Test on Ubuntu 20.04
  • Look into importing stretch_*.version instead of using sh.pip.list to speed up printing (UPDATE: can't do since stretch_*.version wouldn't tell us the editable install location of the repo)
  • Instead of "ROS Humble is ready", it should be "ROS2 Humble is ready"
  • Check ROS_IP matches actual IPV4
  • Check stretch.urdf and robot.tool parameter match actual installed tool (edit: tackle in the future)
  • Include Stretch Body Tools Version in updates YAML

@hello-binit hello-binit marked this pull request as ready for review November 28, 2023 07:53
@hello-binit hello-binit merged commit 0b4faa2 into master Dec 7, 2023
@hello-binit hello-binit deleted the feature/check_updates branch December 7, 2023 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant