PX4 Firmware
PX4 Autopilot Software http://px4.io
rc_channels.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (C) 2013-2016 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
34 /* Auto-generated by genmsg_cpp from file rc_channels.msg */
35 
36 
37 #pragma once
38 
39 
40 #include <uORB/uORB.h>
41 
42 
43 #ifndef __cplusplus
44 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_THROTTLE 0
45 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_ROLL 1
46 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_PITCH 2
47 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_YAW 3
48 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_MODE 4
49 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_RETURN 5
50 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_POSCTL 6
51 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_LOITER 7
52 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_OFFBOARD 8
53 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_ACRO 9
54 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_FLAPS 10
55 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_AUX_1 11
56 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_AUX_2 12
57 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_AUX_3 13
58 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_AUX_4 14
59 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_AUX_5 15
60 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_PARAM_1 16
61 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_PARAM_2 17
62 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_PARAM_3_5 18
63 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_RATTITUDE 19
64 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_KILLSWITCH 20
65 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_TRANSITION 21
66 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_GEAR 22
67 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_ARMSWITCH 23
68 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_STAB 24
69 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_AUX_6 25
70 #define RC_CHANNELS_RC_CHANNELS_FUNCTION_MAN 26
71 
72 #endif
73 
74 
75 #ifdef __cplusplus
76 struct __EXPORT rc_channels_s {
77 #else
78 struct rc_channels_s {
79 #endif
80  uint64_t timestamp;
82  float channels[18];
83  uint32_t frame_drop_count;
84  uint8_t channel_count;
85  int8_t function[27];
86  uint8_t rssi;
88  uint8_t _padding0[6]; // required for logger
89 
90 
91 #ifdef __cplusplus
92  static constexpr uint8_t RC_CHANNELS_FUNCTION_THROTTLE = 0;
93  static constexpr uint8_t RC_CHANNELS_FUNCTION_ROLL = 1;
94  static constexpr uint8_t RC_CHANNELS_FUNCTION_PITCH = 2;
95  static constexpr uint8_t RC_CHANNELS_FUNCTION_YAW = 3;
96  static constexpr uint8_t RC_CHANNELS_FUNCTION_MODE = 4;
97  static constexpr uint8_t RC_CHANNELS_FUNCTION_RETURN = 5;
98  static constexpr uint8_t RC_CHANNELS_FUNCTION_POSCTL = 6;
99  static constexpr uint8_t RC_CHANNELS_FUNCTION_LOITER = 7;
100  static constexpr uint8_t RC_CHANNELS_FUNCTION_OFFBOARD = 8;
101  static constexpr uint8_t RC_CHANNELS_FUNCTION_ACRO = 9;
102  static constexpr uint8_t RC_CHANNELS_FUNCTION_FLAPS = 10;
103  static constexpr uint8_t RC_CHANNELS_FUNCTION_AUX_1 = 11;
104  static constexpr uint8_t RC_CHANNELS_FUNCTION_AUX_2 = 12;
105  static constexpr uint8_t RC_CHANNELS_FUNCTION_AUX_3 = 13;
106  static constexpr uint8_t RC_CHANNELS_FUNCTION_AUX_4 = 14;
107  static constexpr uint8_t RC_CHANNELS_FUNCTION_AUX_5 = 15;
108  static constexpr uint8_t RC_CHANNELS_FUNCTION_PARAM_1 = 16;
109  static constexpr uint8_t RC_CHANNELS_FUNCTION_PARAM_2 = 17;
110  static constexpr uint8_t RC_CHANNELS_FUNCTION_PARAM_3_5 = 18;
111  static constexpr uint8_t RC_CHANNELS_FUNCTION_RATTITUDE = 19;
112  static constexpr uint8_t RC_CHANNELS_FUNCTION_KILLSWITCH = 20;
113  static constexpr uint8_t RC_CHANNELS_FUNCTION_TRANSITION = 21;
114  static constexpr uint8_t RC_CHANNELS_FUNCTION_GEAR = 22;
115  static constexpr uint8_t RC_CHANNELS_FUNCTION_ARMSWITCH = 23;
116  static constexpr uint8_t RC_CHANNELS_FUNCTION_STAB = 24;
117  static constexpr uint8_t RC_CHANNELS_FUNCTION_AUX_6 = 25;
118  static constexpr uint8_t RC_CHANNELS_FUNCTION_MAN = 26;
119 
120 #endif
121 };
122 
123 /* register this as object request broker structure */
124 ORB_DECLARE(rc_channels);
125 
126 
127 #ifdef __cplusplus
128 void print_message(const rc_channels_s& message);
129 #endif
uint64_t timestamp_last_valid
Definition: rc_channels.h:81
API for the uORB lightweight object broker.
Definition: I2C.hpp:51
uint8_t rssi
Definition: rc_channels.h:86
bool signal_lost
Definition: rc_channels.h:87
ORB_DECLARE(rc_channels)
uint32_t frame_drop_count
Definition: rc_channels.h:83
uint64_t timestamp
Definition: rc_channels.h:80
uint8_t channel_count
Definition: rc_channels.h:84