mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 06:23:34 +08:00
wip, minor bugfixes in fw att control
This commit is contained in:
@@ -90,7 +90,7 @@ float ECL_PitchController::control_attitude(float pitch_setpoint, float roll, fl
|
|||||||
float pitch_error = pitch_setpoint - pitch;
|
float pitch_error = pitch_setpoint - pitch;
|
||||||
|
|
||||||
/* Apply P controller: rate setpoint from current error and time constant */
|
/* Apply P controller: rate setpoint from current error and time constant */
|
||||||
float _rate_setpoint = pitch_error / _tc;
|
_rate_setpoint = pitch_error / _tc;
|
||||||
|
|
||||||
/* add turn offset */
|
/* add turn offset */
|
||||||
_rate_setpoint += turn_offset;
|
_rate_setpoint += turn_offset;
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ FixedwingAttitudeControl::task_main()
|
|||||||
|
|
||||||
/* Run attitude controllers */
|
/* Run attitude controllers */
|
||||||
_roll_ctrl.control_attitude(roll_sp, _att.roll);
|
_roll_ctrl.control_attitude(roll_sp, _att.roll);
|
||||||
_pitch_ctrl.control_attitude(roll_sp, _att.roll, _att.pitch, airspeed);
|
_pitch_ctrl.control_attitude(pitch_sp, _att.roll, _att.pitch, airspeed);
|
||||||
_yaw_ctrl.control_attitude(_att.roll, _att.pitch,
|
_yaw_ctrl.control_attitude(_att.roll, _att.pitch,
|
||||||
speed_body_u,speed_body_w,
|
speed_body_u,speed_body_w,
|
||||||
_roll_ctrl.get_desired_rate(), _pitch_ctrl.get_desired_rate()); //runs last, because is depending on output of roll and pitch attitude
|
_roll_ctrl.get_desired_rate(), _pitch_ctrl.get_desired_rate()); //runs last, because is depending on output of roll and pitch attitude
|
||||||
@@ -709,9 +709,9 @@ FixedwingAttitudeControl::task_main()
|
|||||||
* only once available
|
* only once available
|
||||||
*/
|
*/
|
||||||
vehicle_rates_setpoint_s rates_sp;
|
vehicle_rates_setpoint_s rates_sp;
|
||||||
rates_sp.roll = _roll_ctrl.get_desired_rate();
|
rates_sp.roll = _roll_ctrl.get_desired_bodyrate();
|
||||||
rates_sp.pitch = _pitch_ctrl.get_desired_rate();
|
rates_sp.pitch = _pitch_ctrl.get_desired_bodyrate();
|
||||||
rates_sp.yaw = _yaw_ctrl.get_desired_rate();
|
rates_sp.yaw = _yaw_ctrl.get_desired_bodyrate();
|
||||||
|
|
||||||
rates_sp.timestamp = hrt_absolute_time();
|
rates_sp.timestamp = hrt_absolute_time();
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
#include <systemlib/param/param.h>
|
#include <systemlib/param/param.h>
|
||||||
|
|
||||||
|
//XXX resolve unclear naming of paramters: FW_P_D --> FW_PR_P
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Controller parameters, accessible via MAVLink
|
* Controller parameters, accessible via MAVLink
|
||||||
*
|
*
|
||||||
@@ -130,7 +132,7 @@ PARAM_DEFINE_FLOAT(FW_Y_P, 0);
|
|||||||
PARAM_DEFINE_FLOAT(FW_Y_I, 0);
|
PARAM_DEFINE_FLOAT(FW_Y_I, 0);
|
||||||
PARAM_DEFINE_FLOAT(FW_Y_IMAX, 15.0f);
|
PARAM_DEFINE_FLOAT(FW_Y_IMAX, 15.0f);
|
||||||
PARAM_DEFINE_FLOAT(FW_Y_D, 0);
|
PARAM_DEFINE_FLOAT(FW_Y_D, 0);
|
||||||
PARAM_DEFINE_FLOAT(FW_Y_ROLLFF, 1);
|
PARAM_DEFINE_FLOAT(FW_Y_ROLLFF, 0);
|
||||||
PARAM_DEFINE_FLOAT(FW_AIRSPD_MIN, 9.0f);
|
PARAM_DEFINE_FLOAT(FW_AIRSPD_MIN, 9.0f);
|
||||||
PARAM_DEFINE_FLOAT(FW_AIRSPD_TRIM, 12.0f);
|
PARAM_DEFINE_FLOAT(FW_AIRSPD_TRIM, 12.0f);
|
||||||
PARAM_DEFINE_FLOAT(FW_AIRSPD_MAX, 18.0f);
|
PARAM_DEFINE_FLOAT(FW_AIRSPD_MAX, 18.0f);
|
||||||
|
|||||||
Reference in New Issue
Block a user