session-control: add SessionControlCapable interface#259
session-control: add SessionControlCapable interface#259abhichothani42 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new public session-control interface in the hardware layer to allow a push-based source (e.g., keyboard/VR input) to emit high-level session intents to the runtime session orchestration.
Changes:
- Introduces
SessionControlEventto represent session-level control intents (start, stop-early, re-record, stop session). - Adds
SessionControlCapableinterface with callback registration plusstart()/stop()lifecycle for event production.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
54ceb89 to
f087cb0
Compare
fd24c80 to
4dc5808
Compare
shantanuparab-tr
left a comment
There was a problem hiding this comment.
The interface is header-only with nothing compiling it yet, so the "tested on hardware" box doesn't hold. Uncheck it.
shantanuparab-tr
left a comment
There was a problem hiding this comment.
- The disconnect signal is supposed to fire only once. Right now each component has to get that right on its own. Can the base class guarantee it instead?
- Please note which thread the callbacks run on, and that
stop()finishes the worker before the callbacks go away. Also,kStartmeans different things at different points, so it is worth explaining at the definition. The design itself is good, keep it small.- This is just an interface with nothing using it yet, so "tested on hardware" cannot be true here. Worth unchecking.
| virtual ~SessionControlCapable() = default; | ||
|
|
||
| /** | ||
| * @brief Install the event and disconnect callbacks. |
There was a problem hiding this comment.
These functions are only safe to call from the main loop. This new design calls in from a separate thread, so the header should say clearly what a callback is allowed to call. Otherwise someone will call stop_episode() from the wrong place and cause a clash.
There was a problem hiding this comment.
Added, the header now spells out that callbacks run on the source's thread and must not call the SessionManager episode methods directly
shantanuparab-tr
left a comment
There was a problem hiding this comment.
changes requested
shantanuparab-tr
left a comment
There was a problem hiding this comment.
https://chat.google.com/room/AAQA0xpz-dM/TWmxsM3rgN0/TWmxsM3rgN0?cls=10
Check this for a suggestion of the session control rework
f087cb0 to
a1887fa
Compare
|
"The disconnect signal is supposed to fire only once. Right now each component has to get that right on its own. Can the base class guarantee it instead?" Please note which thread the callbacks run on, and that stop() finishes the worker before the callbacks go away. Also, kStart means different things at different points, so it is worth explaining at the definition. -> Unchecked Tested on hardware About session control rework |
Add a push-based contract for hardware that drives SessionManager state transitions (start, stop-early, re-record, stop-session). - SessionControlEvent enum: semantic intents, not raw inputs. kStart means "advance" and its effect is resolved by SessionManager based on the current phase (idle/recording/resetting). - SessionControlCapable mixin: set_callbacks(on_event, on_disconnect), start(), stop(). The source owns its own threading and keeps callbacks cheap; disconnect is a one-shot end-of-session signal. Header-only interface with no dependencies. The VR session-control component (later in the stack) and the keyboard source implement it.
d072bda to
efc7944
Compare
a1887fa to
3e45218
Compare

Summary
Adds a push-based contract for hardware that drives
SessionManagerstate transitions (start, stop-early, re-record, stop-session). The VR session-control component (later in the stack) and the keyboard source implement it.Changes
SessionControlEventenum: semantic intents, not raw inputs.kStartmeans "advance" — its effect (begin / stop-and-advance / skip-reset) is resolved by the host's event handler based on the current session phase.SessionControlCapablemixin:set_callbacks(on_event, on_disconnect),start(),stop(). The source owns its own threading and keeps callbacks cheap; disconnect is a one-shot end-of-session signal.Test Plan
make build)make test)pre-commit run --all-files)Breaking Changes
None.
Related Issues
N/A — part of the VR teleoperation feature stack.