|
virtual int | _calibSort (int start, int stopidx) |
|
virtual int | _invokeValueCallback (string value) |
|
double | bearing (void) |
|
string | calibrationParam (void) |
|
virtual int | cancel3DCalibration (void) |
|
Y_FUSIONMODE_enum | fusionMode (void) |
|
virtual string | get_3DCalibrationHint (void) |
|
virtual string | get_3DCalibrationLogMsg (void) |
|
virtual int | get_3DCalibrationProgress (void) |
|
virtual int | get_3DCalibrationStage (void) |
|
virtual int | get_3DCalibrationStageProgress (void) |
|
double | get_bearing (void) |
|
string | get_calibrationParam (void) |
|
virtual int | get_calibrationState (void) |
|
Y_FUSIONMODE_enum | get_fusionMode (void) |
|
virtual int | get_measureQuality (void) |
|
virtual Y_MOUNTORIENTATION | get_mountOrientation (void) |
|
int | get_mountPos (void) |
|
virtual Y_MOUNTPOSITION | get_mountPosition (void) |
|
virtual int | more3DCalibration (void) |
|
virtual int | more3DCalibrationV1 (void) |
|
virtual int | more3DCalibrationV2 (void) |
|
int | mountPos (void) |
|
YRefFrame * | next (void) |
|
YRefFrame * | nextRefFrame (void) |
|
virtual int | registerValueCallback (YRefFrameValueCallback callback) |
|
virtual int | save3DCalibration (void) |
|
virtual int | save3DCalibrationV1 (void) |
|
virtual int | save3DCalibrationV2 (void) |
|
int | set_bearing (double newval) |
|
int | set_calibrationParam (const string &newval) |
|
int | set_fusionMode (Y_FUSIONMODE_enum newval) |
|
int | set_mountPos (int newval) |
|
virtual int | set_mountPosition (Y_MOUNTPOSITION position, Y_MOUNTORIENTATION orientation) |
|
int | setBearing (double newval) |
|
int | setCalibrationParam (const string &newval) |
|
int | setFusionMode (Y_FUSIONMODE_enum newval) |
|
int | setMountPos (int newval) |
|
virtual int | start3DCalibration (void) |
|
| ~YRefFrame () |
|
void | _clearDataStreamCache () |
|
string | _decode_json_string (const string &json) |
|
string | _download (const string &url) |
|
YDataStream * | _findDataStream (YDataSet &dataset, const string &def) |
|
string | _get_json_path (const string &json, const string &path) |
|
vector< string > | _json_get_array (const string &json) |
|
string | _json_get_key (const string &json, const string &data) |
|
string | _json_get_string (const string &json) |
|
int | _parseEx (yJsonStateMachine &j) |
|
virtual int | _parserHelper (void) |
|
string | _parseString (yJsonStateMachine &j) |
|
string | _request (const string &request) |
|
string | _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context) |
|
void | _throw (YRETCODE errType, string errMsg) |
|
YRETCODE | _upload (const string &path, const string &content) |
|
YRETCODE | _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context) |
|
string | advertisedValue (void) |
|
void | clearCache () |
|
string | describe (void) |
|
string | errMessage (void) |
|
string | errorMessage (void) |
|
YRETCODE | errorType (void) |
|
YRETCODE | errType (void) |
|
YFUN_DESCR | functionDescriptor (void) |
|
string | get_advertisedValue (void) |
|
string | get_errorMessage (void) |
|
YRETCODE | get_errorType (void) |
|
virtual string | get_friendlyName (void) |
|
YFUN_DESCR | get_functionDescriptor (void) |
|
string | get_functionId (void) |
|
string | get_hardwareId (void) |
|
string | get_hubSerial () |
|
string | get_logicalName (void) |
|
YModule * | get_module (void) |
|
void * | get_userData (void) |
|
bool | isOnline (void) |
|
YRETCODE | load (int msValidity) |
|
virtual string | loadAttribute (string attrName) |
|
string | logicalName (void) |
|
YModule * | module (void) |
|
virtual int | muteValueCallbacks (void) |
|
YFunction * | next (void) |
|
YFunction * | nextFunction (void) |
|
virtual int | registerValueCallback (YFunctionValueCallback callback) |
|
int | set_advertisedValue (const string &newval) |
|
int | set_logicalName (const string &newval) |
|
void | set_userData (void *data) |
|
int | setAdvertisedValue (const string &newval) |
|
int | setLogicalName (const string &newval) |
|
void | setUserData (void *data) |
|
virtual int | unmuteValueCallbacks (void) |
|
void * | userData (void) |
|
virtual | ~YFunction () |
|
YRefFrame Class: Reference frame configuration
This class is used to setup the base orientation of the Yocto-3D, so that the orientation functions, relative to the earth surface plane, use the proper reference frame. The class also implements a tridimensional sensor calibration process, which can compensate for local variations of standard gravity and improve the precision of the tilt sensors.
Definition at line 105 of file yocto_refframe.h.
YRefFrame * YRefFrame::FindRefFrame |
( |
string |
func | ) |
|
|
static |
Retrieves a reference frame for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the reference frame is online at the time it is invoked. The returned object is nevertheless valid. Use the method YRefFrame.isOnline() to test if the reference frame is indeed online at a given time. In case of ambiguity when looking for a reference frame by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the reference frame |
- Returns
- a YRefFrame object allowing you to drive the reference frame.
Definition at line 314 of file yocto_refframe.cpp.
int YRefFrame::get_calibrationState |
( |
void |
| ) |
|
|
virtual |
Returns the 3D sensor calibration state (Yocto-3D-V2 only). This function returns an integer representing the calibration state of the 3 inertial sensors of the BNO055 chip, found in the Yocto-3D-V2. Hundredths show the calibration state of the accelerometer, tenths show the calibration state of the magnetometer while units show the calibration state of the gyroscope. For each sensor, the value 0 means no calibration and the value 3 means full calibration.
- Returns
- an integer representing the calibration state of Yocto-3D-V2: 333 when fully calibrated, 0 when not calibrated at all.
On failure, throws an exception or returns a negative error code. For the Yocto-3D (V1), this function always return -3 (unsupported function).
Definition at line 469 of file yocto_refframe.cpp.
int YRefFrame::get_measureQuality |
( |
void |
| ) |
|
|
virtual |
Returns estimated quality of the orientation (Yocto-3D-V2 only). This function returns an integer between 0 and 3 representing the degree of confidence of the position estimate. When the value is 3, the estimation is reliable. Below 3, one should expect sudden corrections, in particular for heading (compass function). The most frequent causes for values below 3 are magnetic interferences, and accelerations or rotations beyond the sensor range.
- Returns
- an integer between 0 and 3 (3 when the measure is reliable)
On failure, throws an exception or returns a negative error code. For the Yocto-3D (V1), this function always return -3 (unsupported function).
Definition at line 499 of file yocto_refframe.cpp.
int YRefFrame::more3DCalibration |
( |
void |
| ) |
|
|
virtual |
Continues the sensors tridimensional calibration process previously initiated using method start3DCalibration. This method should be called approximately 5 times per second, while positioning the device according to the instructions provided by method get_3DCalibrationHint. Note that the instructions change during the calibration process.
On failure, throws an exception or returns a negative error code.
Definition at line 609 of file yocto_refframe.cpp.
int YRefFrame::set_bearing |
( |
double |
newval | ) |
|
Changes the reference bearing used by the compass. The relative bearing indicated by the compass is the difference between the measured magnetic heading and the reference bearing indicated here.
For instance, if you setup as reference bearing the value of the earth magnetic declination, the compass will provide the orientation relative to the geographic North.
Similarly, when the sensor is not mounted along the standard directions because it has an additional yaw angle, you can set this angle in the reference bearing so that the compass provides the expected natural direction.
Remember to call the saveToFlash() method of the module if the modification must be kept.
- Parameters
-
newval | : a floating point number corresponding to the reference bearing used by the compass |
- Returns
- YAPI_SUCCESS if the call succeeds.
On failure, throws an exception or returns a negative error code.
Definition at line 164 of file yocto_refframe.cpp.
Changes the compass and tilt sensor frame of reference. The magnetic compass and the tilt sensors (pitch and roll) naturally work in the plane parallel to the earth surface. In case the device is not installed upright and horizontally, you must select its reference orientation (parallel to the earth surface) so that the measures are made relative to this position.
- Parameters
-
position | : a value among the Y_MOUNTPOSITION enumeration (Y_MOUNTPOSITION_BOTTOM, Y_MOUNTPOSITION_TOP, Y_MOUNTPOSITION_FRONT, Y_MOUNTPOSITION_RIGHT, Y_MOUNTPOSITION_REAR, Y_MOUNTPOSITION_LEFT), corresponding to the installation in a box, on one of the six faces. |
orientation | : a value among the enumeration Y_MOUNTORIENTATION (Y_MOUNTORIENTATION_TWELVE, Y_MOUNTORIENTATION_THREE, Y_MOUNTORIENTATION_SIX, Y_MOUNTORIENTATION_NINE) corresponding to the orientation of the "X" arrow on the device, as on a clock dial seen from an observer in the center of the box. On the bottom face, the 12H orientation points to the front, while on the top face, the 12H orientation points to the rear. |
Remember to call the saveToFlash() method of the module if the modification must be kept.
On failure, throws an exception or returns a negative error code.
Definition at line 448 of file yocto_refframe.cpp.
int YRefFrame::start3DCalibration |
( |
void |
| ) |
|
|
virtual |
Initiates the sensors tridimensional calibration process. This calibration is used at low level for inertial position estimation and to enhance the precision of the tilt sensors.
After calling this method, the device should be moved according to the instructions provided by method get_3DCalibrationHint, and more3DCalibration should be invoked about 5 times per second. The calibration procedure is completed when the method get_3DCalibrationProgress returns 100. At this point, the computed calibration parameters can be applied using method save3DCalibration. The calibration process can be canceled at any time using method cancel3DCalibration.
On failure, throws an exception or returns a negative error code.
Definition at line 573 of file yocto_refframe.cpp.
YRefFrame* yFindRefFrame |
( |
const string & |
func | ) |
|
|
friend |
Retrieves a reference frame for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the reference frame is online at the time it is invoked. The returned object is nevertheless valid. Use the method YRefFrame.isOnline() to test if the reference frame is indeed online at a given time. In case of ambiguity when looking for a reference frame by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the reference frame |
- Returns
- a YRefFrame object allowing you to drive the reference frame.
Definition at line 536 of file yocto_refframe.h.