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
194f0c1d
Commit
194f0c1d
authored
8 years ago
by
Matthias Grob
Committed by
Lorenz Meier
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
land_detector: ground detection corrected comment and clarified condition
parent
9963cf53
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/land_detector/MulticopterLandDetector.cpp
+4
-3
4 additions, 3 deletions
src/modules/land_detector/MulticopterLandDetector.cpp
with
4 additions
and
3 deletions
src/modules/land_detector/MulticopterLandDetector.cpp
+
4
−
3
View file @
194f0c1d
...
...
@@ -158,7 +158,8 @@ bool MulticopterLandDetector::_get_ground_contact_state()
// Check if user commands throttle and if so, report no ground contact based on
// the user intent to take off (even if the system might physically still have
// ground contact at this point).
const
bool
manual_control_move_down
=
_has_manual_control_present
()
&&
_manual
.
z
<
0.05
f
;
const
bool
manual_control_idle
=
(
_has_manual_control_present
()
&&
_manual
.
z
<
0.05
f
);
const
bool
manual_control_idle_or_auto
=
manual_control_idle
||
!
_control_mode
.
flag_control_manual_enabled
;
// Widen acceptance thresholds for landed state right after arming
// so that motor spool-up and other effects do not trigger false negatives.
...
...
@@ -173,9 +174,9 @@ bool MulticopterLandDetector::_get_ground_contact_state()
// an accurate in-air indication.
bool
verticalMovement
=
fabsf
(
_vehicleLocalPosition
.
vz
)
>
_params
.
maxClimbRate
*
armThresholdFactor
;
// If pilots commands
fully
down or already below minimal thrust
because of auto land
and we do not move down we assume ground contact
// If pilots commands down or
in auto mode and we are
already below minimal thrust and we do not move down we assume ground contact
// TODO: we need an accelerometer based check for vertical movement for flying without GPS
if
((
(
manual_control_
move_down
||
!
_control_mode
.
flag_control_manual_enabled
)
&&
_has_minimal_thrust
()
)
&&
if
(
manual_control_
idle_or_auto
&&
_has_minimal_thrust
()
&&
(
!
verticalMovement
||
!
_has_position_lock
()))
{
return
true
;
}
...
...
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