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

Homing Button #98

Merged
merged 14 commits into from
Sep 25, 2024
Merged

Homing Button #98

merged 14 commits into from
Sep 25, 2024

Conversation

hello-binit
Copy link
Collaborator

@hello-binit hello-binit commented Aug 29, 2024

Description

This PR adds the ability for a user to "home" the robot through the web interface. Since some of Stretch's encoders are relative, there's a homing sequence to find zero for those joints when Stretch wakes up. This PR addresses some of #60; it provides a way to home the robot, but doesn't grey-out un-homed joints, or implement a pre-scan behavior to give the robot confidence that jogging the joints won't cause the robot to topple itself over (this burden is currently placed on the operator).

  • The added UI looks like this:

  • Mousing over the Question Mark shows additional information:

  • Clicking on the button shows a loader:

  • Once the homing sequence is complete, the UI disappears.

Testing procedure

  1. Start with an un-homed robot. You can power cycle the robot, or a quick way is to call stretch_robot_dynamixel_reboot.py.
  2. In your Ament workspace, go to Stretch ROS2 and switch to the bugfix/priority_mode_stall branch. If PR Fix priority modes stalling main loop execution stretch_ros2#162 is merged, you can git pull on the default branch.
  3. In your Ament workspace, go to Stretch Web Teleop and switch to the feature/homing branch.
  4. In the same repo, cherry-pick a numpy fix onto the homing branch. The command is git cherry-pick -n 6dfcf32e50175dff5cfabaa2c581486660f1d143, followed by git reset. If PR Remove numpy pin in Web Teleop #97 is merged, then this step may be unnecessary (depends on whether I've rebased this branch).
  5. colcon build the Ament workspace as usual
  6. Run the interface as usual

The homing button will appear. Click it and it should disappear after homing is complete.

Before opening a pull request

From the top-level of this repository, run:

  • pre-commit run --all-files

To merge

  • Squash & Merge

Additional Screenshots

These screenshots are of the first attempt at this UI. It has since been replaced.
Screenshot from 2024-08-29 19-19-41
Screenshot from 2024-08-29 19-19-52
Screenshot from 2024-08-29 19-20-20
Screenshot from 2024-08-29 19-20-54

@hello-binit hello-binit changed the title WIP: Homing Button Homing Button Aug 30, 2024
@hello-binit hello-binit marked this pull request as ready for review August 30, 2024 18:37
Copy link
Collaborator

@hello-vinitha hello-vinitha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the following conditions on 3030:

  • Home button does not appear when robot is homed. State is maintained on page refresh.
  • Home button appears when robot is not homed.

Suggestions for improvement:

  • Currently the Home button is implemented the way "global controls" (e.g. movement recorder) are. However, this can be misleading if one of the global controls are enabled (see image below). I recommend implementing the home button as an alert (see basic_components/Alert.tsx that appears over the header.
    image
  • There's a lot of information when you hover that a novice user will not understand. I don't think we need that information in the interface. However, if you would like to keep it I recommend rewriting it to be simpler and adding a question mark icon that you can hover over or click to see the tooltip. (Note: not all users use devices that can hover a cursor such as a stylus)

 - Remove rplidar from launch
 - Add homing button to static components
 - Show third global control panel in interface
 - Add HomeTheRobotCommand interface
 - Handle homeTheRobot commands in RemoteRobot and ROSLib's Robot
 - Start docs/tutorial on adding commands/components
 - Function provider defined
 - Function provider instantiated in index.tsx
 - Layout component defined
 - Layout component instantiated in Operator.tsx
 - Corresponding CSS defined
 - More docs
 - Register show func in Operator
 - Add isHomed and mode providers
 - Register func providers in index.tsx
 - Show loading in homing interface
 - Subscribe to /mode and /is_homed topics
 - Forward to remote robot
@hello-binit
Copy link
Collaborator Author

Hey @hello-vinitha, thanks for your suggestions! I've updated the UI to be based on the Alert dialog, instead of the operator panels. I think the resulting UX is better. Here's the flow:

  • The added UI looks like this:

  • Mousing over the Question Mark shows additional information:

  • Clicking on the button shows a loader:

  • Once the homing sequence is complete, the UI disappears.

@hello-binit
Copy link
Collaborator Author

@hello-vinitha friendly ping!

@hello-vinitha
Copy link
Collaborator

@hello-binit I made the following changes in the latest commit and verified that it works as expected on 3030:

  • I made the tooltip icon bigger added moved it to the end of the sentence so it's easier for a user to hover over it/click it.
  • I made the alignment in the home button horizontal to make better use of space and increase font size
    image
  • I simplified a tooltip text so that it's easier for a novice user to understand
    image
  • After pressing the home button, I removed the button and moved the loading icon next to the text
    image

Copy link
Collaborator

@hello-vinitha hello-vinitha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified PR works on 3030 using both a desktop and tablet.

@hello-binit
Copy link
Collaborator Author

Sweet, everything works on 3004. Merging!

@hello-binit hello-binit merged commit 015a0d2 into master Sep 25, 2024
1 check passed
@hello-binit hello-binit deleted the feature/homing branch September 25, 2024 12:37
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.

2 participants