Paparazzi UAS
v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
commands.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2006 Pascal Brisset, Antoine Drouin
3
* Copyright (C) 2021 Gautier Hattenberger <gautier.hattenberger@enac.fr>
4
*
5
* This file is part of paparazzi.
6
*
7
* paparazzi is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2, or (at your option)
10
* any later version.
11
*
12
* paparazzi is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with paparazzi; see the file COPYING. If not, see
19
* <http://www.gnu.org/licenses/>.
20
*
21
*/
22
28
#include "
modules/core/commands.h
"
29
30
pprz_t
commands
[COMMANDS_NB];
31
const
pprz_t
commands_failsafe
[COMMANDS_NB] = COMMANDS_FAILSAFE;
32
33
pprz_t
command_roll_trim
= 0;
34
pprz_t
command_pitch_trim
= 0;
35
pprz_t
command_yaw_trim
= 0;
36
37
#if PERIODIC_TELEMETRY
38
#include "
modules/datalink/telemetry.h
"
39
40
static
void
send_commands
(
struct
transport_tx *trans,
struct
link_device *
dev
)
41
{
42
pprz_msg_send_COMMANDS(trans,
dev
, AC_ID , COMMANDS_NB,
commands
);
43
}
44
#endif
45
46
void
commands_init
(
void
)
47
{
48
SetCommands(
commands_failsafe
);
49
50
51
#ifdef COMMAND_ROLL_TRIM
52
command_roll_trim
= COMMAND_ROLL_TRIM;
53
#endif
54
#ifdef COMMAND_PITCH_TRIM
55
command_pitch_trim
= COMMAND_PITCH_TRIM;
56
#endif
57
#ifdef COMMAND_YAW_TRIM
58
command_yaw_trim
= COMMAND_YAW_TRIM;
59
#endif
60
61
#if PERIODIC_TELEMETRY
62
register_periodic_telemetry
(
DefaultPeriodic
, PPRZ_MSG_ID_COMMANDS,
send_commands
);
63
#endif
64
}
65
66
commands_init
void commands_init(void)
Definition:
commands.c:46
commands
pprz_t commands[COMMANDS_NB]
Definition:
commands.c:30
commands_failsafe
const pprz_t commands_failsafe[COMMANDS_NB]
Definition:
commands.c:31
telemetry.h
pprz_t
int16_t pprz_t
Definition:
paparazzi.h:6
send_commands
static void send_commands(struct transport_tx *trans, struct link_device *dev)
Definition:
commands.c:40
dev
static const struct usb_device_descriptor dev
Definition:
usb_ser_hw.c:74
register_periodic_telemetry
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition:
telemetry.c:51
command_pitch_trim
pprz_t command_pitch_trim
Definition:
commands.c:34
command_roll_trim
pprz_t command_roll_trim
Definition:
commands.c:33
commands.h
Hardware independent code for commands handling.
command_yaw_trim
pprz_t command_yaw_trim
Definition:
commands.c:35
DefaultPeriodic
#define DefaultPeriodic
Set default periodic telemetry.
Definition:
telemetry.h:66
sw
airborne
modules
core
commands.c
Generated on Tue Jun 21 2022 09:06:43 for Paparazzi UAS by
1.8.17