Added PerformanceModel for fixed wing (#22091)

* created a Performance Model for fixed wing vehicle
- added compensation for maximum climbrate, minimum sinkrate, minimum airspeed and trim airspeed based on weight ratio and air density
- added atmosphere lib to standard atmosphere calculations


---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
This commit is contained in:
Roman Bapst
2023-11-21 17:13:50 +01:00
committed by GitHub
co-authored by Thomas Stastny
parent 70cd224236
commit dd2322d622
40 changed files with 800 additions and 474 deletions
@@ -39,6 +39,7 @@
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/battery_status.h>
#include <lib/atmosphere/atmosphere.h>
namespace uavcannode
{
@@ -76,7 +77,7 @@ public:
uavcan::equipment::power::BatteryInfo battery_info{};
battery_info.voltage = battery.voltage_v;
battery_info.current = fabs(battery.current_a);
battery_info.temperature = battery.temperature - CONSTANTS_ABSOLUTE_NULL_CELSIUS; // convert from C to K
battery_info.temperature = battery.temperature - atmosphere::kAbsoluteNullCelsius; // convert from C to K
battery_info.full_charge_capacity_wh = battery.capacity;
battery_info.remaining_capacity_wh = battery.remaining * battery.capacity;
battery_info.state_of_charge_pct = battery.remaining * 100;
@@ -39,6 +39,7 @@
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/differential_pressure.h>
#include <lib/atmosphere/atmosphere.h>
namespace uavcannode
{
@@ -78,8 +79,8 @@ public:
// raw_air_data.static_pressure =
raw_air_data.differential_pressure = diff_press.differential_pressure_pa;
// raw_air_data.static_pressure_sensor_temperature =
raw_air_data.differential_pressure_sensor_temperature = diff_press.temperature - CONSTANTS_ABSOLUTE_NULL_CELSIUS;
raw_air_data.static_air_temperature = diff_press.temperature - CONSTANTS_ABSOLUTE_NULL_CELSIUS;
raw_air_data.differential_pressure_sensor_temperature = diff_press.temperature - atmosphere::kAbsoluteNullCelsius;
raw_air_data.static_air_temperature = diff_press.temperature - atmosphere::kAbsoluteNullCelsius;
// raw_air_data.pitot_temperature
// raw_air_data.covariance
uavcan::Publisher<uavcan::equipment::air_data::RawAirData>::broadcast(raw_air_data);
@@ -39,6 +39,7 @@
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/sensor_baro.h>
#include <lib/atmosphere/atmosphere.h>
namespace uavcannode
{
@@ -74,7 +75,7 @@ public:
if ((hrt_elapsed_time(&_last_static_temperature_publish) > 1_s) && uORB::SubscriptionCallbackWorkItem::update(&baro)) {
uavcan::equipment::air_data::StaticTemperature static_temperature{};
static_temperature.static_temperature = baro.temperature - CONSTANTS_ABSOLUTE_NULL_CELSIUS;
static_temperature.static_temperature = baro.temperature - atmosphere::kAbsoluteNullCelsius;
uavcan::Publisher<uavcan::equipment::air_data::StaticTemperature>::broadcast(static_temperature);
// ensure callback is registered