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

Allow users to set multiple parameter presets #131

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

amalnanavati
Copy link
Contributor

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

This PR, paired with ada_feeding#172, allows users to maintain multiple parameter configurations and switch between them.

  • On the main settings page, the user can choose which preset they want to use. If they want to change any parameters, they must be on a non-default preset.
  • On any page that allows changing settings (e.g., the BiteTransfer page), the user can change settings for that preset, and can revert settings for that preset to any of the other presets.

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

Pull this code and ada_feeding#172 code and rebuild.

  • Launch the code in mock: python3 src/ada_feeding/start.py --sim mock
  • In the web app, go to “Settings.” Verify that “default” is the current preset.
  • In the web app, click “Bite Transfer.” Verify it doesn’t let you do so on the “default” preset.
  • In the web app, create a new preset called “test1”. Verify that in the share directory (within the install folder of the workspace), ada_feeding_action_servers_custom.yaml shows “test1” under namespace_to_use and custom_namespaces.
  • In the web app, create a new preset called “test2.” Verify all of the above.
  • In the web app, switch to preset “default.” Verify it is reflected in the YAML file.
  • In the web app, click “Bite Transfer.” Verify it doesn’t let you do so.
  • In the web app, create a new preset called “test3.” Verify all of the above.
  • In the web app, click “Bite Transfer.” Verify it does let you do so, and it shows “test3” as the preset you’re currently changing.
  • In the web app, change “distance to mouth” to 5cm. Verify it is reflected in the YAML.
  • In the web app, go back to the main “Settings” page, change the preset to “test2,” then go into “Bite Transfer.” Verify the distance starts at 2.5cm, and then change the distance to 1cm. Verify it is reflected in the YAML.
  • In the web app, revert the distance back to each of the presets. For test1 it should go to 2.5, for test3 to 5, and for default to 2.5. Verify each of those are updated in the YAML.
  • In the web app, set “test2” to 1cm.
  • Add another preset test4, on the "Bite Transfer" settings page verify that the "set to..." dropdown menu is properly rendered.
  • Set "test2" to the current preset
  • Terminate the ada_feeding code, re-launch it, and verify all settings are still saved.
  • In the web app, leave the Settings menu. Go through until the robot is at the user’s mouth. Verify in RVIZ it is 1cm away.
  • In the web app, on the BiteDone page (with auto-continue unchecked), go into Settings and change it to “test3.” Then go back to staging and back to MoveToMouth, verify it goes 5cm away.
  • In the web app, do the same as above but setting it to “default,” verify it goes 2.5cm away.

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 fcbbb18 into main Apr 9, 2024
4 checks passed
@amalnanavati amalnanavati deleted the amaln/multiple_param_configs branch April 9, 2024 19:38
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