Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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
*/
26
#include "
modules/nav/nav_heli_spinup.h
"
27
#include "navigation.h"
28
#include "
paparazzi.h
"
29
30
static
struct
nav_heli_spinup_t
nav_heli_spinup
;
31
39
void
nav_heli_spinup_setup
(
uint16_t
duration
,
float
throttle
)
40
{
41
nav_heli_spinup
.
duration
= (
duration
> 0) ?
duration
: 1;
42
nav_heli_spinup
.
throttle
=
throttle
*
MAX_PPRZ
;
43
44
nav_throttle
= 0;
45
nav_cmd_roll
= 0;
46
nav_cmd_pitch
= 0;
47
nav_cmd_yaw
= 0;
48
horizontal_mode
=
HORIZONTAL_MODE_ATTITUDE
;
49
vertical_mode
=
VERTICAL_MODE_MANUAL
;
50
}
51
56
bool
nav_heli_spinup_run
(
void
)
57
{
58
if
(
stage_time
>
nav_heli_spinup
.
duration
) {
59
return
false
;
60
}
61
62
nav_cmd_roll
= 0;
63
nav_cmd_pitch
= 0;
64
nav_cmd_yaw
= 0;
65
horizontal_mode
=
HORIZONTAL_MODE_MANUAL
;
66
vertical_mode
=
VERTICAL_MODE_MANUAL
;
67
nav_throttle
=
stage_time
*
nav_heli_spinup
.
throttle
/
nav_heli_spinup
.
duration
;
68
return
true
;
69
}
MAX_PPRZ
#define MAX_PPRZ
Definition:
paparazzi.h:8
vertical_mode
uint8_t vertical_mode
Definition:
sim_ap.c:35
uint16_t
unsigned short uint16_t
Definition:
types.h:16
nav_heli_spinup_setup
void nav_heli_spinup_setup(uint16_t duration, float throttle)
Initialization function.
Definition:
nav_heli_spinup.c:39
nav_heli_spinup.h
nav_cmd_yaw
int32_t nav_cmd_yaw
Definition:
navigation.c:109
nav_cmd_pitch
int32_t nav_cmd_pitch
Definition:
navigation.c:109
paparazzi.h
nav_heli_spinup_run
bool nav_heli_spinup_run(void)
Runs the heli spinup routine, with the parameters set by nav_heli_spinup_setup.
Definition:
nav_heli_spinup.c:56
HORIZONTAL_MODE_MANUAL
#define HORIZONTAL_MODE_MANUAL
Definition:
navigation.h:57
VERTICAL_MODE_MANUAL
#define VERTICAL_MODE_MANUAL
Definition:
navigation.h:73
nav_heli_spinup_t::throttle
uint32_t throttle
The final throttle level.
Definition:
nav_heli_spinup.h:35
nav_cmd_roll
int32_t nav_cmd_roll
Definition:
navigation.c:109
stage_time
uint16_t stage_time
In s.
Definition:
common_flight_plan.c:33
nav_heli_spinup_t
Definition:
nav_heli_spinup.h:33
nav_heli_spinup_t::duration
uint16_t duration
The duration in seconds to reach the final throttle.
Definition:
nav_heli_spinup.h:34
HORIZONTAL_MODE_ATTITUDE
#define HORIZONTAL_MODE_ATTITUDE
Definition:
navigation.h:56
nav_throttle
uint32_t nav_throttle
direct throttle from 0:MAX_PPRZ, used in VERTICAL_MODE_MANUAL
Definition:
navigation.c:114
horizontal_mode
uint8_t horizontal_mode
Definition:
nav.c:71
nav_heli_spinup
static struct nav_heli_spinup_t nav_heli_spinup
Definition:
nav_heli_spinup.c:30
sw
airborne
modules
nav
nav_heli_spinup.c
Generated on Tue Feb 1 2022 13:51:16 for Paparazzi UAS by
1.8.17