Skip to content

feat: add DM command safety layer - #104

Open
aviralmittal7150 wants to merge 2 commits into
PxA-Labs:mainfrom
aviralmittal7150:fix/dm-safety-layer
Open

aviralmittal7150 wants to merge 2 commits into
PxA-Labs:mainfrom
aviralmittal7150:fix/dm-safety-layer

Conversation

@aviralmittal7150

Copy link
Copy Markdown

Summary

  • add configurable DM stroke limits and park thresholds to both configuration paths
  • apply saturation/parking exactly once to final map and closed-loop commands, with status propagation through streaming and extended C APIs
  • reject non-finite commands/configuration safely and clear outputs on mapping failures
  • bump the public ABI version to 3.0.0 because the public config struct grew
  • add Python bindings, documentation, CPU/CUDA safety tests, and a CUDA host-fallback map that uses the CPU safety authority

Issues fixed

  • stream results previously reported OK after map safety had already clamped or parked commands
  • closed-loop updates could be limited before gain/accumulation and early convergence could return unsafe pre-existing commands
  • NaN/Inf command values bypassed the safety layer
  • CUDA clamped an uninitialized DM buffer and had no parking/status parity
  • rippra_dm_park was not reliably exported from the Windows shared library
  • the Python binding had no status-bearing saturation/map interface or ABI guard

Verification

  • clang -std=c11 -Wall -Wextra -Werror -I rippra/include -fsyntax-only on changed C sources/tests
  • focused shared-library C safety test: 43/43 passed
  • existing closed-loop C test: 10/10 passed
  • python3 -m py_compile rippra/bindings/rippra.py rippra/tests/test_dm_safety_bindings.py
  • python3 -m unittest rippra.tests.test_dm_safety_bindings (8 skipped because NumPy is not installed in this environment)
  • git diff --check

Environment limitation

CMake and nvcc are not installed in this workspace, so CMake/CUDA builds could not be executed locally. The CUDA test is registered only when CUDA is available and skips with return code 77 when no GPU is present.

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