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

feat(engine): pause protocol execution if front door is opened #9125

Closed
2 tasks
mattwelch opened this issue Dec 16, 2021 · 3 comments · Fixed by #11021
Closed
2 tasks

feat(engine): pause protocol execution if front door is opened #9125

mattwelch opened this issue Dec 16, 2021 · 3 comments · Fixed by #11021
Assignees
Labels
protocol-engine Ticket related to the Protocol Engine project and associated HTTP APIs robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).

Comments

@mattwelch
Copy link

mattwelch commented Dec 16, 2021

Overview

As a JSONv6 protocol operator with my robot's "pause execution if door is open" setting turned on, I'd like my protocol run to automatically pause if my robot's front door is opened.

Acceptance criteria

If the door pause setting is enable:

  • If the front-door is opened while a protocol run is ongoing, the engine and hardware API are paused
  • If the front-door is opened during protocol setup (i.e. LPC), the engine continues to process commands

Implementation notes

  • The behavior is currently implemented in the LegacyContextPlugin for PAPIv2 protocols
    • We can probably move at least aspects of that implementation over to the engine proper
  • We can check the command store's started_at field to know if the run has been started and if we should pause due to a door open
  • Care should be taken to make sure this interacts cleanly with refactor(engine): pause HardwareAPI when engine is paused #7923
    • This is also already a concern of LegacyContextPlugin
@mattwelch mattwelch added the robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). label Dec 16, 2021
@mattwelch mattwelch added the protocol-engine Ticket related to the Protocol Engine project and associated HTTP APIs label Jan 6, 2022
@mcous mcous added the WIP label Jun 17, 2022
@mcous mcous self-assigned this Jun 17, 2022
@mcous
Copy link
Contributor

mcous commented Jun 17, 2022

Ticket under investigation as potential 6.1.0 release requirement

@mcous
Copy link
Contributor

mcous commented Jun 17, 2022

This ticket is required for the 6.1.0 release. Updated tracking information accordingly

@mcous mcous changed the title Protocol Engine (PAPIv3): Pause when front door is opened feat(engine): pause protocol execution if front door is opened Jun 17, 2022
@mcous
Copy link
Contributor

mcous commented Jun 28, 2022

After #10882 is merged, this is my implementation proposal to bring this home:

  • Rename HardwareEventForwarder to DoorWatcher
  • Simplify HardwareEventAction to DoorChangeAction
    • We don't use any other hardware events
    • When we do in the future, I don't want to continue to use this callback interface; it's too dangerous with the ThreadManager and protocol child thread in place
  • On door change notification from the hardware control API:
    1. Check if queue status is running
    2. If it is, pause the hardware API
    3. Dispatch a DoorChangeAction with the door state
  • Remove remaining action handling from the LegacyContextPlugin, and perhaps remove the abstract handle_action method from the generic plugin interface, too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol-engine Ticket related to the Protocol Engine project and associated HTTP APIs robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants