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/ArduPlane/mode_circle.cpp
Views: 1798
1
#include "mode.h"
2
#include "Plane.h"
3
4
bool ModeCircle::_enter()
5
{
6
// the altitude to circle at is taken from the current altitude
7
plane.next_WP_loc.alt = plane.current_loc.alt;
8
9
return true;
10
}
11
12
void ModeCircle::update()
13
{
14
// we have no GPS installed and have lost radio contact
15
// or we just want to fly around in a gentle circle w/o GPS,
16
// holding altitude at the altitude we set when we
17
// switched into the mode
18
plane.nav_roll_cd = plane.roll_limit_cd / 3;
19
plane.update_load_factor();
20
plane.calc_nav_pitch();
21
plane.calc_throttle();
22
}
23
24
25