2019-01-15 13:46:13 -04:00
|
|
|
#include "mode.h"
|
|
|
|
#include "Plane.h"
|
|
|
|
|
|
|
|
void ModeManual::update()
|
|
|
|
{
|
2021-07-17 03:40:38 -03:00
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, plane.roll_in_expo(false));
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, plane.pitch_in_expo(false));
|
2023-07-05 20:01:16 -03:00
|
|
|
output_rudder_and_steering(plane.rudder_in_expo(false));
|
2023-06-19 12:48:59 -03:00
|
|
|
|
2024-02-21 14:53:33 -04:00
|
|
|
const float throttle = plane.get_throttle_input(true);
|
2023-06-19 12:48:59 -03:00
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, throttle);
|
2021-11-05 21:12:18 -03:00
|
|
|
|
2023-02-12 09:33:27 -04:00
|
|
|
plane.nav_roll_cd = ahrs.roll_sensor;
|
|
|
|
plane.nav_pitch_cd = ahrs.pitch_sensor;
|
2019-01-15 13:46:13 -04:00
|
|
|
}
|
|
|
|
|
2023-04-24 09:28:55 -03:00
|
|
|
void ModeManual::run()
|
|
|
|
{
|
|
|
|
reset_controllers();
|
|
|
|
}
|
2024-02-21 14:53:33 -04:00
|
|
|
|
|
|
|
// true if throttle min/max limits should be applied
|
|
|
|
bool ModeManual::use_throttle_limits() const
|
|
|
|
{
|
|
|
|
#if HAL_QUADPLANE_ENABLED
|
|
|
|
if (quadplane.available() && quadplane.option_is_set(QuadPlane::OPTION::IDLE_GOV_MANUAL)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return false;
|
|
|
|
}
|