2 #include <Maths/maths.h>
3 #include <Maths/matrices.h>
5 #undef ARDRONE_CONFIG_KEY_IMM
6 #undef ARDRONE_CONFIG_KEY_REF
7 #undef ARDRONE_CONFIG_KEY_STR
8 #include <config_keys.h>
10 const vector31_t default_accs_offset = {{{ -2048.0f, 2048.0f, 2048.0f}}};
11 const matrix33_t default_accs_gain = {1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f };
12 const vector31_t default_gyros_offset = {{{ 1662.5f, 1662.5f, 1662.5f}}};
13 const vector31_t default_gyros_gains = {{{ 395.0f * MDEG_TO_RAD, -395.0f * MDEG_TO_RAD, -207.5f * MDEG_TO_RAD }}};
14 const vector21_t default_gyros110_offset = {{ 1662.5f, 1662.5f}};
15 const vector21_t default_gyros110_gains = {{ 87.5f * MDEG_TO_RAD, -87.5f * MDEG_TO_RAD }};
17 /* Stephane - multiconfiguration support */
19 /* Those data are present both on the client and the drone side */
21 const char * custom_configuration_id_keys[NB_CONFIG_CATEGORIES+1]=
24 "custom:application_desc",
25 "custom:profile_desc",
26 "custom:session_desc",
29 const char * custom_configuration_headers[NB_CONFIG_CATEGORIES+1]=
37 const char *configuration_switching_commands[NB_CONFIG_CATEGORIES+1]=
40 "custom:application_id",
46 custom_configuration_list_t available_configurations[NB_CONFIG_CATEGORIES];
49 /* Stephane - multiconfiguration support */
51 C_RESULT configuration_check_config_id_char(const char session_id_char)
53 char c = session_id_char;
54 return ( (c>='a' && c<='f') || (c>='A' && c<='F') || (c>='0' && c<='9') );
57 C_RESULT configuration_check_config_id(const char * session_id)
61 // Session IDs should be strings containing a 32-bit integer hexadecimal representation
62 if (session_id==NULL) return C_FAIL;
63 for (i=0;i<CUSTOM_CONFIGURATION_ID_LENGTH;i++){
65 if (c==0) { return C_FAIL; } /* string is too short */
66 if (!(configuration_check_config_id_char(c))) { return C_FAIL; } /* character is invalid */
68 if (session_id[i]!=0) { return C_FAIL; } /* string is too long */