forked from Archive/PX4-Autopilot
UUV introduce param to skip controller (#15706)
* added skip_ctrl param to uuv * fixed formatting
This commit is contained in:
parent
064511c2df
commit
eb60479e4c
|
@ -238,7 +238,15 @@ void UUVAttitudeControl::Run()
|
|||
}
|
||||
|
||||
/* Geometric Control*/
|
||||
control_attitude_geo(attitude, _attitude_setpoint, angular_velocity, _rates_setpoint);
|
||||
int skip_controller = _param_skip_ctrl.get();
|
||||
|
||||
if (skip_controller) {
|
||||
constrain_actuator_commands(_rates_setpoint.roll, _rates_setpoint.pitch, _rates_setpoint.yaw,
|
||||
_rates_setpoint.thrust_body[0]);
|
||||
|
||||
} else {
|
||||
control_attitude_geo(attitude, _attitude_setpoint, angular_velocity, _rates_setpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -87,10 +87,6 @@ public:
|
|||
UUVAttitudeControl();
|
||||
~UUVAttitudeControl();
|
||||
|
||||
UUVAttitudeControl(const UUVAttitudeControl &) = delete;
|
||||
UUVAttitudeControl operator=(const UUVAttitudeControl &other) = delete;
|
||||
|
||||
|
||||
/** @see ModuleBase */
|
||||
static int task_spawn(int argc, char *argv[]);
|
||||
|
||||
|
@ -131,6 +127,7 @@ private:
|
|||
(ParamFloat<px4::params::UUV_YAW_D>) _param_yaw_d,
|
||||
// control/input modes
|
||||
(ParamInt<px4::params::UUV_INPUT_MODE>) _param_input_mode,
|
||||
(ParamInt<px4::params::UUV_SKIP_CTRL>) _param_skip_ctrl,
|
||||
// direct access to inputs
|
||||
(ParamFloat<px4::params::UUV_DIRCT_ROLL>) _param_direct_roll,
|
||||
(ParamFloat<px4::params::UUV_DIRCT_PITCH>) _param_direct_pitch,
|
||||
|
|
|
@ -107,6 +107,14 @@ PARAM_DEFINE_FLOAT(UUV_YAW_D, 2.0f);
|
|||
*/
|
||||
PARAM_DEFINE_INT32(UUV_INPUT_MODE, 0);
|
||||
|
||||
/**
|
||||
* Skip the controller
|
||||
*
|
||||
* @value 0 use the module's controller
|
||||
* @value 1 skip the controller and feedthrough the setpoints
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UUV_SKIP_CTRL, 0);
|
||||
|
||||
/**
|
||||
* Direct roll input
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue