Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
vi.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2008-2010 The Paparazzi Team
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, write to
18
* the Free Software Foundation, 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
20
*/
21
22
#include "
vehicle_interface/vi.h
"
23
24
#include "
subsystems/imu.h
"
25
#include "
subsystems/ahrs.h
"
26
#include "
subsystems/gps.h
"
27
28
#include "generated/airframe.h"
29
30
struct
VehicleInterface
vi
;
31
32
#ifndef VI_TIMEOUT
33
#define VI_TIMEOUT 100
34
#endif
35
36
void
vi_init
(
void
)
37
{
38
39
vi
.
enabled
=
false
;
40
vi
.
timeouted
=
true
;
41
vi
.
last_msg
=
VI_TIMEOUT
;
42
43
vi
.
input
.
h_mode
=
GUIDANCE_H_MODE_ATTITUDE
;
44
INT_EULERS_ZERO
(
vi
.
input
.
h_sp
.attitude);
45
vi
.
input
.
v_mode
=
GUIDANCE_V_MODE_CLIMB
;
46
vi
.
input
.
v_sp
.climb = 0;
47
vi_impl_init
();
48
49
}
50
51
void
vi_periodic
(
void
)
52
{
53
#if (VI_TIMEOUT != 0)
54
if
(
vi
.
last_msg
<
VI_TIMEOUT
) {
55
vi
.
last_msg
++;
56
}
else
{
57
vi
.
timeouted
=
true
;
58
vi
.
input
.
h_mode
=
GUIDANCE_H_MODE_ATTITUDE
;
59
INT_EULERS_ZERO
(
vi
.
input
.
h_sp
.attitude);
60
vi
.
input
.
v_mode
=
GUIDANCE_V_MODE_CLIMB
;
61
vi
.
input
.
v_sp
.climb = 0;
62
}
63
#endif
64
vi_impl_periodic
();
65
}
66
67
void
vi_set_enabled
(
bool
enabled
)
68
{
69
vi_impl_set_enabled
(
enabled
);
70
71
}
72
73
void
vi_update_info
(
void
)
74
{
75
76
}
VehicleInterface::enabled
bool enabled
Definition:
vi.h:78
vi_impl_periodic
void vi_impl_periodic(void)
Definition:
vi_datalink.c:28
VehicleInterface::input
struct Vi_command input
Definition:
vi.h:82
vi
struct VehicleInterface vi
Definition:
vi.c:30
GUIDANCE_H_MODE_ATTITUDE
#define GUIDANCE_H_MODE_ATTITUDE
Definition:
guidance_h.h:58
Vi_command::v_sp
union Vi_command::@303 v_sp
GUIDANCE_V_MODE_CLIMB
#define GUIDANCE_V_MODE_CLIMB
Definition:
guidance_v.h:38
Vi_command::h_sp
union Vi_command::@302 h_sp
INT_EULERS_ZERO
#define INT_EULERS_ZERO(_e)
Definition:
pprz_algebra_int.h:549
vi_periodic
void vi_periodic(void)
Definition:
vi.c:51
vi_impl_init
void vi_impl_init(void)
Definition:
vi_datalink.c:24
VehicleInterface::last_msg
uint8_t last_msg
Definition:
vi.h:80
VehicleInterface
Definition:
vi.h:77
imu.h
vi_set_enabled
void vi_set_enabled(bool enabled)
Definition:
vi.c:67
Vi_command::v_mode
uint8_t v_mode
Definition:
vi.h:74
gps.h
Device independent GPS code (interface)
vi_impl_set_enabled
void vi_impl_set_enabled(bool enabled)
Definition:
vi_datalink.c:32
VI_TIMEOUT
#define VI_TIMEOUT
Definition:
vi.c:33
vi.h
ahrs.h
vi_update_info
void vi_update_info(void)
Definition:
vi.c:73
Vi_command::h_mode
uint8_t h_mode
Definition:
vi.h:73
vi_init
void vi_init(void)
Definition:
vi.c:36
VehicleInterface::timeouted
bool timeouted
Definition:
vi.h:79
sw
airborne
modules
vehicle_interface
vi.c
Generated on Tue Feb 1 2022 13:51:16 for Paparazzi UAS by
1.8.17