mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-26 02:28:29 -04:00
Copter: constify some ModeThrow methods
This commit is contained in:
parent
b16d86ebbe
commit
952c8f7ff5
@ -1465,9 +1465,9 @@ protected:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
bool throw_detected();
|
bool throw_detected();
|
||||||
bool throw_position_good();
|
bool throw_position_good() const;
|
||||||
bool throw_height_good();
|
bool throw_height_good() const;
|
||||||
bool throw_attitude_good();
|
bool throw_attitude_good() const;
|
||||||
|
|
||||||
// Throw stages
|
// Throw stages
|
||||||
enum ThrowModeStage {
|
enum ThrowModeStage {
|
||||||
|
@ -276,20 +276,20 @@ bool ModeThrow::throw_detected()
|
|||||||
return throw_condition_confirmed;
|
return throw_condition_confirmed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModeThrow::throw_attitude_good()
|
bool ModeThrow::throw_attitude_good() const
|
||||||
{
|
{
|
||||||
// Check that we have uprighted the copter
|
// Check that we have uprighted the copter
|
||||||
const Matrix3f &rotMat = ahrs.get_rotation_body_to_ned();
|
const Matrix3f &rotMat = ahrs.get_rotation_body_to_ned();
|
||||||
return (rotMat.c.z > 0.866f); // is_upright
|
return (rotMat.c.z > 0.866f); // is_upright
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModeThrow::throw_height_good()
|
bool ModeThrow::throw_height_good() const
|
||||||
{
|
{
|
||||||
// Check that we are within 0.5m of the demanded height
|
// Check that we are within 0.5m of the demanded height
|
||||||
return (pos_control->get_pos_error_z_cm() < 50.0f);
|
return (pos_control->get_pos_error_z_cm() < 50.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModeThrow::throw_position_good()
|
bool ModeThrow::throw_position_good() const
|
||||||
{
|
{
|
||||||
// check that our horizontal position error is within 50cm
|
// check that our horizontal position error is within 50cm
|
||||||
return (pos_control->get_pos_error_xy_cm() < 50.0f);
|
return (pos_control->get_pos_error_xy_cm() < 50.0f);
|
||||||
|
Loading…
Reference in New Issue
Block a user