mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 01:53:33 +08:00
cmake standalone build
This commit is contained in:
@@ -38,14 +38,10 @@
|
||||
* Authors and acknowledgements in header.
|
||||
*/
|
||||
|
||||
#include <ecl/ecl.h>
|
||||
#include "ecl_roll_controller.h"
|
||||
#include <stdint.h>
|
||||
#include <float.h>
|
||||
#include <geo/geo.h>
|
||||
#include <ecl/ecl.h>
|
||||
#include <mathlib/mathlib.h>
|
||||
#include <systemlib/err.h>
|
||||
|
||||
ECL_RollController::ECL_RollController() :
|
||||
ECL_Controller("roll")
|
||||
@@ -55,7 +51,7 @@ ECL_RollController::ECL_RollController() :
|
||||
float ECL_RollController::control_attitude(const struct ECL_ControlData &ctl_data)
|
||||
{
|
||||
/* Do not calculate control signal with bad inputs */
|
||||
if (!(PX4_ISFINITE(ctl_data.roll_setpoint) && PX4_ISFINITE(ctl_data.roll))) {
|
||||
if (!(ISFINITE(ctl_data.roll_setpoint) && ISFINITE(ctl_data.roll))) {
|
||||
return _rate_setpoint;
|
||||
}
|
||||
|
||||
@@ -71,13 +67,13 @@ float ECL_RollController::control_attitude(const struct ECL_ControlData &ctl_dat
|
||||
float ECL_RollController::control_bodyrate(const struct ECL_ControlData &ctl_data)
|
||||
{
|
||||
/* Do not calculate control signal with bad inputs */
|
||||
if (!(PX4_ISFINITE(ctl_data.pitch) &&
|
||||
PX4_ISFINITE(ctl_data.body_x_rate) &&
|
||||
PX4_ISFINITE(ctl_data.body_z_rate) &&
|
||||
PX4_ISFINITE(ctl_data.yaw_rate_setpoint) &&
|
||||
PX4_ISFINITE(ctl_data.airspeed_min) &&
|
||||
PX4_ISFINITE(ctl_data.airspeed_max) &&
|
||||
PX4_ISFINITE(ctl_data.scaler))) {
|
||||
if (!(ISFINITE(ctl_data.pitch) &&
|
||||
ISFINITE(ctl_data.body_x_rate) &&
|
||||
ISFINITE(ctl_data.body_z_rate) &&
|
||||
ISFINITE(ctl_data.yaw_rate_setpoint) &&
|
||||
ISFINITE(ctl_data.airspeed_min) &&
|
||||
ISFINITE(ctl_data.airspeed_max) &&
|
||||
ISFINITE(ctl_data.scaler))) {
|
||||
return math::constrain(_last_output, -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user