mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 19:07:45 +08:00
UUV introduce param to skip controller (#15706)
* added skip_ctrl param to uuv * fixed formatting
This commit is contained in:
committed by
GitHub
parent
064511c2df
commit
eb60479e4c
@@ -238,9 +238,17 @@ void UUVAttitudeControl::Run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Geometric Control*/
|
/* Geometric Control*/
|
||||||
|
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);
|
control_attitude_geo(attitude, _attitude_setpoint, angular_velocity, _rates_setpoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Manual Control mode (e.g. gamepad,...) - raw feedthrough no assistance */
|
/* Manual Control mode (e.g. gamepad,...) - raw feedthrough no assistance */
|
||||||
if (_manual_control_setpoint_sub.update(&_manual_control_setpoint)) {
|
if (_manual_control_setpoint_sub.update(&_manual_control_setpoint)) {
|
||||||
|
|||||||
@@ -87,10 +87,6 @@ public:
|
|||||||
UUVAttitudeControl();
|
UUVAttitudeControl();
|
||||||
~UUVAttitudeControl();
|
~UUVAttitudeControl();
|
||||||
|
|
||||||
UUVAttitudeControl(const UUVAttitudeControl &) = delete;
|
|
||||||
UUVAttitudeControl operator=(const UUVAttitudeControl &other) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
/** @see ModuleBase */
|
/** @see ModuleBase */
|
||||||
static int task_spawn(int argc, char *argv[]);
|
static int task_spawn(int argc, char *argv[]);
|
||||||
|
|
||||||
@@ -131,6 +127,7 @@ private:
|
|||||||
(ParamFloat<px4::params::UUV_YAW_D>) _param_yaw_d,
|
(ParamFloat<px4::params::UUV_YAW_D>) _param_yaw_d,
|
||||||
// control/input modes
|
// control/input modes
|
||||||
(ParamInt<px4::params::UUV_INPUT_MODE>) _param_input_mode,
|
(ParamInt<px4::params::UUV_INPUT_MODE>) _param_input_mode,
|
||||||
|
(ParamInt<px4::params::UUV_SKIP_CTRL>) _param_skip_ctrl,
|
||||||
// direct access to inputs
|
// direct access to inputs
|
||||||
(ParamFloat<px4::params::UUV_DIRCT_ROLL>) _param_direct_roll,
|
(ParamFloat<px4::params::UUV_DIRCT_ROLL>) _param_direct_roll,
|
||||||
(ParamFloat<px4::params::UUV_DIRCT_PITCH>) _param_direct_pitch,
|
(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);
|
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
|
* Direct roll input
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user