public class YGyro extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YGyro.TimedReportCallback
TimedReportCallback for Gyro
|
static interface |
YGyro.UpdateCallback
Deprecated UpdateCallback for Gyro
|
static interface |
YGyro.YAnglesCallback |
static interface |
YGyro.YQuatCallback |
Modifier and Type | Field and Description |
---|---|
protected int |
_angles_stamp |
protected YGyro.YAnglesCallback |
_anglesCallback |
protected int |
_bandwidth |
protected double |
_head |
protected double |
_pitch |
protected int |
_qt_stamp |
protected YQt |
_qt_w |
protected YQt |
_qt_x |
protected YQt |
_qt_y |
protected YQt |
_qt_z |
protected YGyro.YQuatCallback |
_quatCallback |
protected double |
_roll |
protected YGyro.TimedReportCallback |
_timedReportCallbackGyro |
protected YGyro.UpdateCallback |
_valueCallbackGyro |
protected double |
_w |
protected double |
_x |
protected double |
_xValue |
protected double |
_y |
protected double |
_yValue |
protected double |
_z |
protected double |
_zValue |
static int |
BANDWIDTH_INVALID
invalid bandwidth value
|
static double |
XVALUE_INVALID
invalid xValue value
|
static double |
YVALUE_INVALID
invalid yValue value
|
static double |
ZVALUE_INVALID
invalid zValue value
|
_advMode, _calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _isScal, _isScal32, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, ADVMODE_IMMEDIATE, ADVMODE_INVALID, ADVMODE_PERIOD_AVG, ADVMODE_PERIOD_MAX, ADVMODE_PERIOD_MIN, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, SENSORSTATE_INVALID, UNIT_INVALID
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YGyro(String func) |
protected |
YGyro(YAPIContext yctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeGyroCallbacks(int qtIndex,
double qtValue) |
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
int |
_loadAngles() |
int |
_loadQuaternion() |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YGyro |
FindGyro(String func)
Retrieves a gyroscope for a given identifier.
|
static YGyro |
FindGyroInContext(YAPIContext yctx,
String func)
Retrieves a gyroscope for a given identifier in a YAPI context.
|
static YGyro |
FirstGyro()
Starts the enumeration of gyroscopes currently accessible.
|
static YGyro |
FirstGyroInContext(YAPIContext yctx)
Starts the enumeration of gyroscopes currently accessible.
|
int |
get_bandwidth()
Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
double |
get_heading()
Returns the estimated heading angle, based on the integration of
gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_pitch()
Returns the estimated pitch angle, based on the integration of
gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_quaternionW()
Returns the w component (real part) of the quaternion
describing the device estimated orientation, based on the
integration of gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_quaternionX()
Returns the x component of the quaternion
describing the device estimated orientation, based on the
integration of gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_quaternionY()
Returns the y component of the quaternion
describing the device estimated orientation, based on the
integration of gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_quaternionZ()
Returns the x component of the quaternion
describing the device estimated orientation, based on the
integration of gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_roll()
Returns the estimated roll angle, based on the integration of
gyroscopic measures combined with acceleration and
magnetic field measurements.
|
double |
get_xValue()
Returns the angular velocity around the X axis of the device, as a floating point number.
|
double |
get_yValue()
Returns the angular velocity around the Y axis of the device, as a floating point number.
|
double |
get_zValue()
Returns the angular velocity around the Z axis of the device, as a floating point number.
|
int |
getBandwidth()
Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
double |
getXValue()
Returns the angular velocity around the X axis of the device, as a floating point number.
|
double |
getYValue()
Returns the angular velocity around the Y axis of the device, as a floating point number.
|
double |
getZValue()
Returns the angular velocity around the Z axis of the device, as a floating point number.
|
YGyro |
nextGyro()
Continues the enumeration of gyroscopes started using yFirstGyro().
|
int |
registerAnglesCallback(YGyro.YAnglesCallback callback)
Registers a callback function that will be invoked each time that the estimated
device orientation has changed.
|
int |
registerQuaternionCallback(YGyro.YQuatCallback callback)
Registers a callback function that will be invoked each time that the estimated
device orientation has changed.
|
int |
registerTimedReportCallback(YGyro.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YGyro.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_bandwidth(int newval)
Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
int |
setBandwidth(int newval)
Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parserHelper, calibrateFromPoints, FindSensor, FindSensorInContext, FirstSensor, FirstSensorInContext, get_advMode, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getAdvMode, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_advMode, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setAdvMode, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int BANDWIDTH_INVALID
public static final double XVALUE_INVALID
public static final double YVALUE_INVALID
public static final double ZVALUE_INVALID
protected int _bandwidth
protected double _xValue
protected double _yValue
protected double _zValue
protected YGyro.UpdateCallback _valueCallbackGyro
protected YGyro.TimedReportCallback _timedReportCallbackGyro
protected int _qt_stamp
protected YQt _qt_w
protected YQt _qt_x
protected YQt _qt_y
protected YQt _qt_z
protected double _w
protected double _x
protected double _y
protected double _z
protected int _angles_stamp
protected double _head
protected double _pitch
protected double _roll
protected YGyro.YQuatCallback _quatCallback
protected YGyro.YAnglesCallback _anglesCallback
protected YGyro(YAPIContext yctx, String func)
func
- : functionidprotected YGyro(String func)
protected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YSensor
Exception
public int get_bandwidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBandwidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_bandwidth(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)YAPI_Exception
- on errorpublic int setBandwidth(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)YAPI_Exception
- on errorpublic double get_xValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getXValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_yValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getYValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_zValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getZValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic static YGyro FindGyro(String func)
func
- : a string that uniquely characterizes the gyroscopepublic static YGyro FindGyroInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the gyroscopepublic int registerValueCallback(YGyro.UpdateCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YSensor
public int registerTimedReportCallback(YGyro.TimedReportCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback
in class YSensor
public int _loadQuaternion() throws YAPI_Exception
YAPI_Exception
public int _loadAngles() throws YAPI_Exception
YAPI_Exception
public double get_roll() throws YAPI_Exception
YAPI_Exception
public double get_pitch() throws YAPI_Exception
YAPI_Exception
public double get_heading() throws YAPI_Exception
YAPI_Exception
public double get_quaternionW() throws YAPI_Exception
YAPI_Exception
public double get_quaternionX() throws YAPI_Exception
YAPI_Exception
public double get_quaternionY() throws YAPI_Exception
YAPI_Exception
public double get_quaternionZ() throws YAPI_Exception
YAPI_Exception
public int registerQuaternionCallback(YGyro.YQuatCallback callback) throws YAPI_Exception
callback
- : the callback function to invoke, or a null pointer.
The callback function should take five arguments:
the YGyro object of the turning device, and the floating
point values of the four components w, x, y and z
(as floating-point numbers).YAPI_Exception
public int registerAnglesCallback(YGyro.YAnglesCallback callback) throws YAPI_Exception
callback
- : the callback function to invoke, or a null pointer.
The callback function should take four arguments:
the YGyro object of the turning device, and the floating
point values of the three angles roll, pitch and heading
in degrees (as floating-point numbers).YAPI_Exception
public int _invokeGyroCallbacks(int qtIndex, double qtValue) throws YAPI_Exception
YAPI_Exception
public YGyro nextGyro()
public static YGyro FirstGyro()
public static YGyro FirstGyroInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.