-
Notifications
You must be signed in to change notification settings - Fork 686
system/uorb: Comprehensive wakeup mode refactoring and API improvements. #3389
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
Open
Otpvondoiats
wants to merge
5
commits into
apache:master
Choose a base branch
from
Otpvondoiats:lk-mmu
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Added nine-axis uncalibrated type topic. Signed-off-by: likun17 <[email protected]>
to align with Android's approach And add the corresponding "wakeup" API: orb_subscirbe_wakeup/orb_subscribe_multi_wakeup Signed-off-by: dongjiuzhu1 <[email protected]>
remove API orb_subscribe_multi_nonwakeup add API orb_subscribe_multi_wakeup Signed-off-by: dongjiuzhu1 <[email protected]>
As nonwakeup is default mode Signed-off-by: dongjiuzhu1 <[email protected]> Signed-off-by: likun17 <[email protected]>
we need to run latency test by command: unit_test latency_test, must add parameters: latency_test. Signed-off-by: dongjiuzhu1 <[email protected]>
xiaoxiang781216
approved these changes
Jan 30, 2026
Contributor
Author
|
depend on apache/nuttx#18266 |
Contributor
Author
|
local build |
Donny9
approved these changes
Jan 30, 2026
Contributor
|
Please stop including the modified files section. We can read the diff. |
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.
Note: Please adhere to Contributing Guidelines.
Summary
This patch series refactors the uORB subscription API by changing from negative "non-wakeup" semantics to positive "wakeup" semantics, aligning with Android's sensor framework approach. Additionally, it adds proper support for uncalibrated sensor types and improves test infrastructure.
Motivation
The original uORB API used confusing negative logic with "non-wakeup" mode as the default, making it counter-intuitive for developers. This series addresses multiple issues:
Confusing API semantics: "non-wakeup" mode (default) created double negatives in code
Android alignment: Android uses "wakeup" sensors with positive logic
Missing uncalibrated support: Nine-axis uncalibrated sensors lacked proper data structures
Test issues: Unit tests included latency tests that should be run separately
Key Changes
Changed from negative to positive logic for better clarity:
Before (confusing):
After (intuitive):
Rationale:
Non-wakeup is default (most power-efficient)
Positive logic eliminates double negatives
Clear distinction: orb_subscribe_multi() vs orb_subscribe_multi_wakeup()
Matches Android sensor HAL conventions
2. API Changes
Removed APIs:
Added APIs:
Updated Internal APIs:
Updated command-line interface to match new semantics:
Before:
After:
Default behavior remains non-wakeup (power-efficient), but option is now positive logic.
Added proper data structures and format strings for uncalibrated nine-axis sensors:
New Structures:
Updated Topic Definitions:
Removed automatic latency test:
Latency tests are timing-sensitive and should be run explicitly
Removed from default unit test execution to prevent false failures
Can still be run manually: unit_test latency_test
Improved test output:
Technical Details
Modified Files:
system/uorb/uORB/uORB.h - API declarations
system/uorb/uORB/uORB.c - Core implementation
listener.c - Command-line tool updates
system/uorb/sensor/accel.c - Uncalibrated accel support
system/uorb/sensor/gyro.c - Uncalibrated gyro support
system/uorb/sensor/mag.c - Uncalibrated mag support
system/uorb/test/unit_test.c - Test improvements
Code Changes Summary:
60 insertions, 58 deletions across 7 files
Mostly semantic renaming and structure corrections
No functional behavior changes (except latency test)
Impact
API Changes (Breaking)
Removed API:
orb_subscribe_multi_nonwakeup() - replaced by default behavior
Added API:
orb_subscribe_multi_wakeup() - explicit wakeup subscriptions
Migration Required:
Users
Clearer API: Positive "wakeup" logic easier to understand than negative "non-wakeup"
Better Defaults: Non-wakeup remains default (most power-efficient)
Android Compatible: Matches Android sensor HAL semantics
Proper Uncalibrated Support: Nine-axis uncalibrated sensors now have correct data structures
Applications
uorb_listener: Changed -u flag to -w flag (semantic flip)
Sensor Apps: Apps using uncalibrated sensors get proper bias data
Power Sensitive Apps: Clearer API makes power management intent explicit
Build Process
No impact on build process
Source-level compatibility broken (requires migration)
Binary compatibility maintained for non-breaking paths
Testing
Unit tests more reliable (latency test separated)
Better test output formatting
Explicit test invocation: unit_test vs unit_test latency_test
Testing