Skip to content

Added dummy face detection node, integrated with BiteInitiation #37

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

Merged
merged 1 commit into from
May 12, 2023

Conversation

amalnanavati
Copy link
Contributor

@amalnanavati amalnanavati commented May 6, 2023

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

In service of #27 .

Added a dummy FaceDetection node that detects a face and mouth periodically (in practice, it detects a face every ~5 secs and detects an open mouth every ~10 secs). Integrated that with BiteInitiation.jsx so that it waits for the robot to detect a face before letting the user continue, and then lets the user continue with either an open mouth or button press. It stores the detected mouth center in global state so that MoveToMouth.jsx can access it.

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

First, I tested the face detection node by:

  • Turning it on and ensuring that it didn't publish to the face detection topics.
  • Toggling it on and ensuring that it does publish to both face detection topics.
  • Ensuring that faces and open mouths are detected at the expected frequencies.
  • Toggling it off and ensuring that it stops publishing to the face detection topics.
  • Toggling it on when its already on and off when its already off and ensuring there is no change in functionality.

Then, I tested the BiteInitiation page by:

  • Loading the page, ensuring it toggles face detection on, ensuring that it registers a detected face only when the right message is published, ensuring that it registers an open mouth and moves on only when the right message is published, ensuring that it toggles face detection off before moving on.
  • Ensuring that when the page is refreshed it toggles face detection off (before turning it back on again when the page re-loads).
  • Ensuring that the button moves it to the next state and toggles face detection off.

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.
  • [N/A] Thoroughly test your code's responsiveness by rendering it on different devices, browsers, etc.
  • [N/A] 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 requested a review from taylorkf May 6, 2023 08:44
@amalnanavati amalnanavati force-pushed the amaln/ros2_dummy_perception_nodes branch from 673e04b to e8e580f Compare May 6, 2023 09:07
@amalnanavati amalnanavati force-pushed the amaln/ros2_dummy_face_detection branch from 0299fbc to 1a9bc5c Compare May 6, 2023 09:08
@amalnanavati amalnanavati force-pushed the amaln/ros2_dummy_perception_nodes branch from e8e580f to 02e1d8d Compare May 8, 2023 01:17
@amalnanavati amalnanavati force-pushed the amaln/ros2_dummy_face_detection branch from 1a9bc5c to 8df79a9 Compare May 8, 2023 01:20
@amalnanavati amalnanavati force-pushed the amaln/ros2_dummy_perception_nodes branch 2 times, most recently from 8c59c91 to 95014b1 Compare May 12, 2023 02:27
Base automatically changed from amaln/ros2_dummy_perception_nodes to main May 12, 2023 02:29
- implemented and tested the dummy ROS2 node
- integrated it with the web app
- implemented proper use of useRef and useCallback
- Added a debug continue button (e.g., if ROS is not running)
- added ability to unsubscribe from a topic
@amalnanavati amalnanavati force-pushed the amaln/ros2_dummy_face_detection branch from b173099 to 84cf8f2 Compare May 12, 2023 02:48
@amalnanavati
Copy link
Contributor Author

amalnanavati commented May 12, 2023

NOTE: As it stands, the UI of the BiteInitiation page involves scrolling to get to the cancel and move above plate button. I left it like this for now, though, because we will be removing the staging location (Issue #45 ), which will get rid of that page altogether.

@amalnanavati amalnanavati merged commit 219688b into main May 12, 2023
@amalnanavati amalnanavati deleted the amaln/ros2_dummy_face_detection branch May 12, 2023 02:51
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