Rename AirspeedReferenceController to AirspeedDirectionController

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2025-05-20 11:43:53 +02:00
parent 22fdbacdbe
commit 37b8ed88c4
5 changed files with 14 additions and 14 deletions

View File

@ -31,17 +31,17 @@
*
****************************************************************************/
#include "AirspeedReferenceController.hpp"
#include "AirspeedDirectionController.hpp"
#include <matrix/math.hpp>
#include <lib/mathlib/mathlib.h>
using matrix::Vector2f;
AirspeedReferenceController::AirspeedReferenceController()
AirspeedDirectionController::AirspeedDirectionController()
{
// 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
{

View File

@ -32,7 +32,7 @@
****************************************************************************/
/*
* @file AirspeedRefController.hpp
* @file AirspeedDirectionController.hpp
*
* Original Author: Thomas Stastny <tstastny@ethz.ch>
* 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
*/
#ifndef PX4_AIRSPEEDREFERENCECONTROLLER_HPP
#define PX4_AIRSPEEDREFERENCECONTROLLER_HPP
#ifndef PX4_AIRSPEEDDIRECTIONONTROLLER_HPP
#define PX4_AIRSPEEDDIRECTIONONTROLLER_HPP
class AirspeedReferenceController
class AirspeedDirectionController
{
public:
AirspeedReferenceController();
AirspeedDirectionController();
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]
};
#endif //PX4_AIRSPEEDREFERENCECONTROLLER_HPP
#endif //PX4_AIRSPEEDDIRECTIONONTROLLER_HPP

View File

@ -34,10 +34,10 @@
px4_add_library(npfg
DirectionalGuidance.cpp
CourseToAirspeedRefMapper.cpp
AirspeedReferenceController.cpp
AirspeedDirectionController.cpp
DirectionalGuidance.hpp
CourseToAirspeedRefMapper.hpp
AirspeedReferenceController.hpp
AirspeedDirectionController.hpp
)
target_link_libraries(npfg PRIVATE geo)

View File

@ -262,7 +262,7 @@ void FwLateralLongitudinalControl::Run()
if (PX4_ISFINITE(airspeed_direction_sp)) {
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());
}

View File

@ -45,7 +45,7 @@
#include <lib/geo/geo.h>
#include <lib/atmosphere/atmosphere.h>
#include <lib/npfg/CourseToAirspeedRefMapper.hpp>
#include <lib/npfg/AirspeedReferenceController.hpp>
#include <lib/npfg/AirspeedDirectionController.hpp>
#include <lib/tecs/TECS.hpp>
#include <lib/mathlib/mathlib.h>
#include <lib/perf/perf_counter.h>
@ -206,7 +206,7 @@ private:
PerformanceModel _performance_model;
TECS _tecs;
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