feat: add IMU integration with fall detection and recovery#2436
Open
Wanbogang wants to merge 3 commits intoOpenMind:mainfrom
Open
feat: add IMU integration with fall detection and recovery#2436Wanbogang wants to merge 3 commits intoOpenMind:mainfrom
Wanbogang wants to merge 3 commits intoOpenMind:mainfrom
Conversation
- Add IMUProvider singleton for accelerometer/gyroscope/orientation data - Add IMUInput plugin to read JSON data from serial IMU sensor - Add IMUFallDetector background task for continuous fall monitoring - Add FallRecovery action with serial connector for robot recovery - Add config/imu.json5 for IMU robot configuration - Support MPU6050, BNO055, and generic serial IMU sensors - 51 tests, 100% coverage
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Remove reset classmethod stub (handled by singleton decorator) - Add type: ignore for IMUProvider.reset() pyright attribute access - Add test_reset_class_method_callable test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full IMU (Inertial Measurement Unit) integration to OM1, enabling
robots to detect falls and impacts, then automatically execute recovery actions. #365
Components Added
Provider
IMUProvider— singleton that stores and distributes accelerometer,gyroscope, and orientation data to all OM1 components
Input
IMUInput— reads JSON data from serial IMU sensor (MPU6050, BNO055,or generic Arduino serial bridge)
Background
IMUFallDetector— continuously monitors IMU state and updatesContextProvider when fall or impact is detected
Action
FallRecovery— three supported actions:stand_up— sends stand up command and resets IMU alertsemergency_stop— sends emergency stop commandalert_operator— logs warning and notifies operatorConfig
config/imu.json5— ready-to-use robot config with IMU input,fall detector background, fall recovery + speak actions
Supported Sensors
Expected serial data format
{"ax": 0.1, "ay": 0.2, "az": 9.8, "gx": 0.0, "gy": 0.0, "gz": 0.0, "roll": 1.2, "pitch": 0.5, "yaw": 90.0}