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 a9a5d3f commit 04014c8Copy full SHA for 04014c8
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 so it can be used for optical flow
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