mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 00:13:34 +08:00
kconfig: Add option to enable figure of eight support
This commit is contained in:
@@ -47,7 +47,6 @@
|
||||
#ifndef FIXEDWINGPOSITIONCONTROL_HPP_
|
||||
#define FIXEDWINGPOSITIONCONTROL_HPP_
|
||||
|
||||
#include "figure_eight/FigureEight.hpp"
|
||||
#include "launchdetection/LaunchDetector.h"
|
||||
#include "runway_takeoff/RunwayTakeoff.h"
|
||||
|
||||
@@ -95,9 +94,15 @@
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/wind.h>
|
||||
#include <uORB/topics/orbit_status.h>
|
||||
#ifdef CONFIG_FIGURE_OF_EIGHT
|
||||
#include <uORB/topics/figure_eight_status.h>
|
||||
#endif // CONFIG_FIGURE_OF_EIGHT
|
||||
#include <uORB/uORB.h>
|
||||
|
||||
#ifdef CONFIG_FIGURE_OF_EIGHT
|
||||
#include "figure_eight/FigureEight.hpp"
|
||||
#endif // CONFIG_FIGURE_OF_EIGHT
|
||||
|
||||
using namespace launchdetection;
|
||||
using namespace runwaytakeoff;
|
||||
using namespace time_literals;
|
||||
@@ -215,8 +220,10 @@ private:
|
||||
uORB::Publication<tecs_status_s> _tecs_status_pub{ORB_ID(tecs_status)};
|
||||
uORB::Publication<launch_detection_status_s> _launch_detection_status_pub{ORB_ID(launch_detection_status)};
|
||||
uORB::PublicationMulti<orbit_status_s> _orbit_status_pub{ORB_ID(orbit_status)};
|
||||
uORB::Publication<figure_eight_status_s> _figure_eight_status_pub{ORB_ID(figure_eight_status)};
|
||||
uORB::Publication<landing_gear_s> _landing_gear_pub{ORB_ID(landing_gear)};
|
||||
#ifdef CONFIG_FIGURE_OF_EIGHT
|
||||
uORB::Publication<figure_eight_status_s> _figure_eight_status_pub {ORB_ID(figure_eight_status)};
|
||||
#endif // CONFIG_FIGURE_OF_EIGHT
|
||||
uORB::Publication<landing_gear_s> _landing_gear_pub {ORB_ID(landing_gear)};
|
||||
uORB::Publication<normalized_unsigned_setpoint_s> _flaps_setpoint_pub{ORB_ID(flaps_setpoint)};
|
||||
uORB::Publication<normalized_unsigned_setpoint_s> _spoilers_setpoint_pub{ORB_ID(spoilers_setpoint)};
|
||||
|
||||
@@ -274,8 +281,10 @@ private:
|
||||
|
||||
bool _landed{true};
|
||||
|
||||
#ifdef CONFIG_FIGURE_OF_EIGHT
|
||||
/* Loitering */
|
||||
FigureEight _figure_eight;
|
||||
#endif // CONFIG_FIGURE_OF_EIGHT
|
||||
|
||||
// indicates whether the plane was in the air in the previous interation
|
||||
bool _was_in_air{false};
|
||||
@@ -590,6 +599,7 @@ private:
|
||||
void control_auto_loiter(const float control_interval, const Vector2d &curr_pos, const Vector2f &ground_speed,
|
||||
const position_setpoint_s &pos_sp_prev, const position_setpoint_s &pos_sp_curr, const position_setpoint_s &pos_sp_next);
|
||||
|
||||
#ifdef CONFIG_FIGURE_OF_EIGHT
|
||||
/**
|
||||
* Vehicle control for the autonomous figure 8 mode.
|
||||
*
|
||||
@@ -601,6 +611,7 @@ private:
|
||||
*/
|
||||
void controlAutoFigureEight(const float control_interval, const Vector2d &curr_pos, const Vector2f &ground_speed,
|
||||
const position_setpoint_s &pos_sp_prev, const position_setpoint_s &pos_sp_curr);
|
||||
#endif // CONFIG_FIGURE_OF_EIGHT
|
||||
|
||||
/**
|
||||
* @brief Controls a desired airspeed, bearing, and height rate.
|
||||
@@ -718,7 +729,9 @@ private:
|
||||
float airspeed_sp);
|
||||
|
||||
void publishOrbitStatus(const position_setpoint_s pos_sp);
|
||||
#ifdef CONFIG_FIGURE_OF_EIGHT
|
||||
void publishFigureEightStatus(const position_setpoint_s pos_sp);
|
||||
#endif // CONFIG_FIGURE_OF_EIGHT
|
||||
|
||||
SlewRate<float> _airspeed_slew_rate_controller;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user