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

Added FoodOnFork Detection to Web App #127

Merged
merged 9 commits into from
Mar 23, 2024
Merged

Conversation

amalnanavati
Copy link
Contributor

@amalnanavati amalnanavati commented Mar 22, 2024

Describe this pull request. Link to relevant GitHub issues, if any.

Joint with ada_feeding#169, this PR adds the web app capability to auto-continue once food has consistently been (not( detected on the fork for 3 seconds, both in BiteDone and BiteAcquisitionCheck, and auto-continue if so. The user has the option to decide whether to enable or disable this auto-continue. The 5 secs and probability threshold are currently hardcoded; customizing them from the settings menu will be another PR.

Explain how this pull request was tested, including but not limited to the below checkmarks.

Test with dummy nodes:

  • Start code as per usual: python3 src/ada_feeding/start.py --sim dummy
  • Bite Done:
    • Navigate to the Bite Done page. Verify that Auto-Continue is unchecked by default.
    • Open up the console to see when FoF is predicting 1 (food on fork).
    • While FoF is predicting 1, check the auto-continue box. Verify that the next time it predicts 0 (no FoF), a 5 second countdown starts. Once that countdown terminates, it should automatically move away and back above plate.
    • Go back to BiteDone. During the countdown at >1s, uncheck the box. Verify that the countdown stops and app does not move on.
    • While FoF is predicting 0, recheck the box. Verify that the countdown starts, but as soon as FoF switches to 1 (hopefully before the 5s countdown ends -- if not, wait longer before checking the box), the countdown stops and app does not move on.
    • While FoF is predicting 1, check the box. During the countdown at <=1s, uncheck the box. Verify that the countdown stops and app does not move on.
  • Bite Acquisition Check:
    • Navigate to the Bite Acquisition Check page. Verify that Auto-Continue is unchecked by default.
    • Open up the console to see when FoF is predicting 1 (food on fork).
    • While FoF is predicting 1, check the auto-continue box. Verify that it starts counting down and moves to the staging configuration.
    • Go back to BiteAcquisitionCheck. During the countdown at >1s, uncheck the box. Verify that the countdown stops and app does not move on.
    • While FoF is predicting 0, recheck the box. Verify that the countdown starts and it moves back above the plate.
    • From BiteDone, go back to the resting configuration. From there, verify it doesn't auto-continue.
    • Uncheck the box during a countdown for FoF and verify it stops the countdown and doesn't continue.
    • Uncheck the box during a countdown for no FoF and verify it stops the countdown and doesn't continue.
  • Close code as per usual: python3 src/ada_feeding/start.py --sim dummy -c

Test on the real robot:

  • Start code as per usual: python3 src/ada_feeding/start.py --sim dummy
  • Bite Done:
    • Navigate to BiteDone with real food on the fork. Verify that it doesn't move away.
    • Adversarially move your head around behind the fork, verify that it doesn't move away.
    • Eat the bite. While your mouth is on the fork, adversarially move it around. Verify it doesn't move away.
    • Take your mouth off of the fork but leave the bite on. Verify that it doesn't move away.
    • Eat the bite, but keep your mouth touching the fork tip. Verify that it does not move away.
    • Move your mouth back. Verify that it does move away.
    • Re-do a whole bite, eat the bite normally, verify that it works as expected.
    • Adversarially try many different actions, verify that it feels safe.
  • Bite Acquisition Check:
    • Navigate to BiteAcquisitionCheck with real food on the fork. Verify that it moves away.
    • Navigate to BiteAcquisitionCheck with no FoF. Verify that it moves back above the plate.
    • Navigate to BiteAcquisitionCheck with no FoF. During the countdown, touch the fork. Verify the countdown stops. Remove your finger before the new countdown ends. Verify that it doesn't auto-continue.
    • During a countdown, uncheck the box. Verify it doesn't continue.
    • Be adversarial. Verify it works.

Before creating a pull request

  • Format React code with npm run format
  • Format Python code by running python3 -m black . in the top-level of this repository
  • Thoroughly test your code's functionality, including unintended uses.
  • Fully test the responsiveness of the feature as documented in the Responsiveness Testing Guidelines. If you deviate from those guidelines, document above why you deviated and what you did instead.
  • Consider the user flow between states that this feature introduces, consider different situations that might occur for the user, and ensure that there is no way for the user to get stuck in a loop.

Before merging a pull request

  • Squash all your commits into one (or Squash and Merge)

@amalnanavati amalnanavati merged commit ccafe3c into main Mar 23, 2024
4 checks passed
@amalnanavati amalnanavati deleted the amaln/food_on_fork branch March 23, 2024 03:00
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