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

Commander datalinks lost failsafe handing #11550

Merged
merged 23 commits into from
Mar 12, 2019
Merged

Commander datalinks lost failsafe handing #11550

merged 23 commits into from
Mar 12, 2019

Conversation

cmic0
Copy link
Contributor

@cmic0 cmic0 commented Feb 27, 2019

This PR takes over the original one #11454.
In order to test the original PR some fixes have been added here.

Tests

  • data link loss & regain (GCS HEARTBEAT)
  • onboard computer link loss & regain (HEARTBEAT)
  • iridium loss & regain -> PENDING

The above points have been tested in SITL.
The fixes performed in this PR prevent mavlink messages flooding when you lose ONBOARD Controller:
screenshot from 2019-02-26 11-29-11

After the fix:
screenshot from 2019-02-26 11-46-33

NEXT STEPS

REMARKS
At the moment NAV_DLL_ACT and NAV_RCL_ACT are brought into commander_params.c but still has the old naming convention.

@dagar @MaEtUgR @mrivi FYI

@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 27, 2019

I now reviewed #11454, honstely it's a bit overwhelming how many changes are proposed at the same time. Part of it is probably duplicate because it's just what the other pr contains. Changing the base branch of the pr would probably help a lot.

Copy link
Contributor

@mrivi mrivi left a comment

Choose a reason for hiding this comment

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

I would propose to try to bring in this PR as it is now and handle #11456 in a separate PR.
As for #11457, it requires more discussion on the overall architecture so I would leave it for another PR.

} else {
mavlink_log_critical(&mavlink_log_pub, "ACTIVATING AVAILABLE HIGH LATENCY LINK");
if (_datalink_last_status_avoidance_system == telemetry_status_s::MAV_STATE_CRITICAL) {
mavlink_log_info(&mavlink_log_pub, "AVOIDANCE SYSTEM TIMEOUT");
Copy link
Contributor

@mrivi mrivi Feb 27, 2019

Choose a reason for hiding this comment

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

I would prefer to keep this mavlink_log_critical

Copy link
Contributor Author

@cmic0 cmic0 Feb 27, 2019

Choose a reason for hiding this comment

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

I have had an offline talk with @baumanta about avoidance timeouts..
We came to the conclusion that a time out is less important than an avoidance loss, thus I opted for removing the warning (which I find annoying in QGC in terms of UX), and replaced with an info.

Copy link
Contributor

Choose a reason for hiding this comment

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

the vehicle starts loitering when there is a timeout https://github.com/PX4/avoidance/blob/master/local_planner/src/nodes/local_planner_node_main.cpp#L75-L76

The pilot should be informed on why that's happening clearly. Since critical warning are also audible I would prefer to have it critical.

Copy link
Contributor

@baumanta baumanta Mar 4, 2019

Choose a reason for hiding this comment

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

I think it is ok it leave it as an info. The timeout state is something very temporary and in most cases only perists over a fraction of a second. The point in time when a timeout is triggered is also somewhat random, as it can be tuned through a parameter in the avoidance repo. And if the sensor data is not recovered in a few seconds the planner will send abort anyway and you will see that as a critical message.

@cmic0
Copy link
Contributor Author

cmic0 commented Feb 27, 2019

I would propose to try to bring in this PR as it is now and handle #11456 in a separate PR.
As for #11457, it requires more discussion on the overall architecture so I would leave it for another PR.

Totally agree, I think that this should be the starting point as @baumanta commits are required to tests onboard controller lost/avoidance lost.

The vehicle_status_flag message modification can be handled in next PRs and then #11456 can be adapted on top of that.

@cmic0
Copy link
Contributor Author

cmic0 commented Feb 27, 2019

@MaEtUgR Major changes in this PR are the same as #11454 performed by @dagar.
Since to continue testing #11454 we needed @baumanta commits and other minor fixes we thought it could make sense to bring all those small fixes together and create new PR.

@cmic0
Copy link
Contributor Author

cmic0 commented Feb 27, 2019

Rebased on latest upstream.

@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 28, 2019

make sense to bring all those small fixes together and create new PR

ok, just as a general hint it's easier to have iterations when making big changes. #11454 is already quite big to review and it's clear that you need your adjustments for testing but try to avoid loading more and more changes in the pr you like to get merged since it will take longer to be reviewed, tested, rebased and it all gets slower in the end.

@thomasgubler
Copy link
Contributor

@MaEtUgR we want to bring this in now. Do you have objections on the changes that claudio added on top of #11454

@cmic0 I see some open review comments from @MaEtUgR in #11454 ? Did you adress @MaEtUgR s reciew comments that he made in #11454 here? Please point that out to him by commenting to his comments with e.g. "fixed in [commit link]"

@cmic0
Copy link
Contributor Author

cmic0 commented Mar 5, 2019

@thomasgubler not yet, some of them are related on the general behavior (and not strictly related to the datalink failsafe handling) thus I preferred not to take actions.
I will start bringing in the quickest ones and discuss the others.

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

Reviewed, and remarked what I found.

boards/stm/32f4discovery/default.cmake Outdated Show resolved Hide resolved
msg/telemetry_status.msg Outdated Show resolved Hide resolved
src/modules/mavlink/mavlink_receiver.cpp Outdated Show resolved Hide resolved
src/modules/commander/state_machine_helper.cpp Outdated Show resolved Hide resolved
src/modules/commander/commander_params.c Outdated Show resolved Hide resolved
src/modules/commander/Commander.cpp Outdated Show resolved Hide resolved
src/modules/commander/Commander.cpp Outdated Show resolved Hide resolved
src/modules/commander/Commander.cpp Outdated Show resolved Hide resolved
src/modules/commander/Commander.hpp Outdated Show resolved Hide resolved
src/modules/mavlink/mavlink_receiver.cpp Outdated Show resolved Hide resolved
dagar and others added 18 commits March 7, 2019 17:53
Major changes:
- Prevent  "HIGH LATENCY DATA LINK LOST" message to appear if iridium telemetry is not used.
- Prevent "DATA LINK LOSS" mavlink messages flooding when QGC is open and then closed.
- Changed "DATA LINK REGAINED" condition (use _datalink_last_heartbeat_gcs insthead of _datalink_lost)



Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Added COM_ONB_LOSS_T and COM_ONB_REG_T parameters to specify thresholds that triggers "onboard link lost" and "onboard link regained".


Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
… if not enabled.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Since commander handles all telemetry_status the same there is no need to subscribe to multiple instances.


Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
@cmic0
Copy link
Contributor Author

cmic0 commented Mar 11, 2019

@bkueng I addressed all the points of your review; the code is ready to be merged.
Still haven't tested Iridiumbsd high latency telemetry by the way.

@MaEtUgR FYI: I managed to address some of your comments you made on #11454 in this commit 53d78c9

Since Timeout from onboard controller is something that does not require a lot of modifications there is no sense to having it parametrized.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
@bkueng bkueng changed the title [WIP] Commander datalinks lost failsafe handing Commander datalinks lost failsafe handing Mar 11, 2019
@bkueng bkueng requested a review from a team March 11, 2019 15:56
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

Tested and fixed some additional problems.
Thanks for everyone's work.
Merging this now to unblock further work.

@bkueng bkueng merged commit 6672284 into PX4:master Mar 12, 2019
@bkueng bkueng deleted the pr-heartbeat_cleanup branch March 12, 2019 10:24
@mrivi mrivi mentioned this pull request Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants