Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
traffic_info.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2005 Pascal Brisset, Antoine Drouin
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
29
#ifndef TI_H
30
#define TI_H
31
32
#define NB_ACS_ID 256
33
#define NB_ACS 24
34
35
struct
ac_info_
{
36
uint8_t
ac_id
;
37
float
east
;
/* m relative to nav_utm_east0 */
38
float
north
;
/* m relative to nav_utm_north0 */
39
float
course
;
/* rad (CW) */
40
float
alt
;
/* m */
41
float
gspeed
;
/* m/s */
42
float
climb
;
/* m/s */
43
uint32_t
itow
;
/* ms */
44
};
45
46
extern
uint8_t
acs_idx
;
47
extern
uint8_t
the_acs_id
[
NB_ACS_ID
];
48
extern
struct
ac_info_
the_acs
[
NB_ACS
];
49
50
// 0 is reserved for ground station (id=0)
51
// 1 is reserved for this AC (id=AC_ID)
52
#define SetAcInfo(_id, _utm_x
/*m*/
, _utm_y
/*m*/
, _course
/*rad(CW)*/
, _alt
/*m*/
,_gspeed
/*m/s*/
,_climb, _itow) { \
53
if (acs_idx < NB_ACS) { \
54
if (_id > 0 && the_acs_id[_id] == 0) { \
55
the_acs_id[_id] = acs_idx++; \
56
the_acs[the_acs_id[_id]].ac_id = (uint8_t)_id; \
57
} \
58
the_acs[the_acs_id[_id]].east = _utm_x - nav_utm_east0; \
59
the_acs[the_acs_id[_id]].north = _utm_y - nav_utm_north0; \
60
the_acs[the_acs_id[_id]].course = _course; \
61
the_acs[the_acs_id[_id]].alt = _alt; \
62
the_acs[the_acs_id[_id]].gspeed = _gspeed; \
63
the_acs[the_acs_id[_id]].climb = _climb; \
64
the_acs[the_acs_id[_id]].itow = (uint32_t)_itow; \
65
} \
66
}
67
68
extern
void
traffic_info_init
(
void
);
69
70
struct
ac_info_
*
get_ac_info
(
uint8_t
id
);
71
72
#endif
the_acs
struct ac_info_ the_acs[NB_ACS]
Definition:
traffic_info.c:35
ac_info_::ac_id
uint8_t ac_id
Definition:
traffic_info.h:36
ac_info_::gspeed
float gspeed
Definition:
traffic_info.h:41
ac_info_::course
float course
Definition:
traffic_info.h:39
ac_info_::north
float north
Definition:
traffic_info.h:38
ac_info_::alt
float alt
Definition:
traffic_info.h:40
ac_info_::east
float east
Definition:
traffic_info.h:37
ac_info_::itow
uint32_t itow
Definition:
traffic_info.h:43
the_acs_id
uint8_t the_acs_id[NB_ACS_ID]
Definition:
traffic_info.c:34
uint32_t
unsigned long uint32_t
Definition:
types.h:18
traffic_info_init
void traffic_info_init(void)
Definition:
traffic_info.c:37
NB_ACS
#define NB_ACS
Definition:
traffic_info.h:33
uint8_t
unsigned char uint8_t
Definition:
types.h:14
ac_info_::climb
float climb
Definition:
traffic_info.h:42
NB_ACS_ID
#define NB_ACS_ID
Definition:
traffic_info.h:32
ac_info_
Definition:
traffic_info.h:35
get_ac_info
struct ac_info_ * get_ac_info(uint8_t id)
Definition:
traffic_info.c:45
acs_idx
uint8_t acs_idx
Definition:
traffic_info.c:33
sw
airborne
subsystems
navigation
traffic_info.h
Generated on Tue Jun 21 2016 14:01:28 for Paparazzi UAS by
1.8.8