Browse Source

UUV introduce param to skip controller (#15706)

* added skip_ctrl param to uuv

* fixed formatting
release/1.12
Thies Lennart Alff 4 years ago committed by GitHub
parent
commit
eb60479e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/modules/uuv_att_control/uuv_att_control.cpp
  2. 5
      src/modules/uuv_att_control/uuv_att_control.hpp
  3. 8
      src/modules/uuv_att_control/uuv_att_control_params.c

10
src/modules/uuv_att_control/uuv_att_control.cpp

@ -238,7 +238,15 @@ void UUVAttitudeControl::Run() @@ -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);
}
}
}

5
src/modules/uuv_att_control/uuv_att_control.hpp

@ -87,10 +87,6 @@ public: @@ -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: @@ -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,

8
src/modules/uuv_att_control/uuv_att_control_params.c

@ -107,6 +107,14 @@ PARAM_DEFINE_FLOAT(UUV_YAW_D, 2.0f); @@ -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…
Cancel
Save