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:
Dennis Mannhart
2018-01-12 17:27:36 +01:00
committed by Lorenz Meier
parent 89a902524a
commit 6e62beb560
11 changed files with 963 additions and 17 deletions
+10
View File
@@ -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 {