mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 00:51:35 +08:00
Rename AirspeedReferenceController to AirspeedDirectionController
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
+3
-3
@@ -31,17 +31,17 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "AirspeedReferenceController.hpp"
|
#include "AirspeedDirectionController.hpp"
|
||||||
#include <matrix/math.hpp>
|
#include <matrix/math.hpp>
|
||||||
#include <lib/mathlib/mathlib.h>
|
#include <lib/mathlib/mathlib.h>
|
||||||
|
|
||||||
using matrix::Vector2f;
|
using matrix::Vector2f;
|
||||||
AirspeedReferenceController::AirspeedReferenceController()
|
AirspeedDirectionController::AirspeedDirectionController()
|
||||||
{
|
{
|
||||||
// Constructor
|
// Constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
float AirspeedReferenceController::controlHeading(const float heading_sp, const float heading,
|
float AirspeedDirectionController::controlHeading(const float heading_sp, const float heading,
|
||||||
const float airspeed) const
|
const float airspeed) const
|
||||||
{
|
{
|
||||||
|
|
||||||
+6
-6
@@ -32,7 +32,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @file AirspeedRefController.hpp
|
* @file AirspeedDirectionController.hpp
|
||||||
*
|
*
|
||||||
* Original Author: Thomas Stastny <tstastny@ethz.ch>
|
* Original Author: Thomas Stastny <tstastny@ethz.ch>
|
||||||
* Refactored to better suite new control API: Roman Bapst <roman@auterion.com>
|
* Refactored to better suite new control API: Roman Bapst <roman@auterion.com>
|
||||||
@@ -56,14 +56,14 @@
|
|||||||
* https://tstastny.github.io/pdf/tstastny_phd_thesis_wcover.pdf
|
* https://tstastny.github.io/pdf/tstastny_phd_thesis_wcover.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PX4_AIRSPEEDREFERENCECONTROLLER_HPP
|
#ifndef PX4_AIRSPEEDDIRECTIONONTROLLER_HPP
|
||||||
#define PX4_AIRSPEEDREFERENCECONTROLLER_HPP
|
#define PX4_AIRSPEEDDIRECTIONONTROLLER_HPP
|
||||||
|
|
||||||
class AirspeedReferenceController
|
class AirspeedDirectionController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
AirspeedReferenceController();
|
AirspeedDirectionController();
|
||||||
|
|
||||||
|
|
||||||
float controlHeading(const float heading_sp, const float heading, const float airspeed) const;
|
float controlHeading(const float heading_sp, const float heading, const float airspeed) const;
|
||||||
@@ -72,4 +72,4 @@ private:
|
|||||||
float p_gain_{0.8885f}; // proportional gain (computed from period_ and damping_) [rad/s]
|
float p_gain_{0.8885f}; // proportional gain (computed from period_ and damping_) [rad/s]
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //PX4_AIRSPEEDREFERENCECONTROLLER_HPP
|
#endif //PX4_AIRSPEEDDIRECTIONONTROLLER_HPP
|
||||||
@@ -34,10 +34,10 @@
|
|||||||
px4_add_library(npfg
|
px4_add_library(npfg
|
||||||
DirectionalGuidance.cpp
|
DirectionalGuidance.cpp
|
||||||
CourseToAirspeedRefMapper.cpp
|
CourseToAirspeedRefMapper.cpp
|
||||||
AirspeedReferenceController.cpp
|
AirspeedDirectionController.cpp
|
||||||
DirectionalGuidance.hpp
|
DirectionalGuidance.hpp
|
||||||
CourseToAirspeedRefMapper.hpp
|
CourseToAirspeedRefMapper.hpp
|
||||||
AirspeedReferenceController.hpp
|
AirspeedDirectionController.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(npfg PRIVATE geo)
|
target_link_libraries(npfg PRIVATE geo)
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ void FwLateralLongitudinalControl::Run()
|
|||||||
|
|
||||||
if (PX4_ISFINITE(airspeed_direction_sp)) {
|
if (PX4_ISFINITE(airspeed_direction_sp)) {
|
||||||
const float heading = atan2f(airspeed_vector(1), airspeed_vector(0));
|
const float heading = atan2f(airspeed_vector(1), airspeed_vector(0));
|
||||||
lateral_accel_sp = _airspeed_ref_control.controlHeading(airspeed_direction_sp, heading,
|
lateral_accel_sp = _airspeed_direction_control.controlHeading(airspeed_direction_sp, heading,
|
||||||
airspeed_vector.norm());
|
airspeed_vector.norm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include <lib/geo/geo.h>
|
#include <lib/geo/geo.h>
|
||||||
#include <lib/atmosphere/atmosphere.h>
|
#include <lib/atmosphere/atmosphere.h>
|
||||||
#include <lib/npfg/CourseToAirspeedRefMapper.hpp>
|
#include <lib/npfg/CourseToAirspeedRefMapper.hpp>
|
||||||
#include <lib/npfg/AirspeedReferenceController.hpp>
|
#include <lib/npfg/AirspeedDirectionController.hpp>
|
||||||
#include <lib/tecs/TECS.hpp>
|
#include <lib/tecs/TECS.hpp>
|
||||||
#include <lib/mathlib/mathlib.h>
|
#include <lib/mathlib/mathlib.h>
|
||||||
#include <lib/perf/perf_counter.h>
|
#include <lib/perf/perf_counter.h>
|
||||||
@@ -206,7 +206,7 @@ private:
|
|||||||
PerformanceModel _performance_model;
|
PerformanceModel _performance_model;
|
||||||
TECS _tecs;
|
TECS _tecs;
|
||||||
CourseToAirspeedRefMapper _course_to_airspeed;
|
CourseToAirspeedRefMapper _course_to_airspeed;
|
||||||
AirspeedReferenceController _airspeed_ref_control;
|
AirspeedDirectionController _airspeed_direction_control;
|
||||||
|
|
||||||
float _min_airspeed_from_guidance{0.f}; // need to store it bc we only update after running longitudinal controller
|
float _min_airspeed_from_guidance{0.f}; // need to store it bc we only update after running longitudinal controller
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user