-
Notifications
You must be signed in to change notification settings - Fork 683
system/uorb: support uorb, include uorb wraper, unit test, uorb_listener, topic definition #1230
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
Merged
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
refer to: https://docs.px4.io/v1.12/en/middleware/uorb.html - orb_open: do real work for advertise() and subscribe(), if thre is no user, register topic first, then save meta in driver; only first user can successfully set buffer number. - orb_exists: check topic state, if topic only has subscribers, return "not exists". Signed-off-by: jihandong <jihandong@xiaomi.com>
This was referenced Jul 22, 2022
testcases: 1. test_single(): single instance, advertise then subscribe. 2. test_multi_inst10(): 10 instance, each 1 subscriber. 3. test_multi(): 2 instances, 2 advertisers, 2 subscribers. 4. test_multi_reversed(): same as test_multi(), but subsribe before advertise. 5. test_unadvertise(): unadvertise upper 4 advertisers. 6. test_multi2(): same as tset_multi(). but multi-thread. 7, test_queue(): topic queue_size = 16. Signed-off-by: jihandong <jihandong@xiaomi.com> Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Listener can scan device under ORB_SENSOR_PATH, subscribe them and cotinue printing messages by call their cb. '-T' can Continuously print updating objects, '-l' means only print once. Signed-off-by: jihandong <jihandong@xiaomi.com> Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
don't using subscriber to get state to avoid rpmsg access Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
…ce 0 1.orb_advertise, orb_advertise_queue for instance 0 2.orb_advertise_multi, orb_advertise__multi_queue for specified instance 3.If orb_advertise_multi_queue with instance is NULL, auto increase instance from existing base. Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
int func(int b)
{
int a;
while (1) {
...;
if (b != 0)
a = 1000 / b;
...;
}
}
if b == 0, then system crash in Xtensa arch, clang compiler
Signed-off-by: ligd <liguiding1@xiaomi.com>
orb_advertise_multi_queue_persist Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
And remove dead code. Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: jihandong <jihandong@xiaomi.com> Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: jihandong <jihandong@xiaomi.com>
|
|
||
| ret = ioctl(fd, SNIOC_REGISTER, (unsigned long)(uintptr_t)®info); | ||
| close(fd); | ||
| if (ret < 0 && ret != -EEXIST) |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check errno instead
| if (first_open) | ||
| { | ||
| ioctl(fd, SNIOC_SET_USERPRIV, (unsigned long)(uintptr_t)meta); | ||
| if (ret != -EEXIST) |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use errno instead
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
system/uorb: support uorb, include uorb wraper, unit test, uorb_listener, topic definition
refer to: https://docs.px4.io/v1.12/en/middleware/uorb.html
uORB comes from the open source flight control PX4, is the internal pub-sub messaging system, used for communication between modules.
About original uORB implementation:
About uORB shortcoming:
For the original design, vela has been enhanced:
Impact
Support uorb middleware
Testing
Vela CI