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
f81a1aed
Commit
f81a1aed
authored
7 years ago
by
Daniel Agar
Browse files
Options
Downloads
Patches
Plain Diff
commander state machine add global position check
parent
729c98d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+23
-5
23 additions, 5 deletions
src/modules/commander/state_machine_helper.cpp
with
23 additions
and
5 deletions
src/modules/commander/state_machine_helper.cpp
+
23
−
5
View file @
f81a1aed
...
...
@@ -1018,18 +1018,36 @@ bool prearm_check(orb_advert_t *mavlink_log_pub, const vehicle_status_flags_s &s
}
}
// mission required
if
((
arm_requirements
&
ARM_REQ_MISSION_BIT
)
&&
(
!
status_flags
.
condition_auto_mission_available
||
!
status_flags
.
condition_global_position_valid
))
{
// Arm Requirements: mission
if
(
arm_requirements
&
ARM_REQ_MISSION_BIT
)
{
if
(
!
status_flags
.
condition_auto_mission_available
)
{
prearm_ok
=
false
;
if
(
reportFailures
)
{
mavlink_log_critical
(
mavlink_log_pub
,
"ARMING DENIED: valid mission required"
);
}
}
if
(
!
status_flags
.
condition_global_position_valid
)
{
prearm_ok
=
false
;
if
(
reportFailures
)
{
mavlink_log_critical
(
mavlink_log_pub
,
"ARMING DENIED: global position required"
);
}
}
}
// Arm Requirements: global position
if
((
arm_requirements
&
ARM_REQ_GPS_BIT
)
&&
(
!
status_flags
.
condition_global_position_valid
))
{
prearm_ok
=
false
;
if
(
reportFailures
)
{
mavlink_log_critical
(
mavlink_log_pub
,
"ARMING DENIED:
valid miss
ion required"
);
mavlink_log_critical
(
mavlink_log_pub
,
"ARMING DENIED:
global posit
ion required"
);
}
}
//
a
rm authorization
check
//
A
rm
Requirements:
authorization
if
(
arm_requirements
&
ARM_REQ_ARM_AUTH_BIT
)
{
if
(
arm_auth_check
()
!=
vehicle_command_ack_s
::
VEHICLE_RESULT_ACCEPTED
)
{
// feedback provided in arm_auth_check
...
...
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