Source code for pyupm_curieimu

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.





from sys import version_info
if version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_pyupm_curieimu', [dirname(__file__)])
        except ImportError:
            import _pyupm_curieimu
            return _pyupm_curieimu
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_curieimu', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_curieimu = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_curieimu
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)

def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0



def getVersion():
    return _pyupm_curieimu.getVersion()
getVersion = _pyupm_curieimu.getVersion
[docs]class int16Array(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, int16Array, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, int16Array, name) __repr__ = _swig_repr def __init__(self, nelements): this = _pyupm_curieimu.new_int16Array(nelements) try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_curieimu.delete_int16Array __del__ = lambda self: None def __getitem__(self, index): return _pyupm_curieimu.int16Array___getitem__(self, index) def __setitem__(self, index, value): return _pyupm_curieimu.int16Array___setitem__(self, index, value)
[docs] def cast(self): return _pyupm_curieimu.int16Array_cast(self)
__swig_getmethods__["frompointer"] = lambda x: _pyupm_curieimu.int16Array_frompointer if _newclass: frompointer = staticmethod(_pyupm_curieimu.int16Array_frompointer)
int16Array_swigregister = _pyupm_curieimu.int16Array_swigregister int16Array_swigregister(int16Array) def int16Array_frompointer(t): return _pyupm_curieimu.int16Array_frompointer(t) int16Array_frompointer = _pyupm_curieimu.int16Array_frompointer _pyupm_curieimu.FIRMATA_START_SYSEX_swigconstant(_pyupm_curieimu) FIRMATA_START_SYSEX = _pyupm_curieimu.FIRMATA_START_SYSEX _pyupm_curieimu.FIRMATA_END_SYSEX_swigconstant(_pyupm_curieimu) FIRMATA_END_SYSEX = _pyupm_curieimu.FIRMATA_END_SYSEX _pyupm_curieimu.FIRMATA_CURIE_IMU_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU = _pyupm_curieimu.FIRMATA_CURIE_IMU _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_ACCEL_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_READ_ACCEL = _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_ACCEL _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_GYRO_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_READ_GYRO = _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_GYRO _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_TEMP_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_READ_TEMP = _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_TEMP _pyupm_curieimu.FIRMATA_CURIE_IMU_SHOCK_DETECT_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_SHOCK_DETECT = _pyupm_curieimu.FIRMATA_CURIE_IMU_SHOCK_DETECT _pyupm_curieimu.FIRMATA_CURIE_IMU_STEP_COUNTER_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_STEP_COUNTER = _pyupm_curieimu.FIRMATA_CURIE_IMU_STEP_COUNTER _pyupm_curieimu.FIRMATA_CURIE_IMU_TAP_DETECT_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_TAP_DETECT = _pyupm_curieimu.FIRMATA_CURIE_IMU_TAP_DETECT _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_MOTION_swigconstant(_pyupm_curieimu) FIRMATA_CURIE_IMU_READ_MOTION = _pyupm_curieimu.FIRMATA_CURIE_IMU_READ_MOTION _pyupm_curieimu.X_swigconstant(_pyupm_curieimu) X = _pyupm_curieimu.X _pyupm_curieimu.Y_swigconstant(_pyupm_curieimu) Y = _pyupm_curieimu.Y _pyupm_curieimu.Z_swigconstant(_pyupm_curieimu) Z = _pyupm_curieimu.Z
[docs]class IMUDataItem(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, IMUDataItem, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, IMUDataItem, name) __repr__ = _swig_repr __swig_setmethods__["axis"] = _pyupm_curieimu.IMUDataItem_axis_set __swig_getmethods__["axis"] = _pyupm_curieimu.IMUDataItem_axis_get if _newclass: axis = _swig_property(_pyupm_curieimu.IMUDataItem_axis_get, _pyupm_curieimu.IMUDataItem_axis_set) __swig_setmethods__["direction"] = _pyupm_curieimu.IMUDataItem_direction_set __swig_getmethods__["direction"] = _pyupm_curieimu.IMUDataItem_direction_get if _newclass: direction = _swig_property(_pyupm_curieimu.IMUDataItem_direction_get, _pyupm_curieimu.IMUDataItem_direction_set) def __init__(self): this = _pyupm_curieimu.new_IMUDataItem() try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_curieimu.delete_IMUDataItem __del__ = lambda self: None
IMUDataItem_swigregister = _pyupm_curieimu.IMUDataItem_swigregister IMUDataItem_swigregister(IMUDataItem)
[docs]class CurieImu(_object): """ API for the Curie IMU via Firmata. ID: curieimu Name: Curie IMU Sensor using Firmata Other Names: Curie IMU Sensor for Arduino/Genuino 101 running Firmata Category: serial accelerometer compass Manufacturer: bosch Connection: uart Curie IMU is a 6-axis accelerometer This module has been tested on an Arduino/Genuino 101 running ConfigurableFirmata with CurieIMU C++ includes: curieimu.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, CurieImu, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, CurieImu, name) __repr__ = _swig_repr def __init__(self, subplatform_offset=512): """ CurieImu(int subplatform_offset=512) Instantiates a CurieImu object Parameters: ----------- subplatform_offset: Subplatform offset """ this = _pyupm_curieimu.new_CurieImu(subplatform_offset) try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_curieimu.delete_CurieImu __del__ = lambda self: None
[docs] def updateAccel(self): """ void updateAccel() Updates the latest accelerometer readings by calling Firmata """ return _pyupm_curieimu.CurieImu_updateAccel(self)
[docs] def updateGyro(self): """ void updateGyro() Updates the latest gyroscope readings by calling Firmata """ return _pyupm_curieimu.CurieImu_updateGyro(self)
[docs] def updateMotion(self): """ void updateMotion() Updates the both the latest accelerometer & gyroscope readings by calling Firmata """ return _pyupm_curieimu.CurieImu_updateMotion(self)
[docs] def getAccel(self): """ int16_t * getAccel() Returns last accelerometer reading X, Y, and Z axis pointer to array with X-axis, Y-axis & Z-axis value """ return _pyupm_curieimu.CurieImu_getAccel(self)
[docs] def getAccelX(self): """ int16_t getAccelX() Returns last accelerometer reading X axis X-axis value """ return _pyupm_curieimu.CurieImu_getAccelX(self)
[docs] def getAccelY(self): """ int16_t getAccelY() Returns last accelerometer reading Y axis Y-axis value """ return _pyupm_curieimu.CurieImu_getAccelY(self)
[docs] def getAccelZ(self): """ int16_t getAccelZ() Returns last accelerometer reading Z axis Z-axis value """ return _pyupm_curieimu.CurieImu_getAccelZ(self)
[docs] def getGyro(self): """ int16_t * getGyro() Read gyroscope X, Y, and Z axis pointer to array with X-axis, Y-axis & Z-axis value """ return _pyupm_curieimu.CurieImu_getGyro(self)
[docs] def getGyroX(self): """ int16_t getGyroX() Returns last gyroscope reading X axis X-axis value """ return _pyupm_curieimu.CurieImu_getGyroX(self)
[docs] def getGyroY(self): """ int16_t getGyroY() Returns last gyroscope reading Y axis Y-axis value """ return _pyupm_curieimu.CurieImu_getGyroY(self)
[docs] def getGyroZ(self): """ int16_t getGyroZ() Returns last gyroscope reading Z axis Z-axis value """ return _pyupm_curieimu.CurieImu_getGyroZ(self)
[docs] def getTemperature(self): """ int16_t getTemperature() Reads the internal temperature 16-bit integer containing the scaled temperature reading """ return _pyupm_curieimu.CurieImu_getTemperature(self)
[docs] def getMotion(self): """ int16_t * getMotion() Reads the X, Y, and Z axis of both gyroscope and accelerometer pointer to array with X-axis, Y-axis & Z-axis values for accelerometer, and then X-axis, Y-axis & Z-axis values for gyroscope """ return _pyupm_curieimu.CurieImu_getMotion(self)
[docs] def getAxis(self): """ int16_t getAxis() Returns last shock or tap axis reading axis value """ return _pyupm_curieimu.CurieImu_getAxis(self)
[docs] def getDirection(self): """ int16_t getDirection() Returns last shock or tap direction reading direction value """ return _pyupm_curieimu.CurieImu_getDirection(self)
[docs] def enableShockDetection(self, enable): """ void enableShockDetection(bool enable) Turns shock detection notifications on/off Parameters: ----------- enable: enables/disables notifications """ return _pyupm_curieimu.CurieImu_enableShockDetection(self, enable)
[docs] def isShockDetected(self): """ bool isShockDetected() Has there been a shock detected? true if any unprocessed shock notifications are in the queue """ return _pyupm_curieimu.CurieImu_isShockDetected(self)
[docs] def getNextShock(self): """ void getNextShock() Gets shock detect data from queue. Then m_axis gets axis data, and m_direction gets direction data """ return _pyupm_curieimu.CurieImu_getNextShock(self)
[docs] def enableStepCounter(self, enable): """ void enableStepCounter(bool enable) Turns step counter notifications on/off Parameters: ----------- enable: enables/disables notifications """ return _pyupm_curieimu.CurieImu_enableStepCounter(self, enable)
[docs] def isStepDetected(self): """ bool isStepDetected() Has there been a step detected? true if any unprocessed step notifications are in the queue """ return _pyupm_curieimu.CurieImu_isStepDetected(self)
[docs] def getStepCount(self): """ int16_t getStepCount() Gets step count data from queue the total number of steps taken """ return _pyupm_curieimu.CurieImu_getStepCount(self)
[docs] def enableTapDetection(self, enable): """ void enableTapDetection(bool enable) Turns tap detection notifications on/off Parameters: ----------- enable: enables/disables notifications """ return _pyupm_curieimu.CurieImu_enableTapDetection(self, enable)
[docs] def isTapDetected(self): """ bool isTapDetected() Has there been a tap detected? true if any unprocessed tap notifications are in the queue """ return _pyupm_curieimu.CurieImu_isTapDetected(self)
[docs] def getNextTap(self): """ void getNextTap() Gets tap detect data from queue. Then m_axis gets axis data, and m_direction gets direction data """ return _pyupm_curieimu.CurieImu_getNextTap(self)
[docs] def lock(self): """ void lock() Locks responses from Firmata """ return _pyupm_curieimu.CurieImu_lock(self)
[docs] def unlock(self): """ void unlock() Unlocks responses from Firmata """ return _pyupm_curieimu.CurieImu_unlock(self)
[docs] def waitForResponse(self): """ void waitForResponse() Wait for a response from Firmata before proceeding """ return _pyupm_curieimu.CurieImu_waitForResponse(self)
[docs] def proceed(self): """ void proceed() Proceed with original function call now that response from Firmata has been received """ return _pyupm_curieimu.CurieImu_proceed(self)
[docs] def setResults(self, buf, length): """ void setResults(uint8_t *buf, int length) Set results being returned from Firmata for processing Parameters: ----------- buf: is the buffer length: is the length of results buffer """ return _pyupm_curieimu.CurieImu_setResults(self, buf, length)
[docs] def processResponse(self): """ void processResponse() Processes asyncronous responses returned from Firmata """ return _pyupm_curieimu.CurieImu_processResponse(self)
CurieImu_swigregister = _pyupm_curieimu.CurieImu_swigregister CurieImu_swigregister(CurieImu) # This file is compatible with both classic and new-style classes.