Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
nav_heli_spinup.c
Go to the documentation of this file.
1/*
2 * Copyright (C) Freek van Tienen <freek.v.tienen@gmail.com>
3 *
4 * This file is part of paparazzi
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
25
28#include "navigation.h"
29#include "paparazzi.h"
30
32
41{
42 nav_heli_spinup.duration = (duration > 0) ? duration : 1;
44
45#ifdef COMMAND_ROLL
47#endif
48#ifdef COMMAND_PITCH
50#endif
51#ifdef COMMAND_YAW
52 stabilization.cmd[COMMAND_YAW] = 0;
53#endif
54 nav.throttle = 0;
55
56 nav.horizontal_mode = NAV_HORIZONTAL_MODE_NONE;
57 nav.vertical_mode = NAV_VERTICAL_MODE_MANUAL;
58}
59
65{
66 if (stage_time > nav_heli_spinup.duration) {
67 return false;
68 }
69
70#ifdef COMMAND_ROLL
72#endif
73#ifdef COMMAND_PITCH
75#endif
76#ifdef COMMAND_YAW
77 stabilization.cmd[COMMAND_YAW] = 0;
78#endif
79 nav.throttle = stage_time * nav_heli_spinup.throttle / nav_heli_spinup.duration;
80
81 nav.horizontal_mode = NAV_HORIZONTAL_MODE_NONE;
82 nav.vertical_mode = NAV_VERTICAL_MODE_MANUAL;
83 return true;
84}
uint16_t stage_time
In s.
#define COMMAND_PITCH
#define COMMAND_ROLL
bool nav_heli_spinup_run(void)
Runs the heli spinup routine, with the parameters set by nav_heli_spinup_setup.
void nav_heli_spinup_setup(uint16_t duration, float throttle)
Initialization function.
static struct nav_heli_spinup_t nav_heli_spinup
uint16_t duration
The duration in seconds to reach the final throttle.
uint32_t throttle
The final throttle level.
#define MAX_PPRZ
Definition paparazzi.h:8
struct RotorcraftNavigation nav
Definition navigation.c:51
#define NAV_VERTICAL_MODE_MANUAL
Definition navigation.h:92
#define NAV_HORIZONTAL_MODE_NONE
Definition navigation.h:89
struct Stabilization stabilization
General stabilization interface for rotorcrafts.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.