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

Call AcquisitionReport service after food-on-fork question #121

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

egordon
Copy link
Contributor

@egordon egordon commented Jan 18, 2024

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

After any robot motion, the last reported action response is cached as part of the GlobalState.

After Bite Acquisition, this response is used to construct a call to AcquisitionReport, which updates the robot's online learning policy based on success or failure of the action.

Additionally, added a toast to the screen upon selecting whether to re-aquire or not.

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

Tested on real with the ros2-devel branch of https://github.com/personalrobotics/ada_feeding

No python code changes: black not run

No change to user flow, so that box is not checked.


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)

@egordon egordon requested a review from amalnanavati January 18, 2024 21:24
@egordon egordon self-assigned this Jan 18, 2024
Copy link
Contributor

@amalnanavati amalnanavati left a comment

Choose a reason for hiding this comment

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

LGTM. See comments for small discussion points.

/**
* Callback function for when the user indicates that the bite acquisition
* succeeded.
*/
const acquisitionSuccess = useCallback(() => {
console.log('acquisitionSuccess')
toast.info('Reporting Food Acquisition Success!')
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, does the toast persist across screens, or does it go away as soon as the screen shifts to Robot Motion? If the former, this is fine, but if the latter, I'd be concerned about this being a confusing UX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does persist across screens, in practice it's basically a quick overlay over the RobotMotion screen.

@@ -11,6 +11,7 @@
"axios": "^1.6.5",
"body-parser": "^1.20.2",
"bootstrap": "^5.1.3",
"caniuse-lite": "^1.0.30001579",
Copy link
Contributor

Choose a reason for hiding this comment

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

Where was this used? If unused, please remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't used in the code directly but appears to be used in the build process, as it quiets the warning about up to date browsers when running npm run build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Specifically, running the npx command that was present before during build installs this package.

@amalnanavati amalnanavati merged commit 90c95e2 into main Jan 19, 2024
4 checks passed
@amalnanavati amalnanavati deleted the egordon/acquisition_report branch January 19, 2024 20:02
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