mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
refactor(navigator): pass PositionYawSetpoint and loiter_point_s by const reference
This commit is contained in:
@@ -123,7 +123,7 @@ void RtlDirect::on_inactive()
|
|||||||
_vehicle_status_sub.update();
|
_vehicle_status_sub.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtlDirect::setRtlPosition(PositionYawSetpoint rtl_position, loiter_point_s loiter_pos)
|
void RtlDirect::setRtlPosition(const PositionYawSetpoint &rtl_position, const loiter_point_s &loiter_pos)
|
||||||
{
|
{
|
||||||
parameters_update();
|
parameters_update();
|
||||||
|
|
||||||
@@ -556,7 +556,7 @@ void RtlDirect::parameters_update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loiter_point_s RtlDirect::sanitizeLandApproach(loiter_point_s land_approach) const
|
loiter_point_s RtlDirect::sanitizeLandApproach(const loiter_point_s &land_approach) const
|
||||||
{
|
{
|
||||||
loiter_point_s sanitized_land_approach{land_approach};
|
loiter_point_s sanitized_land_approach{land_approach};
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
void setReturnAltMin(bool min) { _enforce_rtl_alt = min; }
|
void setReturnAltMin(bool min) { _enforce_rtl_alt = min; }
|
||||||
void setRtlAlt(float alt) {_rtl_alt = alt;};
|
void setRtlAlt(float alt) {_rtl_alt = alt;};
|
||||||
|
|
||||||
void setRtlPosition(PositionYawSetpoint position, loiter_point_s loiter_pos);
|
void setRtlPosition(const PositionYawSetpoint &position, const loiter_point_s &loiter_pos);
|
||||||
|
|
||||||
bool isLanding() { return (_rtl_state != RTLState::IDLE) && (_rtl_state >= RTLState::LOITER_DOWN);};
|
bool isLanding() { return (_rtl_state != RTLState::IDLE) && (_rtl_state >= RTLState::LOITER_DOWN);};
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ private:
|
|||||||
* @brief sanitize land_approach
|
* @brief sanitize land_approach
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
loiter_point_s sanitizeLandApproach(loiter_point_s land_approach) const;
|
loiter_point_s sanitizeLandApproach(const loiter_point_s &land_approach) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for parameter changes and update them if needed.
|
* Check for parameter changes and update them if needed.
|
||||||
|
|||||||
Reference in New Issue
Block a user