You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
469 B
20 lines
469 B
8 years ago
|
#include "Rover.h"
|
||
|
|
||
|
void ModeHold::update()
|
||
|
{
|
||
7 years ago
|
float throttle = 0.0f;
|
||
|
|
||
|
// if vehicle is balance bot, calculate actual throttle required for balancing
|
||
|
if (rover.is_balancebot()) {
|
||
7 years ago
|
rover.balancebot_pitch_control(throttle);
|
||
7 years ago
|
}
|
||
|
|
||
6 years ago
|
// relax mainsail
|
||
|
g2.motors.set_mainsail(100.0f);
|
||
5 years ago
|
g2.motors.set_wingsail(0.0f);
|
||
6 years ago
|
|
||
8 years ago
|
// hold position - stop motors and center steering
|
||
7 years ago
|
g2.motors.set_throttle(throttle);
|
||
8 years ago
|
g2.motors.set_steering(0.0f);
|
||
|
}
|