Skip to content

Handle joint delta safety stops without exiting - #23

Merged
kou merged 2 commits into
enactic:mainfrom
stevenaya:agent/safety-stop-behavior-draft
Sep 18, 2026
Merged

kou merged 2 commits into
enactic:mainfrom
stevenaya:agent/safety-stop-behavior-draft

Conversation

@stevenaya

@stevenaya stevenaya commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Return False and latch force-stop safety rejections while keeping the driver process alive; expose the reason through read-only safety_stop_reason.
  • Propagate rejection through interpolated/configured trajectories and start(). Failed startup leaves started=False and position commands blocked.
  • Warn when a latched fault skips the stop trajectory. A safety rejection during a normal stop trajectory still proceeds to motor disable.
  • Resynchronize the command baseline on start; document recovery and restore normal-stop coverage alongside fault/recovery tests.

Recovery and compatibility

Inspect and resolve the cause, then call stop() followed by start(). The latch blocks new targets; explicit stop() disables the motors. Holding behavior depends on the motor and communication state.

Method arguments and get_health()'s (motor_status, bus) return structure stay unchanged. Existing callers can ignore boolean results, and legacy trajectory hooks returning None remain supported. Configuration and CAN exceptions keep their existing behavior.

Feedback-freshness enforcement and Dora/UI status propagation are deferred. Current health diagnostics remain observational; startup can still read cached feedback. Dora integration is tracked separately in enactic/dora-openarm#35.

Timing and messages

Keep the 40 ms command-time cap to bound velocity-limited catch-up after scheduling pauses or command gaps. Normal 250 Hz operation still uses its actual approximately 4 ms interval. J1-J8 diagnostic numbering and the delta-limit type annotation are retained.

Related to #22.

Validation

  • 62 offline tests passed with mocked CAN hardware, including normal/fault stops, trajectory interruption, failed/successful startup, recovery, and legacy hooks.
  • Ruff lint/format and whitespace checks passed.
  • Hardware execution has not been tested.

@stevenaya
stevenaya force-pushed the agent/safety-stop-behavior-draft branch 2 times, most recently from df1cd5b to 3ad3b9b Compare September 4, 2026 14:25
kou pushed a commit that referenced this pull request Sep 8, 2026
## Summary
- align configured arm limits and numeric precision with the current
OpenArm model
- use the full J1/J2 range for the pedestal configuration while
retaining the cell-specific range
- update the gripper limit precision and position-limit tests

Follow-up PRs #27 and #23 have been rebased on top of this change.

## Testing
- `.venv/bin/pytest -q` (40 passed)
- `.venv/bin/ruff check .`

Co-authored-by: stevenaya <stevenaya@users.noreply.github.com>
@stevenaya
stevenaya force-pushed the agent/safety-stop-behavior-draft branch 2 times, most recently from b30e13d to a0bc4b5 Compare September 8, 2026 10:12
kou pushed a commit that referenced this pull request Sep 9, 2026
## Summary

- expose the wall-clock time captured immediately before dispatching the
latest accepted position target;
- publish the cached command and timestamp only after arm and gripper
dispatch calls succeed;
- keep an owned copy of the accepted target so caller-side mutations
cannot change driver state;
- invalidate dispatch metadata when a new start session begins.

## Why

Downstream nodes need a wall-clock dispatch marker to correlate the
command accepted by the driver with external observations. This is a
software dispatch timestamp, not motor acknowledgement or physical
motion time. The existing monotonic timestamp remains dedicated to
velocity limiting.

The boolean send result now belongs to draft PR #23, where safety
rejection introduces real `False` paths.

## Validation

- `pytest` (41 passed)
- `ruff check .`
- `ruff format --check .`

Co-authored-by: stevenaya <stevenaya@users.noreply.github.com>
@stevenaya
stevenaya force-pushed the agent/safety-stop-behavior-draft branch from a0bc4b5 to ad88a35 Compare September 16, 2026 19:14
@stevenaya
stevenaya marked this pull request as ready for review September 16, 2026 19:19
@stevenaya
stevenaya force-pushed the agent/safety-stop-behavior-draft branch from ad88a35 to b80a06b Compare September 17, 2026 06:14
@kou
kou merged commit 6670833 into enactic:main Sep 18, 2026
5 checks passed
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