MAV'RIC
adaptive_parameter.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 adaptive_parameter.h
34  *
35  * \author MAV'RIC Team
36  * \author Julien Lecoeur
37  *
38  * \brief This module automatically adapts the existing parameters based on
39  * given control variable
40  *
41  ******************************************************************************/
42 
43 
44 #ifndef ADAPTIVE_PARAMETER_H_
45 #define ADAPTIVE_PARAMETER_H_
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #include "stdint.h"
52 
53 #define MAX_ADAPT_PARAM_SETPOINTS 5
54 #define MAX_ADAPT_PARAM_COUNT 10
55 
56 
60 typedef struct
61 {
63  float* parameter;
64  int32_t nb_setpoints;
65  float setpoints[MAX_ADAPT_PARAM_SETPOINTS];
66  float setvalues[MAX_ADAPT_PARAM_SETPOINTS];
68 
69 
73 typedef struct
74 {
75  int32_t param_count;
76  adaptive_parameter_t parameters[MAX_ADAPT_PARAM_COUNT];
78 
84 adaptive_parameter_set_t* adaptive_parameter_get_param_set(void);
85 
89 void adaptive_parameter_init(void);
90 
102 int32_t adaptive_parameter_add( float* control_variable,
103  float* parameter,
104  int32_t nb_setpoints,
105  float* setpoints,
106  float* setvalues);
112 void adaptive_parameter_update(adaptive_parameter_t param);
113 
117 void adaptive_parameter_update_all(void);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* ADAPTIVE_PARAMETER_H_ */
Adaptive parameter structure.
Definition: adaptive_parameter.h:60
float * parameter
Parameter.
Definition: adaptive_parameter.h:63
Adaptive parameter set structure.
Definition: adaptive_parameter.h:73
int32_t nb_setpoints
Number of setpoints.
Definition: adaptive_parameter.h:64
int32_t param_count
Number of Parameters.
Definition: adaptive_parameter.h:75
float * control_variable
Control Variable.
Definition: adaptive_parameter.h:62