yocto_refframe.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_refframe.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindRefFrame(), the high-level API for RefFrame functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 
41 #ifndef YOCTO_REFFRAME_H
42 #define YOCTO_REFFRAME_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YRefFrame return codes)
50 //--- (end of YRefFrame return codes)
51 //--- (YRefFrame definitions)
52 class YRefFrame; // forward declaration
53 
54 typedef void (*YRefFrameValueCallback)(YRefFrame *func, const string& functionValue);
55 #ifndef _Y_FUSIONMODE_ENUM
56 #define _Y_FUSIONMODE_ENUM
57 typedef enum {
65 #endif
66  #ifndef _Y_MOUNTPOSITION
67  #define _Y_MOUNTPOSITION
68  typedef enum {
77  #endif
78 
79  #ifndef _Y_MOUNTORIENTATION
80  #define _Y_MOUNTORIENTATION
81  typedef enum {
88  #endif
89 
90 #define Y_MOUNTPOS_INVALID (YAPI_INVALID_UINT)
91 #define Y_BEARING_INVALID (YAPI_INVALID_DOUBLE)
92 #define Y_CALIBRATIONPARAM_INVALID (YAPI_INVALID_STRING)
93 //--- (end of YRefFrame definitions)
94 
95 //--- (YRefFrame declaration)
106 #ifdef __BORLANDC__
107 #pragma option push -w-8022
108 #endif
109 //--- (end of YRefFrame declaration)
110 protected:
111  //--- (YRefFrame attributes)
112  // Attributes (function value cache)
114  double _bearing;
118  bool _calibV2;
123  string _calibLogMsg;
128  vector<int> _calibOrient;
129  vector<double> _calibDataAccX;
130  vector<double> _calibDataAccY;
131  vector<double> _calibDataAccZ;
132  vector<double> _calibDataAcc;
139 
140  friend YRefFrame *yFindRefFrame(const string& func);
141  friend YRefFrame *yFirstRefFrame(void);
142 
143  // Function-specific method for parsing of JSON output and caching result
144  virtual int _parseAttr(YJSONObject* json_val);
145 
146  // Constructor is protected, use yFindRefFrame factory function to instantiate
147  YRefFrame(const string& func);
148  //--- (end of YRefFrame attributes)
149 
150 public:
151  ~YRefFrame();
152  //--- (YRefFrame accessors declaration)
153 
154  static const int MOUNTPOS_INVALID = YAPI_INVALID_UINT;
155  static const double BEARING_INVALID;
156  static const string CALIBRATIONPARAM_INVALID;
157  static const Y_FUSIONMODE_enum FUSIONMODE_NDOF = Y_FUSIONMODE_NDOF;
158  static const Y_FUSIONMODE_enum FUSIONMODE_NDOF_FMC_OFF = Y_FUSIONMODE_NDOF_FMC_OFF;
159  static const Y_FUSIONMODE_enum FUSIONMODE_M4G = Y_FUSIONMODE_M4G;
160  static const Y_FUSIONMODE_enum FUSIONMODE_COMPASS = Y_FUSIONMODE_COMPASS;
161  static const Y_FUSIONMODE_enum FUSIONMODE_IMU = Y_FUSIONMODE_IMU;
162  static const Y_FUSIONMODE_enum FUSIONMODE_INVALID = Y_FUSIONMODE_INVALID;
163  static const Y_MOUNTPOSITION MOUNTPOSITION_BOTTOM = Y_MOUNTPOSITION_BOTTOM;
164  static const Y_MOUNTPOSITION MOUNTPOSITION_TOP = Y_MOUNTPOSITION_TOP;
165  static const Y_MOUNTPOSITION MOUNTPOSITION_FRONT = Y_MOUNTPOSITION_FRONT;
166  static const Y_MOUNTPOSITION MOUNTPOSITION_REAR = Y_MOUNTPOSITION_REAR;
167  static const Y_MOUNTPOSITION MOUNTPOSITION_RIGHT = Y_MOUNTPOSITION_RIGHT;
168  static const Y_MOUNTPOSITION MOUNTPOSITION_LEFT = Y_MOUNTPOSITION_LEFT;
169  static const Y_MOUNTPOSITION MOUNTPOSITION_INVALID = Y_MOUNTPOSITION_INVALID;
170  static const Y_MOUNTORIENTATION MOUNTORIENTATION_TWELVE = Y_MOUNTORIENTATION_TWELVE;
171  static const Y_MOUNTORIENTATION MOUNTORIENTATION_THREE = Y_MOUNTORIENTATION_THREE;
172  static const Y_MOUNTORIENTATION MOUNTORIENTATION_SIX = Y_MOUNTORIENTATION_SIX;
173  static const Y_MOUNTORIENTATION MOUNTORIENTATION_NINE = Y_MOUNTORIENTATION_NINE;
174  static const Y_MOUNTORIENTATION MOUNTORIENTATION_INVALID = Y_MOUNTORIENTATION_INVALID;
175 
176  int get_mountPos(void);
177 
178  inline int mountPos(void)
179  { return this->get_mountPos(); }
180 
181  int set_mountPos(int newval);
182  inline int setMountPos(int newval)
183  { return this->set_mountPos(newval); }
184 
207  int set_bearing(double newval);
208  inline int setBearing(double newval)
209  { return this->set_bearing(newval); }
210 
220  double get_bearing(void);
221 
222  inline double bearing(void)
223  { return this->get_bearing(); }
224 
225  string get_calibrationParam(void);
226 
227  inline string calibrationParam(void)
228  { return this->get_calibrationParam(); }
229 
230  int set_calibrationParam(const string& newval);
231  inline int setCalibrationParam(const string& newval)
232  { return this->set_calibrationParam(newval); }
233 
234  Y_FUSIONMODE_enum get_fusionMode(void);
235 
237  { return this->get_fusionMode(); }
238 
239  int set_fusionMode(Y_FUSIONMODE_enum newval);
240  inline int setFusionMode(Y_FUSIONMODE_enum newval)
241  { return this->set_fusionMode(newval); }
242 
270  static YRefFrame* FindRefFrame(string func);
271 
283  virtual int registerValueCallback(YRefFrameValueCallback callback);
285 
286  virtual int _invokeValueCallback(string value);
287 
301  virtual Y_MOUNTPOSITION get_mountPosition(void);
302 
318  virtual Y_MOUNTORIENTATION get_mountOrientation(void);
319 
345  virtual int set_mountPosition(Y_MOUNTPOSITION position,Y_MOUNTORIENTATION orientation);
346 
361  virtual int get_calibrationState(void);
362 
376  virtual int get_measureQuality(void);
377 
378  virtual int _calibSort(int start,int stopidx);
379 
396  virtual int start3DCalibration(void);
397 
408  virtual int more3DCalibration(void);
409 
410  virtual int more3DCalibrationV1(void);
411 
412  virtual int more3DCalibrationV2(void);
413 
420  virtual string get_3DCalibrationHint(void);
421 
428  virtual int get_3DCalibrationProgress(void);
429 
436  virtual int get_3DCalibrationStage(void);
437 
444  virtual int get_3DCalibrationStageProgress(void);
445 
452  virtual string get_3DCalibrationLogMsg(void);
453 
461  virtual int save3DCalibration(void);
462 
463  virtual int save3DCalibrationV1(void);
464 
465  virtual int save3DCalibrationV2(void);
466 
472  virtual int cancel3DCalibration(void);
473 
474 
475  inline static YRefFrame* Find(string func)
476  { return YRefFrame::FindRefFrame(func); }
477 
485  YRefFrame *nextRefFrame(void);
486  inline YRefFrame *next(void)
487  { return this->nextRefFrame();}
488 
498  static YRefFrame* FirstRefFrame(void);
499  inline static YRefFrame* First(void)
500  { return YRefFrame::FirstRefFrame();}
501 #ifdef __BORLANDC__
502 #pragma option pop
503 #endif
504  //--- (end of YRefFrame accessors declaration)
505 };
506 
507 //--- (YRefFrame functions declaration)
508 
536 inline YRefFrame* yFindRefFrame(const string& func)
537 { return YRefFrame::FindRefFrame(func);}
548 { return YRefFrame::FirstRefFrame();}
549 
550 //--- (end of YRefFrame functions declaration)
551 
552 #endif
static const string CALIBRATIONPARAM_INVALID
YRefFrame * yFirstRefFrame(void)
Y_FUSIONMODE_enum
double _calibAccXScale
static YRefFrame * FirstRefFrame(void)
string _calibStageHint
double _calibAccZOfs
double _bearing
ROSCPP_DECL void start()
int setMountPos(int newval)
vector< double > _calibDataAccY
int _calibInternalPos
double _calibAccZScale
double _calibAccXOfs
string calibrationParam(void)
string _calibLogMsg
int setCalibrationParam(const string &newval)
YRefFrame * next(void)
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
vector< int > _calibOrient
vector< double > _calibDataAccZ
int mountPos(void)
int _calibStageProgress
double _calibAccYScale
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
int setBearing(double newval)
void(* YRefFrameValueCallback)(YRefFrame *func, const string &functionValue)
static YRefFrame * First(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
double bearing(void)
YRefFrame * yFindRefFrame(const string &func)
static YRefFrame * Find(string func)
int _calibPrevTick
YRefFrameValueCallback _valueCallbackRefFrame
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
Y_MOUNTORIENTATION
Y_FUSIONMODE_enum _fusionMode
static const double BEARING_INVALID
Y_FUSIONMODE_enum fusionMode(void)
int _calibProgress
static YRefFrame * FindRefFrame(string func)
Y_MOUNTPOSITION
double _calibAccYOfs
vector< double > _calibDataAcc
int setFusionMode(Y_FUSIONMODE_enum newval)
string _calibSavedParams
vector< double > _calibDataAccX
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
string _calibrationParam


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:11