Skip to content
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

Improve offboard failsafe #18160

Merged
merged 8 commits into from Sep 8, 2021
Merged

Conversation

benjinne
Copy link
Contributor

@benjinne benjinne commented Aug 27, 2021

Describe problem solved by this pull request
Closes #16534 using 2nd proposal of adding a new parameter to allow for failsafe on RC only.

Describe your solution
Change the following:

  • When Both offboard and RC are lost, use OBL_ACT instead of OBL_RC_ACT
  • When only offboard is lost and RCL_EXCEPT is enabled use OBL_ACT instead of OBL_RC_ACT
  • When only RC is lost and RCL_EXCEPT is disabled, use NAV_RCL_ACT
    Untitled

Describe possible alternatives
The outcomes in the table were picked by my intuition, but can change if needed.

Test data / coverage
All scenarios in table tested and verified using jmavsim and offboard_control example in px4_ros_com.

@benjinne benjinne changed the title state_machine_helper: improve offboard failsafe Improve offboard failsafe Aug 27, 2021
@dagar
Copy link
Member

dagar commented Aug 28, 2021

The table is quite helpful, I'll review this.

Any input here @Jaeyoung-Lim @bperseghetti?

Copy link
Contributor

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented on small nitpicks for the MAVSDK tests part.

Other than that, I think your table make complete sense, and the implementation looks correct.
This is really well done and communicated, thanks a lot for the issue and PR!

test/mavsdk_tests/autopilot_tester.h Outdated Show resolved Hide resolved
test/mavsdk_tests/autopilot_tester.h Outdated Show resolved Hide resolved
@julianoes
Copy link
Contributor

The one CI error doesn't look related.
Thanks for the fixes @benjinne, that was quick.

@julianoes julianoes merged commit 06a91ec into PX4:master Sep 8, 2021
@MaEtUgR
Copy link
Member

MaEtUgR commented Sep 9, 2021

My mistake that the result wasn't the most appropriate in all cases:
https://github.com/PX4/PX4-Autopilot/pull/17785/files#diff-16343101332933c8491a2460368615ae5861531c321280d0468f7be6733b8661R752

@benjinne I fully agree with your intuitive resolution of failsafe cases. Thanks so much for the contribution of the correction, the tests and the very clear description. 👍 🙏

@DiegoHerrera1890
Copy link

Hello. Where shall I change these parameters?
Thank you.

@benjinne
Copy link
Contributor Author

In QGC there's a search option or they can be set in the mavlink console

@DiegoHerrera1890
Copy link

I'm running gazebo and PX4... So in QgroundControl shall I change those parameters?

@benjinne
Copy link
Contributor Author

Yes, or if you're running make px4_sitl gazebo in that terminal you can use the param command to get and set parameters like param set RCL_EXCEPT 4 to disable offboard RC lost checks

@DiegoHerrera1890
Copy link

thank you so much! it works!!

@MaEtUgR
Copy link
Member

MaEtUgR commented Nov 15, 2021

@DiegoHerrera1890 Just for reference you can also change them using the QGC GUI like this: https://docs.qgroundcontrol.com/master/en/SetupView/Parameters.html on a real vehicle as well as the simulation (take care to connect to the right instance).

@benjinne
Copy link
Contributor Author

@julianoes Hey, I'm trying to write MAVSDK tests for these cases, however there's no way to stop sending offboard setpoints abruptly. From what I see, only _offboard->stop() is available which changes the flight mode to hold and stops setpoints. Is there another way, or does the offboard MAVSDK plugin need another function?

@julianoes
Copy link
Contributor

@benjinne I guess we need to add some functionality to MAVSDK which allows you to have more fine grained control over when the setpoint should be sent.

I've created mavlink/MAVSDK#1630 to collect requirements around this, please add a note about the behavior that you would like to see there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offboard only RC lost failsafe
5 participants