mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 09:26:25 +08:00
control_allocator: inline one-line setters & getters
This commit is contained in:
@@ -41,30 +41,6 @@
|
||||
|
||||
#include "ControlAllocation.hpp"
|
||||
|
||||
const matrix::Vector<float, ControlAllocation::NUM_ACTUATORS> &
|
||||
ControlAllocation::getActuatorSetpoint() const
|
||||
{
|
||||
return _actuator_sp;
|
||||
}
|
||||
|
||||
void
|
||||
ControlAllocation::setControlSetpoint(const matrix::Vector<float, ControlAllocation::NUM_AXES> &control)
|
||||
{
|
||||
_control_sp = control;
|
||||
}
|
||||
|
||||
const matrix::Vector<float, ControlAllocation::NUM_AXES> &
|
||||
ControlAllocation::getControlSetpoint() const
|
||||
{
|
||||
return _control_sp;
|
||||
}
|
||||
|
||||
const matrix::Vector<float, ControlAllocation::NUM_AXES> &
|
||||
ControlAllocation::getAllocatedControl() const
|
||||
{
|
||||
return _control_allocated;
|
||||
}
|
||||
|
||||
void
|
||||
ControlAllocation::setEffectivenessMatrix(
|
||||
const matrix::Matrix<float, ControlAllocation::NUM_AXES, ControlAllocation::NUM_ACTUATORS> &effectiveness,
|
||||
@@ -75,38 +51,7 @@ ControlAllocation::setEffectivenessMatrix(
|
||||
clipActuatorSetpoint(_actuator_trim);
|
||||
_control_trim = _effectiveness * _actuator_trim;
|
||||
_num_actuators = num_actuators;
|
||||
}
|
||||
|
||||
const matrix::Matrix<float, ControlAllocation::NUM_AXES, ControlAllocation::NUM_ACTUATORS> &
|
||||
ControlAllocation::getEffectivenessMatrix() const
|
||||
{
|
||||
return _effectiveness;
|
||||
}
|
||||
|
||||
void
|
||||
ControlAllocation::setActuatorMin(const matrix::Vector<float, ControlAllocation::NUM_ACTUATORS>
|
||||
&actuator_min)
|
||||
{
|
||||
_actuator_min = actuator_min;
|
||||
}
|
||||
|
||||
const matrix::Vector<float, ControlAllocation::NUM_ACTUATORS> &
|
||||
ControlAllocation::getActuatorMin() const
|
||||
{
|
||||
return _actuator_min;
|
||||
}
|
||||
|
||||
void
|
||||
ControlAllocation::setActuatorMax(const matrix::Vector<float, ControlAllocation::NUM_ACTUATORS>
|
||||
&actuator_max)
|
||||
{
|
||||
_actuator_max = actuator_max;
|
||||
}
|
||||
|
||||
const matrix::Vector<float, ControlAllocation::NUM_ACTUATORS> &
|
||||
ControlAllocation::getActuatorMax() const
|
||||
{
|
||||
return _actuator_max;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -112,63 +112,63 @@ public:
|
||||
*
|
||||
* @return Actuator vector
|
||||
*/
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorSetpoint() const;
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorSetpoint() const { return _actuator_sp; }
|
||||
|
||||
/**
|
||||
* Set the desired control vector
|
||||
*
|
||||
* @param Control vector
|
||||
*/
|
||||
void setControlSetpoint(const matrix::Vector<float, NUM_AXES> &control);
|
||||
void setControlSetpoint(const matrix::Vector<float, NUM_AXES> &control) { _control_sp = control; }
|
||||
|
||||
/**
|
||||
* Set the desired control vector
|
||||
*
|
||||
* @param Control vector
|
||||
*/
|
||||
const matrix::Vector<float, NUM_AXES> &getControlSetpoint() const;
|
||||
const matrix::Vector<float, NUM_AXES> &getControlSetpoint() const { return _control_sp; }
|
||||
|
||||
/**
|
||||
* Get the allocated control vector
|
||||
*
|
||||
* @return Control vector
|
||||
*/
|
||||
const matrix::Vector<float, NUM_AXES> &getAllocatedControl() const;
|
||||
const matrix::Vector<float, NUM_AXES> &getAllocatedControl() const { return _control_allocated; }
|
||||
|
||||
/**
|
||||
* Get the control effectiveness matrix
|
||||
*
|
||||
* @return Effectiveness matrix
|
||||
*/
|
||||
const matrix::Matrix<float, NUM_AXES, NUM_ACTUATORS> &getEffectivenessMatrix() const;
|
||||
const matrix::Matrix<float, NUM_AXES, NUM_ACTUATORS> &getEffectivenessMatrix() const { return _effectiveness; }
|
||||
|
||||
/**
|
||||
* Set the minimum actuator values
|
||||
*
|
||||
* @param actuator_min Minimum actuator values
|
||||
*/
|
||||
void setActuatorMin(const matrix::Vector<float, NUM_ACTUATORS> &actuator_min);
|
||||
void setActuatorMin(const matrix::Vector<float, NUM_ACTUATORS> &actuator_min) { _actuator_min = actuator_min; }
|
||||
|
||||
/**
|
||||
* Get the minimum actuator values
|
||||
*
|
||||
* @return Minimum actuator values
|
||||
*/
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorMin() const;
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorMin() const { return _actuator_min; }
|
||||
|
||||
/**
|
||||
* Set the maximum actuator values
|
||||
*
|
||||
* @param actuator_max Maximum actuator values
|
||||
*/
|
||||
void setActuatorMax(const matrix::Vector<float, NUM_ACTUATORS> &actuator_max);
|
||||
void setActuatorMax(const matrix::Vector<float, NUM_ACTUATORS> &actuator_max) { _actuator_max = actuator_max; }
|
||||
|
||||
/**
|
||||
* Get the maximum actuator values
|
||||
*
|
||||
* @return Maximum actuator values
|
||||
*/
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorMax() const;
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorMax() const { return _actuator_max; }
|
||||
|
||||
/**
|
||||
* Set the current actuator setpoint.
|
||||
|
||||
Reference in New Issue
Block a user