Can the Commander 3XL/Commander 2 follow terrain?
When under pilot control (Loiter mode or Altitude hold mode) a feature called "surface tracking" is enabled. This feature uses the built in rangefinder to maintain a consistent distance above the terrain. This is only active when the rangefinder is functioning, altitudes >10m, non-reflective surfaces, even water can prevent the rangefinder from working. When over sparse surfaces (i.e. plants) the rangefinder may return the range to the branch in front of it, or the ground beyond. This can cause erratic behavior. Similarly, flying over a sharp edge (i.e. car) will cause a sudden jump in the range. However, the rangefinder does work to maintain altitude over gently rolling terrain. Due to the low range and filtering that is present in the range finder it is possible that the aircraft will get behind reality by a short period of time. If flying too low and too fast this might cause a crash.
Automated missions are more complicated:
DGCS supports several methods of altitude control in automated missions. These can be selected by changing the altitude mode on the mission start item. Note that this can only be changed before any waypoints have been added.

Relative to Launch. This is most suitable for small missions over flat terrain. Commonly used for mapping.
AMSL. Each waypoint has its altitude specified as meters above sea level. Be really careful here. EVERY waypoint added must be at greater elevation than the terrain at that location. Get this wrong and your $14K VTOL ends up in the side of a mountain.
Calculated Above Terrain: Same as AMSL but dgcs looks up the DTED (digital terrain elevation data) and adds the user specified offset. Dgcs shows the actual AMSL altitude that will be sent. This also brings in all the compromises present when using DTED. More on this below.
AMSL and calculated above terrain can be very useful, but there are some caveats. If there is a hill or other obstacle between two points the aircraft might fly right into it. Dgcs provides an elevation profile to help identify conflicts, but again this profile is based on DTED, so take it with a grain of salt. An example is shown below:
This mission consists of 2 waypoints, each is 10m calculated above terrain. The altitude profile view shows the DTED based terrain elevation along the planned flight path (green). The orange/red lines show the anticipated aircraft altitude between waypoints. When an orange line becomes red and intersects the green profile, it means a collision is predicted. In this case, the problem can probably (remember don't trust DTED too much) be fixed with a waypoint in the middle. In addition to the extra waypoint increasing the altitude would be a good idea.
Get the bad mission here: https://draganfly-my.sharepoint.com/:u:/p/greg_wood/Ef5F4_HFu5JOjEqnRi-5CHIBPtyRaw-rMGDbsM5PwlRJ3w?e=bpvniE
Get the improved mission here: https://draganfly-my.sharepoint.com/:u:/p/greg_wood/EVatNJFAoaFAkjwVKD1h0wwBf1GrrfMkefS1mY16-LlRBw?e=S0ndgx
Terrain Frame:
In this mode the aircraft follows the terrain rather than relying on pre-programmed altitudes. It does this by either using the built in rangefinder or using DTED sent from dgcs to the aircraft. Set parameter WPNAV_RFND_USE to 1 use the rangefinder, 0 to use DTED.
When using the rangefinder, the altitude is limited to the maximum range of the rangefinder, only 10m. If the programmed altitude exceeds this, or the rangefinder loses signal (could happen due to drop in the terrain, unreflective surface, etc) the aircraft will enter RTL (return to launch) mode. Unless a special rangefinder is fitted, this mode is only useful for low speed and low altitude flights over gentle terrain. Since the rangefinder only looks down, the aircraft will quite happily fly into an obstruction (trees, cliff, structure, etc).
When using DTED, dgcs will stream terrain data to the aircraft. The aircraft will look up the terrain elevation at its current position and maintain altitude above this. If the aircraft fails to receive terrain information, it will enter RTL mode. DTED has a several limitations:
- Horizontal resolution is limited. By default, the horizontal resolution is 100m (TERRAIN_SPACING param), this means that variations that occur on a scale smaller than this (i.e. small hill) may not be represented in the data. It may be possible to get 30m resolution under certain circumstances.
- Vertical resolution is limited. Reported values can be in error by 10m or more.
- Data is provided by online sources, similar to google maps. This means that before operating in a given area the terrain data must be cached in dgcs. This can be accomplished by pre-planning missions when internet access is available. Terrain data typically loads as fast as map tiles. Alternatively data and be downloaded manually and placed on the autopilot SD card. https://terrain.ardupilot.org/
- Does not represent structures or vegetation.
DTED is generally useful only for higher altitude missions (>50m). When operating near tall structures or vegetation extra care is needed.
Both rangefinder and DTED are incapable of dealing with vertical surfaces (i.e. walls, trees, structures, cliffs). These must be anticipated in the planning process.
Altitude mode for grid flights can be specified in dgcs as well:
When "Calc Above Terrain" is specified dgcs will automatically insert waypoints along the grid to maintain the altitude within the tolerance specified. The tighter the tolerance, the more waypoints will be inserted.
Notice how the elevation profile gets more rugged near the middle of the mission. This is where the hill is. Also notice that a second waypoint (2) was added after takeoff to fly around the hill. This alternatively could have been added on the top of the hill to fly over. Without this waypoint there would have been a collision.
Best practices:
- Be aware of the terrain in the planned flight area.
- Use Calculated above terrain or terrain frame for long flights over rugged terrain
- fly extra high if uncertain
- Assume worst case errors on dted
- Assume aircraft is operating on data that is 5 seconds old
- Remember DTED and Elevation maps do NOT know where obstacles such as towers, power lines and human made structures are. You as the PIC are responsible to identify and avoid any structures and obstacles in the flight area.