mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 09:43:57 -04:00
AR_AttitudeControl: add get_desired_pitch accessor
This commit is contained in:
parent
56a89c0a1c
commit
9b60e0844b
@ -522,6 +522,17 @@ float AR_AttitudeControl::get_throttle_out_from_pitch(float desired_pitch, bool
|
||||
return constrain_float(_pitch_to_throttle_pid.get_pid(), -1.0f, +1.0f);
|
||||
}
|
||||
|
||||
// get latest desired pitch in radians for reporting purposes
|
||||
float AR_AttitudeControl::get_desired_pitch() const
|
||||
{
|
||||
// if not called recently, return 0
|
||||
if ((_balance_last_ms == 0) || ((AP_HAL::millis() - _balance_last_ms) > AR_ATTCONTROL_TIMEOUT_MS)) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return _pitch_to_throttle_pid.get_pid_info().desired;
|
||||
}
|
||||
|
||||
// get forward speed in m/s (earth-frame horizontal velocity but only along vehicle x-axis). returns true on success
|
||||
bool AR_AttitudeControl::get_forward_speed(float &speed) const
|
||||
{
|
||||
|
@ -94,6 +94,9 @@ public:
|
||||
// desired_pitch is in radians
|
||||
float get_throttle_out_from_pitch(float desired_pitch, bool armed, float dt);
|
||||
|
||||
// get latest desired pitch in radians for reporting purposes
|
||||
float get_desired_pitch() const;
|
||||
|
||||
// low level control accessors for reporting and logging
|
||||
AC_P& get_steering_angle_p() { return _steer_angle_p; }
|
||||
AC_PID& get_steering_rate_pid() { return _steer_rate_pid; }
|
||||
|
Loading…
Reference in New Issue
Block a user