the condition to enter the rc mode switch evaluation was neglecting
the first connection of an RC when "no RC switch changed". this means
depending on the actual initialization values of _last_sp_man and the
desired mode preselected on the RC while connecting it would not get
evaluated.
When using QGC and/or the Dronecode SDK it was possible to get in a
state where the two mavlink instances were both publishing their last
heartbeat_time and cause commander to consistently toggle between
data link lost and regained. With this fix, we only ever look at the
very last heartbeat time and therefore seem to avoid this issue.
With this commit the use cases will be:
Success case:
- booting, no messages about OA, pre-arm check would fail if you try to arm and OA is not yet running
Fail case:
- if OA takes longer than timeout time defined in COM_ONB_BOOT_T, then an error message is triggered.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Since onboard controllers bootup times are hardware dependent, it makes sense to have the possibility to adapt timeout time according to the specific HW.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
This allows to perform pre-arm checks and prevent arming if obstacle avoidance is enabled but not yet running.
Added a print once flag to prevent excessive message spamming in QGC.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
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>
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>
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>
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>