QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TerrainQueryCoordinator Class Reference

Coordinates the terrain-query workflows attached to a Vehicle: More...

#include <TerrainQueryCoordinator.h>

+ Inheritance diagram for TerrainQueryCoordinator:
+ Collaboration diagram for TerrainQueryCoordinator:

Public Member Functions

 TerrainQueryCoordinator (Vehicle *vehicle)
 
void doSetHomeWithTerrain (const QGeoCoordinate &coord)
 
void updateAltAboveTerrain ()
 

Detailed Description

Coordinates the terrain-query workflows attached to a Vehicle:

  1. DO_SET_HOME: query terrain altitude for the target coord, then send MAV_CMD_DO_SET_HOME with a sanity-checked AMSL altitude.
  2. Altitude-above-terrain polling: on Vehicle coordinate updates, query terrain and update the vehicle's altitudeAboveTerr fact, throttled by time/distance.

Each workflow owns a single outstanding TerrainAtCoordinateQuery; starting a new request while one is in-flight disconnects the previous one (auto-deleted by TerrainQuery). Callbacks access the Vehicle to send commands or write facts.

Definition at line 23 of file TerrainQueryCoordinator.h.

Constructor & Destructor Documentation

◆ TerrainQueryCoordinator()

TerrainQueryCoordinator::TerrainQueryCoordinator ( Vehicle *  vehicle)
explicit

Definition at line 24 of file TerrainQueryCoordinator.cc.

Member Function Documentation

◆ doSetHomeWithTerrain()

void TerrainQueryCoordinator::doSetHomeWithTerrain ( const QGeoCoordinate &  coord)

DO_SET_HOME terrain-backed flow. Starts a terrain query; when it resolves, sends MAV_CMD_DO_SET_HOME if the coordinate and resolved altitude are valid.

Definition at line 31 of file TerrainQueryCoordinator.cc.

References TerrainAtCoordinateQuery::terrainDataReceived().

Referenced by Vehicle::doSetHome().

◆ updateAltAboveTerrain()

void TerrainQueryCoordinator::updateAltAboveTerrain ( )

Periodic altitude-above-terrain query. Connected to Vehicle::coordinateChanged. Throttled by time (500 ms min) and distance/altitude deltas (2 m / 0.5 m).

Definition at line 88 of file TerrainQueryCoordinator.cc.

References VehicleFactGroup::altitudeRelative(), Vehicle::coordinate(), Fact::rawValue(), and TerrainAtCoordinateQuery::terrainDataReceived().


The documentation for this class was generated from the following files: