MAV'RIC
control_command.h
1 /*******************************************************************************
2  * Copyright (c) 2009-2014, MAV'RIC Development Team
3  * 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 are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  ******************************************************************************/
31 
32 /*******************************************************************************
33  * \file control_command.h
34  *
35  * \author MAV'RIC Team
36  * \author Julien Lecoeur
37  *
38  * \brief Data structures to hold torque, thrust, rate, attitude and
39  * velocity commands
40  *
41  ******************************************************************************/
42 
43 
44 #include "quaternions.h"
45 
46 #ifndef CONTROL_COMMAND_H_
47 #define CONTROL_COMMAND_H_
48 
49 #ifdef __cplusplus
50  extern "C" {
51 #endif
52 
53 
57 typedef enum
58 {
59  TORQUE_COMMAND = 0,
60  RATE_COMMAND = 1,
61  ATTITUDE_COMMAND = 2,
62  POSITION_COMMAND = 3,
63  VELOCITY_COMMAND = 4
64 } control_command_mode_t;
65 
66 
70 typedef enum
71 {
72  VELOCITY_COMMAND_MODE_LOCAL = 0,
73  VELOCITY_COMMAND_MODE_SEMI_LOCAL = 1,
74  VELOCITY_COMMAND_MODE_GLOBAL = 2,
75 } velocity_command_mode_t;
76 
77 
81 typedef struct
82 {
83  float xyz[3];
84  velocity_command_mode_t mode;
86 
87 
88 
92 typedef enum
93 {
94  POSITION_COMMAND_MODE_LOCAL = 0,
95  POSITION_COMMAND_MODE_GLOBAL = 1
96 } position_command_mode_t;
97 
98 
102 typedef struct
103 {
104  float xyz[3];
105  position_command_mode_t mode;
107 
108 
112 typedef enum
113 {
114  ATTITUDE_COMMAND_MODE_QUATERNION = 0,
115  ATTITUDE_COMMAND_MODE_RPY = 1
116 } attitude_command_mode_t;
117 
118 
122 typedef struct
123 {
125  float rpy[3];
126  attitude_command_mode_t mode;
128 
129 
133 typedef struct
134 {
135  float xyz[3];
137 
138 
142 typedef struct
143 {
144  float xyz[3];
146 
147 
151 typedef struct
152 {
153  float thrust;
155 
156 
160 typedef struct
161 {
162  float thrust[3];
164 
165 
169 typedef struct
170 {
171  control_command_mode_t mode;
178 } command_t;
179 
180 
181 #ifdef __cplusplus
182  }
183 #endif
184 
185 #endif
Thrust command type.
Definition: control_command.h:151
Position command structure.
Definition: control_command.h:102
Torque command structure.
Definition: control_command.h:142
torque_command_t torque
Torque command.
Definition: control_command.h:173
Global command structure.
Definition: control_command.h:169
thrust_command_t thrust
Thrust command.
Definition: control_command.h:172
attitude_command_t attitude
Attitude command.
Definition: control_command.h:175
Attitude command structure.
Definition: control_command.h:122
velocity_command_mode_t mode
Command mode, defines whether the velocity is given in local or global frame.
Definition: control_command.h:84
rate_command_t rate
Rate command.
Definition: control_command.h:174
Velocity command structure.
Definition: control_command.h:81
Unit quaternion.
Definition: quaternions.h:62
Rate command structure.
Definition: control_command.h:133
control_command_mode_t mode
Control command mode.
Definition: control_command.h:171
attitude_command_mode_t mode
Command mode, defines whether the quaternion or the rpy angles should be used.
Definition: control_command.h:126
float thrust
Thrust command.
Definition: control_command.h:153
velocity_command_t velocity
Velocity command.
Definition: control_command.h:177
Thrust command type for vehicles with multi-lifting devices.
Definition: control_command.h:160
position_command_mode_t mode
Command mode, defines whether the position is given in local or global frame.
Definition: control_command.h:105
quat_t quat
Attitude quaternion.
Definition: control_command.h:124
position_command_t position
Position command.
Definition: control_command.h:176