-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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: do not reboot on USB disconnect when armed #9664
commander: do not reboot on USB disconnect when armed #9664
Conversation
Using Of course it's possible to call |
It's a bit messy, but not that complicated. if (TRANSITION_DENIED != arming_state_transition(&status, battery, safety, vehicle_status_s::ARMING_STATE_REBOOT,
&armed, false, &mavlink_log_pub, &status_flags, arm_requirements, hrt_elapsed_time(&commander_boot_timestamp))
) {
// reboot
} You could wrap that mouthful in a The point is that no one other than the state machine should have ever been deciding this. As easy as it is to do the quick fix, at some point we have to start taking the first steps towards a proper safe fix before commander complexity gets completely out of hand. |
Ok, but in |
873234b
to
18dd8a2
Compare
@dagar, please review. If you believe |
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.
Looks correct to me, thanks!
@korigod could you rebase this and fix the conflicts so we can get it in? Thanks. |
4937a7f
to
692aea5
Compare
@julianoes, my colleagues will perform test flights in a few days to make sure everything is all right and then we can merge. Thanks! |
@korigod , I discussed this recently with @dagar , and the good point he brought up was the additional CPU load for each running mavlink instance, roughly 6%-8% per instance. Be sure to post a log that the CPU load can be scrutinized. For the general population, it won't matter as this only impacts post-arm, but that is also when it will be most important for CPU loads. You PR looks good to me. |
As per @korigod's request, I've performed some bench tests on a Pixracer-based drone. In all cases I've armed the drone manually, increased the throttle slightly, disconnected and reconnected the USB cable. In order to get the second MAVLink stream I've used the The results are as follows:
|
@korigod , would you rebase again? (It looks like it will pass CI once you rebase it.) |
Signed-off-by: Andrei Korigodski <[email protected]>
Signed-off-by: Andrei Korigodski <[email protected]>
Signed-off-by: Andrei Korigodski <[email protected]>
692aea5
to
b9dac93
Compare
@mcsauder, indeed, it passes the checks now. |
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.
Thanks everyone.
This commit fixes in-flight reboot on USB disconnect. Flying with USB can be discussed in issue #9663, but whether it's recommended or not it is possible on the default firmware so it looks reasonable to fix this unnecessary risk of crash because of in-flight reboot.