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

mavlink heartbeat stream: Fix system status always reporting FLIGHT_TERMINATION in HITL #21636

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

KonradRudin
Copy link
Contributor

Solved Problem

When performing a HITL simulation, the PX4 heartbeat always sends the system_status FLIGHT_TERMINATION, although the simulation works just fine and the simulated vehicle reacts to the commands. This is due to the fact, that in HITL the actuators are always locked. This flag is mapped to the system status flight termination.

Solution

  • In the mavlink Heartbeat stream only consider the armed.lockdown flag, if the system is not configured as HITL.

Changelog Entry

For release notes:

Bugfix Mavlink heartbeat stream: Fix system status always reporting FLIGHT_TERMINATION in HITL

Alternatives

We could also ...

Test coverage

  • SIH simulation, check mavlink inspector in AMC.

@KonradRudin KonradRudin requested a review from MaEtUgR May 24, 2023 14:47
…rmed.lockdown flag in HIL, since this is always enabled for HIL.
@KonradRudin KonradRudin force-pushed the fixSystemStatusHearbeatonHIL branch from b03b7d8 to f6790a8 Compare May 24, 2023 14:50
@dagar
Copy link
Member

dagar commented May 24, 2023

This seems kind of wrong, maybe we should to untangle this mess of flags instead of making it more convoluted?

#21129

@julianoes
Copy link
Contributor

julianoes commented May 30, 2023

I agree that we should fix this mess but it is very much correct that lockdown is true (on purpose) in HITL.

So this PR is good to be merged and we shouldn't block it trying to fix it more broadly.

@KonradRudin
Copy link
Contributor Author

@dagar How should we proceed? I like the PR you are mentioning but this does not solve the issue i try to fix here. As long as we use armed.lockdown to stop the motors in HITL we should not map this into the heartbeat system status in HITL. So i guess it is either redefining on how to stop the motors from turning in HITL, rethink which flags should be mapped to the system_status or use this small fix.

@junwoo091400 junwoo091400 added the Sim: HITL hardware in the loop simulation label Jun 1, 2023
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

I agree, let's go in steps. First fix this interface problem where HITL behaves completely different than a real vehicle and then the internal arm, kill, lockdown mess 👍

@MaEtUgR MaEtUgR merged commit 3303323 into main Jun 16, 2023
@MaEtUgR MaEtUgR deleted the fixSystemStatusHearbeatonHIL branch June 16, 2023 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sim: HITL hardware in the loop simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants