ardupilot/APMrover2/mode_manual.cpp

31 lines
897 B
C++
Raw Normal View History

2017-07-18 23:17:45 -03:00
#include "mode.h"
#include "Rover.h"
void ModeManual::_exit()
{
// clear lateral when exiting manual mode
g2.motors.set_lateral(0);
}
2017-07-18 23:17:45 -03:00
void ModeManual::update()
{
float desired_steering, desired_throttle, desired_lateral;
get_pilot_desired_steering_and_throttle(desired_steering, desired_throttle);
get_pilot_desired_lateral(desired_lateral);
// if vehicle is balance bot, calculate actual throttle required for balancing
if (rover.is_balancebot()) {
rover.balancebot_pitch_control(desired_throttle);
}
2019-05-25 15:42:18 -03:00
// set sailboat mainsail
float desired_mainsail;
g2.sailboat.get_pilot_desired_mainsail(desired_mainsail);
g2.motors.set_mainsail(desired_mainsail);
2018-09-25 10:09:47 -03:00
// copy RC scaled inputs to outputs
g2.motors.set_throttle(desired_throttle);
g2.motors.set_steering(desired_steering, false);
g2.motors.set_lateral(desired_lateral);
2017-07-18 23:17:45 -03:00
}