Developer World
Spresense SDK Library v3.2.0-ebc0364
compass_command.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/sensing/logical_sensor/compass_command.h
3 *
4 * Copyright 2018 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
36#ifndef __INCLUDE_SENSING_COMPASS_COMMAND_H
37#define __INCLUDE_SENSING_COMPASS_COMMAND_H
38
44/****************************************************************************
45 * Included Files
46 ****************************************************************************/
47
48#include <stdint.h>
49#include <stddef.h>
50
53
58#ifdef __cplusplus
59extern "C" {
60#endif /* __cplusplus */
61
62/****************************************************************************
63 * Pre-processor Definitions
64 ****************************************************************************/
65
70#define COMPASS_ACCEL_SAMPLING_MAX 16
75#define COMPASS_MAG_SAMPLING_MAX 8
76
77/****************************************************************************
78 * Public Types
79 ****************************************************************************/
80
85typedef enum {
103
108typedef enum {
113
114/*--------------------------------------------------------------------------
115 * Command Structures
116 *--------------------------------------------------------------------------
117 */
122{
123 void *addr;
124 size_t size;
125};
126
127/*--------------------------------------------------------------------------*/
132typedef struct {
133
137
138/*--------------------------------------------------------------------------*/
143typedef struct {
144 float tilt_yaw;
148 float gain_x;
149 float gain_y;
150 float gain_z;
152
157typedef struct {
158
161 union {
168 };
169
171
172/*--------------------------------------------------------------------------*/
177typedef struct {
178
180
181/*--------------------------------------------------------------------------*/
188typedef struct{
189
190 float azimuth;
195 float pitch;
199 float roll;
203 float decl;
216
217/*--------------------------------------------------------------------------*/
222typedef struct
223{
226 union
227 {
230 };
232
233/*--------------------------------------------------------------------------*/
239typedef struct
240{
243 union
244 {
248 };
249
252
253#ifdef __cplusplus
254};
255#endif
256
261#endif /* __INCLUDE_SENSING_COMPASS_COMMAND_H */
262
CompassWalkStateType
Sensor state specified by COMPASS_CMD_SET_WALKSTATE.
Definition: compass_command.h:108
CompassCmdType
Publishers.
Definition: compass_command.h:85
@ COMPASS_WALK_STATE_DISABLED
Definition: compass_command.h:109
@ COMPASS_WALK_STATE_STOPPING
Definition: compass_command.h:110
@ COMPASS_WALK_STATE_WALKING
Definition: compass_command.h:111
@ COMPASS_CMD_UPDATE_MAG
Definition: compass_command.h:89
@ COMPASS_CMD_RESET_CALIB
Definition: compass_command.h:98
@ COMPASS_CMD_SET_SOFTIRON_PARAM
Definition: compass_command.h:92
@ COMPASS_CMD_UPDATE_ACCEL
Definition: compass_command.h:86
@ COMPASS_CMD_SET_WALKSTATE
Definition: compass_command.h:95
SensorExecResult
results.
Definition: sensor_command.h:113
the structure of Compass results. the result is returned only when COMPASS_CMD_UPDATE_MAG is specifie...
Definition: compass_command.h:188
float azimuth
Definition: compass_command.h:190
float roll
Definition: compass_command.h:199
float pitch
Definition: compass_command.h:195
int acc_azimuth
Definition: compass_command.h:208
float decl
Definition: compass_command.h:203
int calib_lv
Definition: compass_command.h:211
Definition: compass_command.h:122
size_t size
Definition: compass_command.h:124
void * addr
Definition: compass_command.h:123
Adjust parameter of magnetometer sensor.
Definition: compass_command.h:143
float gain_y
Definition: compass_command.h:149
float gain_z
Definition: compass_command.h:150
float rot_dist_pitch
Definition: compass_command.h:147
float tilt_yaw
Definition: compass_command.h:144
float gain_x
Definition: compass_command.h:148
float tilt_pitch
Definition: compass_command.h:145
float rot_dist_yaw
Definition: compass_command.h:146
Assert information structure.
Definition: sensor_assertion.h:91
the structure of compass commands.
Definition: compass_command.h:240
SensorFlushCompass flush_cmd
Definition: compass_command.h:247
SensorExecCompass exec_cmd
Definition: compass_command.h:246
SensorInitCompass init_cmd
Definition: compass_command.h:245
SensorCmdHeader header
Definition: compass_command.h:241
SensorResultCompass result
Definition: compass_command.h:250
the header of sensor commands.
Definition: sensor_command.h:126
the command of Compass execute by a frame(a few sample).
Definition: compass_command.h:157
ThreeAxisSampleData update_three_axis
Definition: compass_command.h:162
CompassCmdType cmd_type
Definition: compass_command.h:159
CompassWalkStateType walk_state
Definition: compass_command.h:167
CompassSetSoftIron soft_iron
Definition: compass_command.h:163
the command of compass terminate.
Definition: compass_command.h:177
the structure of Accelstep setting for initilaize.
Definition: compass_command.h:132
CompassDebugDumpInfo debug_dump_info
Definition: compass_command.h:134
the structure of sensor result on compass commands.
Definition: compass_command.h:223
CompassData compass
Definition: compass_command.h:228
SensorAssertionInfo assert_info
Definition: compass_command.h:229
SensorExecResult exec_result
Definition: compass_command.h:224
Definition: physical_command.h:95