mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 02:00:35 +08:00
FlightTaskAuto: abstract class for mapping triplets to quadruple
FlightTaskAuto: add type that corresponds to triplet type FligthTaskAuto: set all setpoints if invalid in xy FlightTaskAuto: cast triplet type to WaypointType FlightTaskAutoLine: class for px4 legacy auto FlightTaskAutoLine: methods prototype FlightTaskAuto: change sp to wp (=Waypoint) add params FlightTaskAutoLine: follow waypoints along line based on flight state
This commit is contained in:
committed by
Lorenz Meier
parent
89a902524a
commit
6e62beb560
@@ -2,6 +2,7 @@
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
constexpr uint64_t FlightTask::_timeout;
|
||||
|
||||
/* First index of empty_setpoint corresponds to time-stamp and requires a finite number. */
|
||||
const vehicle_local_position_setpoint_s FlightTask::empty_setpoint = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, {NAN, NAN, NAN}};
|
||||
|
||||
@@ -59,6 +60,15 @@ bool FlightTask::_evaluateVehiclePosition()
|
||||
_position = matrix::Vector3f(&_sub_vehicle_local_position->get().x);
|
||||
_velocity = matrix::Vector3f(&_sub_vehicle_local_position->get().vx);
|
||||
_yaw = _sub_vehicle_local_position->get().yaw;
|
||||
|
||||
/* Check if reference has changed and update. */
|
||||
if (_sub_vehicle_local_position->get().ref_timestamp != _time_stamp_reference) {
|
||||
map_projection_init(&_reference_position, _sub_vehicle_local_position->get().ref_lat,
|
||||
_sub_vehicle_local_position->get().ref_lon);
|
||||
_reference_altitude = _sub_vehicle_local_position->get().ref_alt;
|
||||
_time_stamp_reference = _sub_vehicle_local_position->get().ref_timestamp;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user