FlightTaskManual: replace hold_dz with stick_dz

This commit is contained in:
Dennis Mannhart
2018-04-05 07:30:12 +02:00
committed by Beat Küng
parent a9ac94dd83
commit 4b856717b7
2 changed files with 9 additions and 8 deletions
@@ -45,7 +45,7 @@ using namespace matrix;
FlightTaskManual::FlightTaskManual(control::SuperBlock *parent, const char *name) :
FlightTask(parent, name),
_hold_dz(parent, "MPC_HOLD_DZ", false),
_stick_dz(parent, "MPC_HOLD_DZ", false),
_xy_vel_man_expo(parent, "MPC_XY_MAN_EXPO", false),
_z_vel_man_expo(parent, "MPC_Z_MAN_EXPO", false)
{
@@ -67,6 +67,7 @@ bool FlightTaskManual::initializeSubscriptions(SubscriptionArray &subscription_a
bool FlightTaskManual::activate()
{
bool ret = FlightTask::activate();
return ret;
}
@@ -84,9 +85,9 @@ bool FlightTaskManual::updateInitialize()
bool FlightTaskManual::update()
{
/* TODO
* FlightTask setpoint interface and Position Controller need to be updated to include
* thrust setpoint. With thrust setpoint FlightTaskManual can be used as manual flight mode.
/* Nothing to do.
* The only purpose of this class
* is to provide sticks to child classes.
*/
return true;
}
@@ -103,9 +104,9 @@ bool FlightTaskManual::_evaluateSticks()
_sticks(3) = _sub_manual_control_setpoint->get().r; /* "yaw" [-1,1] */
/* Exponential scale */
_sticks_expo(0) = math::expo_deadzone(_sticks(0), _xy_vel_man_expo.get(), _hold_dz.get());
_sticks_expo(1) = math::expo_deadzone(_sticks(1), _xy_vel_man_expo.get(), _hold_dz.get());
_sticks_expo(2) = math::expo_deadzone(_sticks(2), _z_vel_man_expo.get(), _hold_dz.get());
_sticks_expo(0) = math::expo_deadzone(_sticks(0), _xy_vel_man_expo.get(), _stick_dz.get());
_sticks_expo(1) = math::expo_deadzone(_sticks(1), _xy_vel_man_expo.get(), _stick_dz.get());
_sticks_expo(2) = math::expo_deadzone(_sticks(2), _z_vel_man_expo.get(), _stick_dz.get());
return true;
@@ -66,7 +66,7 @@ protected:
bool _sticks_data_required = true; /**< let inherited task-class define if it depends on stick data */
matrix::Vector<float, 4> _sticks; /**< unmodified manual stick inputs */
matrix::Vector3f _sticks_expo; /**< modified manual sticks using expo function*/
control::BlockParamFloat _hold_dz; /**< 0-deadzone around the center for the sticks */
control::BlockParamFloat _stick_dz; /**< 0-deadzone around the center for the sticks */
private: