Source code for pyupm_smartdrive

# 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_smartdrive', [dirname(__file__)])
        except ImportError:
            import _pyupm_smartdrive
            return _pyupm_smartdrive
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_smartdrive', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_smartdrive = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_smartdrive
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_smartdrive.getVersion()
getVersion = _pyupm_smartdrive.getVersion

_pyupm_smartdrive.SmartDrive_Motor_ID_1_swigconstant(_pyupm_smartdrive)
SmartDrive_Motor_ID_1 = _pyupm_smartdrive.SmartDrive_Motor_ID_1

_pyupm_smartdrive.SmartDrive_Motor_ID_2_swigconstant(_pyupm_smartdrive)
SmartDrive_Motor_ID_2 = _pyupm_smartdrive.SmartDrive_Motor_ID_2

_pyupm_smartdrive.SmartDrive_Motor_ID_BOTH_swigconstant(_pyupm_smartdrive)
SmartDrive_Motor_ID_BOTH = _pyupm_smartdrive.SmartDrive_Motor_ID_BOTH

_pyupm_smartdrive.SmartDrive_Dir_Reverse_swigconstant(_pyupm_smartdrive)
SmartDrive_Dir_Reverse = _pyupm_smartdrive.SmartDrive_Dir_Reverse

_pyupm_smartdrive.SmartDrive_Dir_Forward_swigconstant(_pyupm_smartdrive)
SmartDrive_Dir_Forward = _pyupm_smartdrive.SmartDrive_Dir_Forward

_pyupm_smartdrive.SmartDrive_Action_Float_swigconstant(_pyupm_smartdrive)
SmartDrive_Action_Float = _pyupm_smartdrive.SmartDrive_Action_Float

_pyupm_smartdrive.SmartDrive_Action_Brake_swigconstant(_pyupm_smartdrive)
SmartDrive_Action_Brake = _pyupm_smartdrive.SmartDrive_Action_Brake

_pyupm_smartdrive.SmartDrive_Action_BrakeHold_swigconstant(_pyupm_smartdrive)
SmartDrive_Action_BrakeHold = _pyupm_smartdrive.SmartDrive_Action_BrakeHold

_pyupm_smartdrive.SmartDrive_Completion_Wait_For_swigconstant(_pyupm_smartdrive)
SmartDrive_Completion_Wait_For = _pyupm_smartdrive.SmartDrive_Completion_Wait_For

_pyupm_smartdrive.SmartDrive_Completion_Dont_Wait_swigconstant(_pyupm_smartdrive)
SmartDrive_Completion_Dont_Wait = _pyupm_smartdrive.SmartDrive_Completion_Dont_Wait

_pyupm_smartdrive.SmartDrive_DefaultAddress_swigconstant(_pyupm_smartdrive)
SmartDrive_DefaultAddress = _pyupm_smartdrive.SmartDrive_DefaultAddress

_pyupm_smartdrive.SmartDrive_VOLTAGE_MULTIPLIER_swigconstant(_pyupm_smartdrive)
SmartDrive_VOLTAGE_MULTIPLIER = _pyupm_smartdrive.SmartDrive_VOLTAGE_MULTIPLIER

_pyupm_smartdrive.SmartDrive_Speed_Full_swigconstant(_pyupm_smartdrive)
SmartDrive_Speed_Full = _pyupm_smartdrive.SmartDrive_Speed_Full

_pyupm_smartdrive.SmartDrive_Speed_Medium_swigconstant(_pyupm_smartdrive)
SmartDrive_Speed_Medium = _pyupm_smartdrive.SmartDrive_Speed_Medium

_pyupm_smartdrive.SmartDrive_Speed_Slow_swigconstant(_pyupm_smartdrive)
SmartDrive_Speed_Slow = _pyupm_smartdrive.SmartDrive_Speed_Slow

_pyupm_smartdrive.SmartDrive_CONTROL_SPEED_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_SPEED = _pyupm_smartdrive.SmartDrive_CONTROL_SPEED

_pyupm_smartdrive.SmartDrive_CONTROL_RAMP_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_RAMP = _pyupm_smartdrive.SmartDrive_CONTROL_RAMP

_pyupm_smartdrive.SmartDrive_CONTROL_RELATIVE_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_RELATIVE = _pyupm_smartdrive.SmartDrive_CONTROL_RELATIVE

_pyupm_smartdrive.SmartDrive_CONTROL_TACHO_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_TACHO = _pyupm_smartdrive.SmartDrive_CONTROL_TACHO

_pyupm_smartdrive.SmartDrive_CONTROL_BRK_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_BRK = _pyupm_smartdrive.SmartDrive_CONTROL_BRK

_pyupm_smartdrive.SmartDrive_CONTROL_ON_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_ON = _pyupm_smartdrive.SmartDrive_CONTROL_ON

_pyupm_smartdrive.SmartDrive_CONTROL_TIME_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_TIME = _pyupm_smartdrive.SmartDrive_CONTROL_TIME

_pyupm_smartdrive.SmartDrive_CONTROL_GO_swigconstant(_pyupm_smartdrive)
SmartDrive_CONTROL_GO = _pyupm_smartdrive.SmartDrive_CONTROL_GO

_pyupm_smartdrive.SmartDrive_COMMAND_swigconstant(_pyupm_smartdrive)
SmartDrive_COMMAND = _pyupm_smartdrive.SmartDrive_COMMAND

_pyupm_smartdrive.SmartDrive_SETPT_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_SETPT_M1 = _pyupm_smartdrive.SmartDrive_SETPT_M1

_pyupm_smartdrive.SmartDrive_SPEED_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_SPEED_M1 = _pyupm_smartdrive.SmartDrive_SPEED_M1

_pyupm_smartdrive.SmartDrive_TIME_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_TIME_M1 = _pyupm_smartdrive.SmartDrive_TIME_M1

_pyupm_smartdrive.SmartDrive_CMD_B_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_CMD_B_M1 = _pyupm_smartdrive.SmartDrive_CMD_B_M1

_pyupm_smartdrive.SmartDrive_CMD_A_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_CMD_A_M1 = _pyupm_smartdrive.SmartDrive_CMD_A_M1

_pyupm_smartdrive.SmartDrive_SETPT_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_SETPT_M2 = _pyupm_smartdrive.SmartDrive_SETPT_M2

_pyupm_smartdrive.SmartDrive_SPEED_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_SPEED_M2 = _pyupm_smartdrive.SmartDrive_SPEED_M2

_pyupm_smartdrive.SmartDrive_TIME_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_TIME_M2 = _pyupm_smartdrive.SmartDrive_TIME_M2

_pyupm_smartdrive.SmartDrive_CMD_B_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_CMD_B_M2 = _pyupm_smartdrive.SmartDrive_CMD_B_M2

_pyupm_smartdrive.SmartDrive_CMD_A_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_CMD_A_M2 = _pyupm_smartdrive.SmartDrive_CMD_A_M2

_pyupm_smartdrive.SmartDrive_POSITION_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_POSITION_M1 = _pyupm_smartdrive.SmartDrive_POSITION_M1

_pyupm_smartdrive.SmartDrive_POSITION_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_POSITION_M2 = _pyupm_smartdrive.SmartDrive_POSITION_M2

_pyupm_smartdrive.SmartDrive_STATUS_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_STATUS_M1 = _pyupm_smartdrive.SmartDrive_STATUS_M1

_pyupm_smartdrive.SmartDrive_STATUS_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_STATUS_M2 = _pyupm_smartdrive.SmartDrive_STATUS_M2

_pyupm_smartdrive.SmartDrive_TASKS_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_TASKS_M1 = _pyupm_smartdrive.SmartDrive_TASKS_M1

_pyupm_smartdrive.SmartDrive_TASKS_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_TASKS_M2 = _pyupm_smartdrive.SmartDrive_TASKS_M2

_pyupm_smartdrive.SmartDrive_P_Kp_swigconstant(_pyupm_smartdrive)
SmartDrive_P_Kp = _pyupm_smartdrive.SmartDrive_P_Kp

_pyupm_smartdrive.SmartDrive_P_Ki_swigconstant(_pyupm_smartdrive)
SmartDrive_P_Ki = _pyupm_smartdrive.SmartDrive_P_Ki

_pyupm_smartdrive.SmartDrive_P_Kd_swigconstant(_pyupm_smartdrive)
SmartDrive_P_Kd = _pyupm_smartdrive.SmartDrive_P_Kd

_pyupm_smartdrive.SmartDrive_S_Kp_swigconstant(_pyupm_smartdrive)
SmartDrive_S_Kp = _pyupm_smartdrive.SmartDrive_S_Kp

_pyupm_smartdrive.SmartDrive_S_Ki_swigconstant(_pyupm_smartdrive)
SmartDrive_S_Ki = _pyupm_smartdrive.SmartDrive_S_Ki

_pyupm_smartdrive.SmartDrive_S_Kd_swigconstant(_pyupm_smartdrive)
SmartDrive_S_Kd = _pyupm_smartdrive.SmartDrive_S_Kd

_pyupm_smartdrive.SmartDrive_PASSCOUNT_swigconstant(_pyupm_smartdrive)
SmartDrive_PASSCOUNT = _pyupm_smartdrive.SmartDrive_PASSCOUNT

_pyupm_smartdrive.SmartDrive_PASSTOLERANCE_swigconstant(_pyupm_smartdrive)
SmartDrive_PASSTOLERANCE = _pyupm_smartdrive.SmartDrive_PASSTOLERANCE

_pyupm_smartdrive.SmartDrive_CHKSUM_swigconstant(_pyupm_smartdrive)
SmartDrive_CHKSUM = _pyupm_smartdrive.SmartDrive_CHKSUM

_pyupm_smartdrive.SmartDrive_BATT_VOLTAGE_swigconstant(_pyupm_smartdrive)
SmartDrive_BATT_VOLTAGE = _pyupm_smartdrive.SmartDrive_BATT_VOLTAGE

_pyupm_smartdrive.SmartDrive_RESETSTATUS_swigconstant(_pyupm_smartdrive)
SmartDrive_RESETSTATUS = _pyupm_smartdrive.SmartDrive_RESETSTATUS

_pyupm_smartdrive.SmartDrive_CURRENT_M1_swigconstant(_pyupm_smartdrive)
SmartDrive_CURRENT_M1 = _pyupm_smartdrive.SmartDrive_CURRENT_M1

_pyupm_smartdrive.SmartDrive_CURRENT_M2_swigconstant(_pyupm_smartdrive)
SmartDrive_CURRENT_M2 = _pyupm_smartdrive.SmartDrive_CURRENT_M2

_pyupm_smartdrive.CMD_R_swigconstant(_pyupm_smartdrive)
CMD_R = _pyupm_smartdrive.CMD_R

_pyupm_smartdrive.CMD_S_swigconstant(_pyupm_smartdrive)
CMD_S = _pyupm_smartdrive.CMD_S

_pyupm_smartdrive.CMD_a_swigconstant(_pyupm_smartdrive)
CMD_a = _pyupm_smartdrive.CMD_a

_pyupm_smartdrive.CMD_b_swigconstant(_pyupm_smartdrive)
CMD_b = _pyupm_smartdrive.CMD_b

_pyupm_smartdrive.CMD_c_swigconstant(_pyupm_smartdrive)
CMD_c = _pyupm_smartdrive.CMD_c

_pyupm_smartdrive.CMD_A_swigconstant(_pyupm_smartdrive)
CMD_A = _pyupm_smartdrive.CMD_A

_pyupm_smartdrive.CMD_B_swigconstant(_pyupm_smartdrive)
CMD_B = _pyupm_smartdrive.CMD_B

_pyupm_smartdrive.CMD_C_swigconstant(_pyupm_smartdrive)
CMD_C = _pyupm_smartdrive.CMD_C

_pyupm_smartdrive.SmartDrive_MOTOR_CONTROL_ON_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_CONTROL_ON = _pyupm_smartdrive.SmartDrive_MOTOR_CONTROL_ON

_pyupm_smartdrive.SmartDrive_MOTOR_IS_RAMPING_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_IS_RAMPING = _pyupm_smartdrive.SmartDrive_MOTOR_IS_RAMPING

_pyupm_smartdrive.SmartDrive_MOTOR_IS_POWERED_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_IS_POWERED = _pyupm_smartdrive.SmartDrive_MOTOR_IS_POWERED

_pyupm_smartdrive.SmartDrive_MOTOR_POS_CTRL_ON_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_POS_CTRL_ON = _pyupm_smartdrive.SmartDrive_MOTOR_POS_CTRL_ON

_pyupm_smartdrive.SmartDrive_MOTOR_IN_BRAKE_MODE_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_IN_BRAKE_MODE = _pyupm_smartdrive.SmartDrive_MOTOR_IN_BRAKE_MODE

_pyupm_smartdrive.SmartDrive_MOTOR_OVERLOADED_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_OVERLOADED = _pyupm_smartdrive.SmartDrive_MOTOR_OVERLOADED

_pyupm_smartdrive.SmartDrive_MOTOR_IN_TIME_MODE_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_IN_TIME_MODE = _pyupm_smartdrive.SmartDrive_MOTOR_IN_TIME_MODE

_pyupm_smartdrive.SmartDrive_MOTOR_IS_STALLED_swigconstant(_pyupm_smartdrive)
SmartDrive_MOTOR_IS_STALLED = _pyupm_smartdrive.SmartDrive_MOTOR_IS_STALLED
[docs]class SmartDrive(_object): """ API for the SmartDrive advanced motor controller from OpenElectronis. ID: smartdrive Name: SmartDrive Advanced Motor Controller Other Names: smartdrive Category: motor Manufacturer: openelectrons Connection: i2c SmartDrive is a multiplexer to control high current DC motors This module has been tested on the SmartDrive. C++ includes: smartdrive.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, SmartDrive, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, SmartDrive, name) __repr__ = _swig_repr def __init__(self, i2c_bus, address=0x1b): """ SmartDrive(int i2c_bus, int address=SmartDrive_DefaultAddress) Initialize the class with the i2c address of your SmartDrive Parameters: ----------- i2c_bus: I2C bus to use. address: Address of your SmartDrive. """ this = _pyupm_smartdrive.new_SmartDrive(i2c_bus, address) try: self.this.append(this) except Exception: self.this = this
[docs] def command(self, cmd): """ void command(uint8_t cmd) Writes a specified command on the command register of the SmartDrive Parameters: ----------- cmd: The command you wish the SmartDrive to execute. """ return _pyupm_smartdrive.SmartDrive_command(self, cmd)
[docs] def GetBattVoltage(self): """ float GetBattVoltage() Reads the battery voltage. Multiplier constant not yet verified """ return _pyupm_smartdrive.SmartDrive_GetBattVoltage(self)
[docs] def ReadTachometerPosition(self, motor_id): """ uint32_t ReadTachometerPosition(int motor_id) Reads the tacheometer position of the specified motor Parameters: ----------- motor_id: Number of the motor you wish to read. """ return _pyupm_smartdrive.SmartDrive_ReadTachometerPosition(self, motor_id)
[docs] def Run_Unlimited(self, motor_id, direction, speed): """ void Run_Unlimited(int motor_id, int direction, uint8_t speed) Turns the specified motor(s) forever Parameters: ----------- motor_id: Number of the motor(s) you wish to turn. direction: The direction you wish to turn the motor(s). speed: The speed at which you wish to turn the motor(s). """ return _pyupm_smartdrive.SmartDrive_Run_Unlimited(self, motor_id, direction, speed)
[docs] def StopMotor(self, motor_id, next_action): """ void StopMotor(int motor_id, int next_action) Stops the specified motor(s) Parameters: ----------- motor_id: Number of the motor(s) you wish to turn. next_action: How you wish to stop the motor(s). """ return _pyupm_smartdrive.SmartDrive_StopMotor(self, motor_id, next_action)
[docs] def Run_Seconds(self, motor_id, direction, speed, duration, wait_for_completion, next_action): """ void Run_Seconds(int motor_id, int direction, uint8_t speed, uint8_t duration, bool wait_for_completion, int next_action) Turns the specified motor(s) for a given amount of seconds Parameters: ----------- motor_id: Number of the motor(s) you wish to turn. direction: The direction you wish to turn the motor(s). speed: The speed at which you wish to turn the motor(s). duration: The time in seconds you wish to turn the motor(s). wait_for_completion: Tells the program when to handle the next line of code. next_action: How you wish to stop the motor(s). """ return _pyupm_smartdrive.SmartDrive_Run_Seconds(self, motor_id, direction, speed, duration, wait_for_completion, next_action)
[docs] def WaitUntilTimeDone(self, motor_id): """ void WaitUntilTimeDone(int motor_id) Waits until the specified time for the motor(s) to run is completed Parameters: ----------- motor_id: Number of the motor(s) to wait for. """ return _pyupm_smartdrive.SmartDrive_WaitUntilTimeDone(self, motor_id)
[docs] def IsTimeDone(self, motor_id): """ bool IsTimeDone(int motor_id) Checks to ensure the specified time for the motor(s) to run is completed. Parameters: ----------- motor_id: Number of the motor(s) to check. """ return _pyupm_smartdrive.SmartDrive_IsTimeDone(self, motor_id)
[docs] def Run_Degrees(self, motor_id, direction, speed, degrees, wait_for_completion, next_action): """ void Run_Degrees(int motor_id, int direction, uint8_t speed, uint32_t degrees, bool wait_for_completion, int next_action) Turns the specified motor(s) for given relative tacheometer count Parameters: ----------- motor_id: Number of the motor(s) you wish to turn. direction: The direction you wish to turn the motor(s). speed: The speed at which you wish to turn the motor(s). degrees: The relative tacheometer count you wish to turn the motor(s). wait_for_completion: Tells the program when to handle the next line of code. next_action: How you wish to stop the motor(s). """ return _pyupm_smartdrive.SmartDrive_Run_Degrees(self, motor_id, direction, speed, degrees, wait_for_completion, next_action)
[docs] def Run_Rotations(self, motor_id, direction, speed, rotations, wait_for_completion, next_action): """ void Run_Rotations(int motor_id, int direction, uint8_t speed, uint32_t rotations, bool wait_for_completion, int next_action) Turns the specified motor(s) for given relative tacheometer count Parameters: ----------- motor_id: Number of the motor(s) you wish to turn. direction: The direction you wish to turn the motor(s). speed: The speed at which you wish to turn the motor(s). rotations: The relative amount of rotations you wish to turn the motor(s). wait_for_completion: Tells the program when to handle the next line of code. next_action: How you wish to stop the motor(s). """ return _pyupm_smartdrive.SmartDrive_Run_Rotations(self, motor_id, direction, speed, rotations, wait_for_completion, next_action)
[docs] def Run_Tacho(self, motor_id, speed, tacho_count, wait_for_completion, next_action): """ void Run_Tacho(int motor_id, uint8_t speed, uint32_t tacho_count, bool wait_for_completion, int next_action) Turns the specified motor(s) for given absolute tacheometer count Parameters: ----------- motor_id: Number of the motor(s) you wish to turn. speed: The speed at which you wish to turn the motor(s). tacho_count: The absolute tacheometer count you wish to turn the motor(s). wait_for_completion: Tells the program when to handle the next line of code. next_action: How you wish to stop the motor(s). """ return _pyupm_smartdrive.SmartDrive_Run_Tacho(self, motor_id, speed, tacho_count, wait_for_completion, next_action)
[docs] def WaitUntilTachoDone(self, motor_id): """ void WaitUntilTachoDone(int motor_id) Waits until the specified tacheomter count for the motor(s) to run is reached. Parameters: ----------- motor_id: Number of the motor(s) to wait for. """ return _pyupm_smartdrive.SmartDrive_WaitUntilTachoDone(self, motor_id)
[docs] def IsTachoDone(self, motor_id): """ bool IsTachoDone(int motor_id) Checks to ensure the specified tacheomter count for the motor(s) to run is reached. Parameters: ----------- motor_id: Number of the motor(s) to check. """ return _pyupm_smartdrive.SmartDrive_IsTachoDone(self, motor_id)
[docs] def SetPerformanceParameters(self, Kp_tacho, Ki_tacho, Kd_tacho, Kp_speed, Ki_speed, Kd_speed, passcount, tolerance): """ void SetPerformanceParameters(uint16_t Kp_tacho, uint16_t Ki_tacho, uint16_t Kd_tacho, uint16_t Kp_speed, uint16_t Ki_speed, uint16_t Kd_speed, uint8_t passcount, uint8_t tolerance) Writes user specified values to the PID control registers Parameters: ----------- Kp_tacho: Proportional-gain of the tacheometer position of the motor. Ki_tacho: Integral-gain of the tacheometer position of the motor. Kd_tacho: Derivative-gain of the tacheometer position of the motor. Kp_speed: Proportional-gain of the speed of the motor. Ki_speed: Integral-gain of the speed of the motor. Kd_speed: Derivative-gain of the speed of the motor. """ return _pyupm_smartdrive.SmartDrive_SetPerformanceParameters(self, Kp_tacho, Ki_tacho, Kd_tacho, Kp_speed, Ki_speed, Kd_speed, passcount, tolerance)
[docs] def ReadPerformanceParameters(self): """ void ReadPerformanceParameters() Reads the values of the PID control registers """ return _pyupm_smartdrive.SmartDrive_ReadPerformanceParameters(self)
[docs] def GetMotorStatus(self, motor_id): """ uint8_t GetMotorStatus(int motor_id) Read the status of a motor, and return it in a uint8_t param motor_id Number fo the motor to check """ return _pyupm_smartdrive.SmartDrive_GetMotorStatus(self, motor_id)
[docs] def PrintMotorStatus(self, motor_id): """ void PrintMotorStatus(int motor_id) Print the detailed status of the motor Parameters: ----------- motor_id: Number fo the motor to check """ return _pyupm_smartdrive.SmartDrive_PrintMotorStatus(self, motor_id)
__swig_destroy__ = _pyupm_smartdrive.delete_SmartDrive __del__ = lambda self: None
SmartDrive_swigregister = _pyupm_smartdrive.SmartDrive_swigregister SmartDrive_swigregister(SmartDrive) # This file is compatible with both classic and new-style classes.