-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
commander force offboard control update when first entering mode #12242
Conversation
@julianoes the current theory (untested) is that the offboard subscription within commander isn't updating the first time through before hitting the timeout. This is an optimization in |
e0e0fda
to
dc5e25d
Compare
@dagar this is hard to review. You did a refactor and presumably a functional change. |
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.
This fixes the test but it worries me that this force init is required.
Background: What all of this means is that an orb publication that advertises and publishes late at runtime (eg mavlink offboard) won't be subscribed to immediately. Now back in commander when switching to OFFBOARD mode we know an offboard_control_mode message is required. The change in this PR simply forces that initial subscription attempt immediately when first going into OFFBOARD. If the offboard timeout were slightly longer we would probably get away with it as is. Does that make sense? |
It was originally more of a refactor to enable the change, but it ended up simpler. I'll split it into multiple commits. |
dc5e25d
to
9820632
Compare
9820632
to
abc2fc7
Compare
Ok I suppose that makes sense.
That's the |
Yes, iterating a linked list of all publications and strcmp. https://github.com/PX4/Firmware/blob/ae6fed4f2915def3df6adadb850c559b050055fd/src/modules/uORB/uORBDeviceMaster.cpp#L444-L447 What I'd like to do is generate an ordinal number for each orb topic and then have a simple bitset of published topics, but we'll need to be careful on platforms like Snappy where those things need to be in sync. |
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.
Yes good to go from my side. Thanks!
Right, that's annoying. |
Squash or rebase? |
Working on a fix for #12241.