CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Rover/mode_hold.cpp
Views: 1798
1
#include "Rover.h"
2
3
void ModeHold::update()
4
{
5
float throttle = 0.0f;
6
7
// if vehicle is balance bot, calculate actual throttle required for balancing
8
if (rover.is_balancebot()) {
9
rover.balancebot_pitch_control(throttle);
10
}
11
12
// relax mainsail
13
g2.sailboat.relax_sails();
14
15
// hold position - stop motors and center steering
16
g2.motors.set_throttle(throttle);
17
g2.motors.set_steering(0.0f);
18
}
19
20