We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb3a784 commit 6f93945Copy full SHA for 6f93945
ArduCopter/terrain.cpp
@@ -6,6 +6,15 @@ void Copter::terrain_update()
6
#if AP_TERRAIN_AVAILABLE
7
terrain.update();
8
9
+ // send terrain altitude to AHRS for optical flow when rangefinder is out of range
10
+ Location veh_loc;
11
+ if (ahrs.get_location(veh_loc)) {
12
+ float terrain_alt_amsl_m;
13
+ if (terrain.height_amsl(veh_loc, terrain_alt_amsl_m, true)) {
14
+ ahrs.writeTerrainAMSL(terrain_alt_amsl_m);
15
+ }
16
17
+
18
// tell the rangefinder our height, so it can go into power saving
19
// mode if available
20
#if AP_RANGEFINDER_ENABLED
0 commit comments