control_allocator: param update avoid temporary
Build all targets / Scan for Board Targets (push) Has been cancelled
Checks / build (NO_NINJA_BUILD=1 px4_fmu-v5_default) (push) Has been cancelled
Checks / build (NO_NINJA_BUILD=1 px4_sitl_default) (push) Has been cancelled
Checks / build (check_format) (push) Has been cancelled
Checks / build (check_newlines) (push) Has been cancelled
Checks / build (module_documentation) (push) Has been cancelled
Checks / build (px4_fmu-v2_default stack_check) (push) Has been cancelled
Checks / build (px4_sitl_allyes) (push) Has been cancelled
Checks / build (shellcheck_all) (push) Has been cancelled
Checks / build (tests) (push) Has been cancelled
Checks / build (tests_coverage) (push) Has been cancelled
Checks / build (validate_module_configs) (push) Has been cancelled
Clang Tidy / build (push) Has been cancelled
MacOS build / build (px4_fmu-v5_default) (push) Has been cancelled
MacOS build / build (px4_sitl) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Has been cancelled
Container build / Build and Push Container (push) Has been cancelled
EKF Update Change Indicator / unit_tests (push) Has been cancelled
Failsafe Simulator Build / build (failsafe_web) (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Has been cancelled
MAVROS Mission Tests / build (map[mission:MC_mission_box vehicle:iris]) (push) Has been cancelled
MAVROS Mission Tests / build (map[mission:rover_mission_1 vehicle:rover]) (push) Has been cancelled
MAVROS Offboard Tests / build (map[test_file:mavros_posix_tests_offboard_posctl.test vehicle:iris]) (push) Has been cancelled
Nuttx Target with extra env config / build (px4_fmu-v5_default) (push) Has been cancelled
Python CI Checks / build (push) Has been cancelled
ROS Translation Node Tests / Build and test (map[ros_version:humble ubuntu:jammy]) (push) Has been cancelled
ROS Translation Node Tests / Build and test (map[ros_version:jazzy ubuntu:noble]) (push) Has been cancelled
SITL Tests / Testing PX4 tailsitter (push) Has been cancelled
SITL Tests / Testing PX4 iris (push) Has been cancelled
SITL Tests / Testing PX4 standard_vtol (push) Has been cancelled
Build all targets / Build Group [${{ matrix.group }}] (push) Has been cancelled
Build all targets / Upload Artifacts to S3 (push) Has been cancelled
Build all targets / Create Release and Upload Artifacts (push) Has been cancelled
FLASH usage analysis / Publish Results (push) Has been cancelled

- this is a harmless workaround for a GCC warning (-Wdangling-pointer) false positive
This commit is contained in:
Daniel Agar
2025-02-17 14:35:15 -05:00
committed by GitHub
parent 024dd701fb
commit e12c3c00a4
6 changed files with 10 additions and 16 deletions
@@ -69,15 +69,11 @@ void ActuatorEffectivenessControlSurfaces::updateParams()
{
ModuleParams::updateParams();
int32_t count = 0;
if (param_get(_count_handle, &count) != 0) {
if (param_get(_count_handle, &_count) != PX4_OK) {
PX4_ERR("param_get failed");
return;
}
_count = count;
for (int i = 0; i < _count; i++) {
param_get(_param_handles[i].type, (int32_t *)&_params[i].type);
@@ -107,7 +107,7 @@ private:
param_t _count_handle;
Params _params[MAX_COUNT] {};
int _count{0};
int32_t _count{0};
SlewRate<float> _flaps_setpoint_with_slewrate;
SlewRate<float> _spoilers_setpoint_with_slewrate;
@@ -73,14 +73,13 @@ void ActuatorEffectivenessHelicopter::updateParams()
{
ModuleParams::updateParams();
int32_t count = 0;
if (param_get(_param_handles.num_swash_plate_servos, &count) != 0) {
if (param_get(_param_handles.num_swash_plate_servos, &_geometry.num_swash_plate_servos) != PX4_OK) {
PX4_ERR("param_get failed");
return;
}
_geometry.num_swash_plate_servos = math::constrain((int)count, 3, NUM_SWASH_PLATE_SERVOS_MAX);
_geometry.num_swash_plate_servos = math::constrain(_geometry.num_swash_plate_servos,
(int32_t)3, (int32_t)NUM_SWASH_PLATE_SERVOS_MAX);
for (int i = 0; i < _geometry.num_swash_plate_servos; ++i) {
float angle_deg{};
@@ -58,7 +58,7 @@ public:
struct Geometry {
SwashPlateGeometry swash_plate_servos[NUM_SWASH_PLATE_SERVOS_MAX];
int num_swash_plate_servos{0};
int32_t num_swash_plate_servos{0};
float throttle_curve[NUM_CURVE_POINTS];
float pitch_curve[NUM_CURVE_POINTS];
float yaw_collective_pitch_scale;
@@ -60,14 +60,13 @@ void ActuatorEffectivenessHelicopterCoaxial::updateParams()
{
ModuleParams::updateParams();
int32_t count = 0;
if (param_get(_param_handles.num_swash_plate_servos, &count) != 0) {
if (param_get(_param_handles.num_swash_plate_servos, &_geometry.num_swash_plate_servos) != PX4_OK) {
PX4_ERR("param_get failed");
return;
}
_geometry.num_swash_plate_servos = math::constrain((int)count, 2, NUM_SWASH_PLATE_SERVOS_MAX);
_geometry.num_swash_plate_servos = math::constrain(_geometry.num_swash_plate_servos,
(int32_t)2, (int32_t)NUM_SWASH_PLATE_SERVOS_MAX);
for (int i = 0; i < _geometry.num_swash_plate_servos; ++i) {
float angle_deg{};
@@ -55,7 +55,7 @@ public:
struct Geometry {
SwashPlateGeometry swash_plate_servos[NUM_SWASH_PLATE_SERVOS_MAX];
int num_swash_plate_servos{0};
int32_t num_swash_plate_servos{0};
float spoolup_time;
};