mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 05:50:35 +08:00
Linux: Added linker script support for param and added mc_att_control
Added linker script to resolve __param_start and __param_end. Added mc_att_control to list of supported builtins. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_config.h>
|
||||
#include <px4_tasks.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -404,7 +405,7 @@ MulticopterAttitudeControl::~MulticopterAttitudeControl()
|
||||
|
||||
/* if we have given up, kill it */
|
||||
if (++i > 50) {
|
||||
task_delete(_control_task);
|
||||
px4_task_delete(_control_task);
|
||||
break;
|
||||
}
|
||||
} while (_control_task != -1);
|
||||
@@ -721,7 +722,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
|
||||
if (fabsf(_att_control(i)) < _thrust_sp) {
|
||||
float rate_i = _rates_int(i) + _params.rate_i(i) * rates_err(i) * dt;
|
||||
|
||||
if (isfinite(rate_i) && rate_i > -RATES_I_LIMIT && rate_i < RATES_I_LIMIT &&
|
||||
if (std::isfinite(rate_i) && rate_i > -RATES_I_LIMIT && rate_i < RATES_I_LIMIT &&
|
||||
_att_control(i) > -RATES_I_LIMIT && _att_control(i) < RATES_I_LIMIT) {
|
||||
_rates_int(i) = rate_i;
|
||||
}
|
||||
@@ -858,10 +859,10 @@ MulticopterAttitudeControl::task_main()
|
||||
control_attitude_rates(dt);
|
||||
|
||||
/* publish actuator controls */
|
||||
_actuators.control[0] = (isfinite(_att_control(0))) ? _att_control(0) : 0.0f;
|
||||
_actuators.control[1] = (isfinite(_att_control(1))) ? _att_control(1) : 0.0f;
|
||||
_actuators.control[2] = (isfinite(_att_control(2))) ? _att_control(2) : 0.0f;
|
||||
_actuators.control[3] = (isfinite(_thrust_sp)) ? _thrust_sp : 0.0f;
|
||||
_actuators.control[0] = (std::isfinite(_att_control(0))) ? _att_control(0) : 0.0f;
|
||||
_actuators.control[1] = (std::isfinite(_att_control(1))) ? _att_control(1) : 0.0f;
|
||||
_actuators.control[2] = (std::isfinite(_att_control(2))) ? _att_control(2) : 0.0f;
|
||||
_actuators.control[3] = (std::isfinite(_thrust_sp)) ? _thrust_sp : 0.0f;
|
||||
_actuators.timestamp = hrt_absolute_time();
|
||||
_actuators.timestamp_sample = _v_att.timestamp;
|
||||
|
||||
@@ -909,7 +910,7 @@ MulticopterAttitudeControl::start()
|
||||
SCHED_DEFAULT,
|
||||
SCHED_PRIORITY_MAX - 5,
|
||||
1600,
|
||||
(main_t)&MulticopterAttitudeControl::task_main_trampoline,
|
||||
(px4_main_t)&MulticopterAttitudeControl::task_main_trampoline,
|
||||
nullptr);
|
||||
|
||||
if (_control_task < 0) {
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
/**
|
||||
* Array of static parameter info.
|
||||
*/
|
||||
#if defined(_UNIT_TEST) || defined(__PX4_LINUX)
|
||||
#if defined(_UNIT_TEST)
|
||||
extern struct param_info_s param_array[];
|
||||
extern struct param_info_s *param_info_base;
|
||||
extern struct param_info_s *param_info_limit;
|
||||
|
||||
Reference in New Issue
Block a user