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
269d077f
Commit
269d077f
authored
5 years ago
by
Matthias Grob
Committed by
Roman Bapst
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ekf2: only check ground effect if it's configured
parent
f034d2da
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/ekf2/ekf2_main.cpp
+3
-2
3 additions, 2 deletions
src/modules/ekf2/ekf2_main.cpp
with
3 additions
and
2 deletions
src/modules/ekf2/ekf2_main.cpp
+
3
−
2
View file @
269d077f
...
@@ -1419,7 +1419,8 @@ void Ekf2::run()
...
@@ -1419,7 +1419,8 @@ void Ekf2::run()
_had_valid_terrain
=
lpos
.
dist_bottom_valid
;
_had_valid_terrain
=
lpos
.
dist_bottom_valid
;
}
}
if
(
vehicle_status
.
arming_state
==
vehicle_status_s
::
ARMING_STATE_ARMED
)
{
// only consider ground effect if compensation is configured and the vehicle is armed (props spinning)
if
(
_param_ekf2_gnd_eff_dz
.
get
()
>
0.0
f
&&
vehicle_status
.
arming_state
==
vehicle_status_s
::
ARMING_STATE_ARMED
)
{
// set ground effect flag if vehicle is closer than a specified distance to the ground
// set ground effect flag if vehicle is closer than a specified distance to the ground
if
(
lpos
.
dist_bottom_valid
)
{
if
(
lpos
.
dist_bottom_valid
)
{
_ekf
.
set_gnd_effect_flag
(
lpos
.
dist_bottom
<
_param_ekf2_gnd_max_hgt
.
get
());
_ekf
.
set_gnd_effect_flag
(
lpos
.
dist_bottom
<
_param_ekf2_gnd_max_hgt
.
get
());
...
@@ -1428,7 +1429,7 @@ void Ekf2::run()
...
@@ -1428,7 +1429,7 @@ void Ekf2::run()
// _had_valid_terrain is used to make sure that we don't fall back to using this option
// _had_valid_terrain is used to make sure that we don't fall back to using this option
// if we temporarily lose terrain data due to the distance sensor getting out of range
// if we temporarily lose terrain data due to the distance sensor getting out of range
}
else
if
(
vehicle_land_detected_updated
&&
_param_ekf2_gnd_eff_dz
.
get
()
>
0.0
f
&&
!
_had_valid_terrain
)
{
}
else
if
(
vehicle_land_detected_updated
&&
!
_had_valid_terrain
)
{
// update ground effect flag based on land detector state
// update ground effect flag based on land detector state
_ekf
.
set_gnd_effect_flag
(
vehicle_land_detected
.
in_ground_effect
);
_ekf
.
set_gnd_effect_flag
(
vehicle_land_detected
.
in_ground_effect
);
}
}
...
...
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