Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
e979d24f
Commit
e979d24f
authored
6 years ago
by
Matthias Grob
Browse files
Options
Downloads
Patches
Plain Diff
commander: fix orbit failsafes for data link & rc loss
parent
5b5d5ac6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/commander/state_machine_helper.cpp
+18
-3
18 additions, 3 deletions
src/modules/commander/state_machine_helper.cpp
with
18 additions
and
3 deletions
src/modules/commander/state_machine_helper.cpp
+
18
−
3
View file @
e979d24f
...
...
@@ -588,16 +588,31 @@ bool set_nav_state(vehicle_status_s *status, actuator_armed_s *armed, commander_
break
;
case
commander_state_s
::
MAIN_STATE_ORBIT
:
/* require local position */
if
(
status
->
engine_failure
)
{
// failsafe: on engine failure
status
->
nav_state
=
vehicle_status_s
::
NAVIGATION_STATE_AUTO_LANDENGFAIL
;
}
else
if
(
is_armed
&&
check_invalid_pos_nav_state
(
status
,
old_failsafe
,
mavlink_log_pub
,
status_flags
,
false
,
false
))
{
// nothing to do - everything done in check_invalid_pos_nav_state
}
else
if
(
is_armed
&&
check_invalid_pos_nav_state
(
status
,
old_failsafe
,
mavlink_log_pub
,
status_flags
,
false
,
true
))
{
// failsafe: necessary position estimate lost (nothing to do - everything done in check_invalid_pos_nav_state)
}
else
if
(
status
->
data_link_lost
&&
data_link_loss_act_configured
&&
!
landed
&&
is_armed
)
{
// failsafe: just datalink is lost and we're in air
set_link_loss_nav_state
(
status
,
armed
,
status_flags
,
internal_state
,
data_link_loss_act
,
vehicle_status_s
::
NAVIGATION_STATE_AUTO_RTGS
);
enable_failsafe
(
status
,
old_failsafe
,
mavlink_log_pub
,
reason_no_datalink
);
}
else
if
(
rc_lost
&&
!
data_link_loss_act_configured
&&
is_armed
)
{
// failsafe: RC is lost, datalink loss is not set up and rc loss is not disabled
enable_failsafe
(
status
,
old_failsafe
,
mavlink_log_pub
,
reason_no_rc
);
set_link_loss_nav_state
(
status
,
armed
,
status_flags
,
internal_state
,
rc_loss_act
,
vehicle_status_s
::
NAVIGATION_STATE_AUTO_RCRECOVER
);
}
else
{
// no failsafe, RC is not mandatory for orbit
status
->
nav_state
=
vehicle_status_s
::
NAVIGATION_STATE_ORBIT
;
}
break
;
case
commander_state_s
::
MAIN_STATE_AUTO_TAKEOFF
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment