mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
AutoLineSmoothVel - change function contrain_one_side(..) from snake_case to camelCase
This commit is contained in:
@@ -109,7 +109,7 @@ bool FlightTaskAutoLineSmoothVel::_generateHeadingAlongTraj()
|
|||||||
* Example: - if the constrain is -5, the value will be constrained between -5 and 0
|
* Example: - if the constrain is -5, the value will be constrained between -5 and 0
|
||||||
* - if the constrain is 5, the value will be constrained between 0 and 5
|
* - if the constrain is 5, the value will be constrained between 0 and 5
|
||||||
*/
|
*/
|
||||||
inline float FlightTaskAutoLineSmoothVel::constrain_one_side(float val, float constrain)
|
inline float FlightTaskAutoLineSmoothVel::_constrainOneSide(float val, float constrain)
|
||||||
{
|
{
|
||||||
const float min = (constrain < FLT_EPSILON) ? constrain : 0.f;
|
const float min = (constrain < FLT_EPSILON) ? constrain : 0.f;
|
||||||
const float max = (constrain > FLT_EPSILON) ? constrain : 0.f;
|
const float max = (constrain > FLT_EPSILON) ? constrain : 0.f;
|
||||||
@@ -153,7 +153,7 @@ void FlightTaskAutoLineSmoothVel::_prepareSetpoints()
|
|||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
// If available, constrain the velocity using _velocity_setpoint(.)
|
// If available, constrain the velocity using _velocity_setpoint(.)
|
||||||
if (PX4_ISFINITE(_velocity_setpoint(i))) {
|
if (PX4_ISFINITE(_velocity_setpoint(i))) {
|
||||||
_velocity_setpoint(i) = constrain_one_side(vel_sp_xy(i), _velocity_setpoint(i));
|
_velocity_setpoint(i) = _constrainOneSide(vel_sp_xy(i), _velocity_setpoint(i));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_velocity_setpoint(i) = vel_sp_xy(i);
|
_velocity_setpoint(i) = vel_sp_xy(i);
|
||||||
@@ -171,7 +171,7 @@ void FlightTaskAutoLineSmoothVel::_prepareSetpoints()
|
|||||||
|
|
||||||
// If available, constrain the velocity using _velocity_setpoint(.)
|
// If available, constrain the velocity using _velocity_setpoint(.)
|
||||||
if (PX4_ISFINITE(_velocity_setpoint(2))) {
|
if (PX4_ISFINITE(_velocity_setpoint(2))) {
|
||||||
_velocity_setpoint(2) = constrain_one_side(vel_sp_z, _velocity_setpoint(2));
|
_velocity_setpoint(2) = _constrainOneSide(vel_sp_z, _velocity_setpoint(2));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_velocity_setpoint(2) = vel_sp_z;
|
_velocity_setpoint(2) = vel_sp_z;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ protected:
|
|||||||
void _generateSetpoints() override; /**< Generate setpoints along line. */
|
void _generateSetpoints() override; /**< Generate setpoints along line. */
|
||||||
void _setDefaultConstraints() override;
|
void _setDefaultConstraints() override;
|
||||||
|
|
||||||
inline float constrain_one_side(float val, float constrain);
|
inline float _constrainOneSide(float val, float constrain);
|
||||||
void _generateHeading();
|
void _generateHeading();
|
||||||
bool _generateHeadingAlongTraj(); /**< Generates heading along trajectory. */
|
bool _generateHeadingAlongTraj(); /**< Generates heading along trajectory. */
|
||||||
void _updateTrajConstraints();
|
void _updateTrajConstraints();
|
||||||
|
|||||||
Reference in New Issue
Block a user