How to use the pypot.dynamixel.motor.DxlRegister function in pypot

To help you get started, we’ve selected a few pypot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
'angle_limit']

    id = DxlRegister()
    name = DxlRegister()
    model = DxlRegister()

    present_position = DxlPositionRegister()
    goal_position = DxlPositionRegister(rw=True)
    present_speed = DxlOrientedRegister()
    moving_speed = DxlOrientedRegister(rw=True)
    present_load = DxlOrientedRegister()
    torque_limit = DxlRegister(rw=True)

    lower_limit = DxlPositionRegister()
    upper_limit = DxlPositionRegister()
    present_voltage = DxlRegister()
    present_temperature = DxlRegister()

    def __init__(self, id, name=None, model='',
                 direct=True, offset=0.0,
                 broken=False,
                 angle_limit=None):
        self.__dict__['id'] = id

        name = name if name is not None else 'motor_{}'.format(id)
        self.__dict__['name'] = name

        self.__dict__['model'] = model
        self.__dict__['direct'] = direct
        self.__dict__['offset'] = offset

        self.__dict__['compliant'] = True
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
DxlMotor.__init__(self, id, name, model,
                          direct, offset, broken,
                          angle_limit)
        self.max_pos = 150


class DxlMXMotor(DxlMotor):
    """ This class represents the RX and MX robotis motor.

        This class adds access to:
            * PID gains (see the robotis website for details)

        """
    registers = list(DxlMotor.registers)

    pid = DxlRegister(rw=True)

    def __init__(self, id, name=None, model='',
                 direct=True, offset=0.0, broken=False,
                 angle_limit=None):
        """ This class represents the RX and MX robotis motor.

            This class adds access to:
                * PID gains (see the robotis website for details)

            """
        DxlMotor.__init__(self, id, name, model,
                          direct, offset, broken,
                          angle_limit)
        self.max_pos = 180
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
This class represents a generic robotis motor and you define your own subclass for specific motors (see :class:`~pypot.dynamixel.motor.DxlMXMotor` or :class:`~pypot.dynamixel.motor.DxlAXRXMotor`).

        Those properties are synchronized with the real motors values thanks to a :class:`~pypot.dynamixel.controller.DxlController`.

        """
    __metaclass__ = RegisterOwner

    registers = Motor.registers + ['registers',
                                   'goal_speed',
                                   'compliant', 'safe_compliant',
                                   'angle_limit']

    id = DxlRegister()
    name = DxlRegister()
    model = DxlRegister()

    present_position = DxlPositionRegister()
    goal_position = DxlPositionRegister(rw=True)
    present_speed = DxlOrientedRegister()
    moving_speed = DxlOrientedRegister(rw=True)
    present_load = DxlOrientedRegister()
    torque_limit = DxlRegister(rw=True)

    lower_limit = DxlPositionRegister()
    upper_limit = DxlPositionRegister()
    present_voltage = DxlRegister()
    present_temperature = DxlRegister()

    def __init__(self, id, name=None, model='',
                 direct=True, offset=0.0,
                 broken=False,
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
""" This class represents the RX and MX robotis motor.

            This class adds access to:
                * PID gains (see the robotis website for details)

            """
        DxlMotor.__init__(self, id, name, model,
                          direct, offset, broken,
                          angle_limit)
        self.max_pos = 180


class DxlXL320Motor(DxlMXMotor):
    registers = list(DxlMXMotor.registers)

    led = DxlRegister(rw=True)
    control_mode = DxlRegister(rw=True)

    """ This class represents the XL-320 robotis motor. """
    def __init__(self, id, name=None, model='XL-320',
                 direct=True, offset=0.0, broken=False,
                 angle_limit=None):
        DxlMXMotor.__init__(self, id, name, model,
                            direct, offset, broken,
                            angle_limit)
        self.max_pos = 150


class DxlSRMotor(DxlMotor):
    """ This class represents the robotis motor found in the seed robotics hand.

        This class adds access to:
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
id = DxlRegister()
    name = DxlRegister()
    model = DxlRegister()

    present_position = DxlPositionRegister()
    goal_position = DxlPositionRegister(rw=True)
    present_speed = DxlOrientedRegister()
    moving_speed = DxlOrientedRegister(rw=True)
    present_load = DxlOrientedRegister()
    torque_limit = DxlRegister(rw=True)

    lower_limit = DxlPositionRegister()
    upper_limit = DxlPositionRegister()
    present_voltage = DxlRegister()
    present_temperature = DxlRegister()

    def __init__(self, id, name=None, model='',
                 direct=True, offset=0.0,
                 broken=False,
                 angle_limit=None):
        self.__dict__['id'] = id

        name = name if name is not None else 'motor_{}'.format(id)
        self.__dict__['name'] = name

        self.__dict__['model'] = model
        self.__dict__['direct'] = direct
        self.__dict__['offset'] = offset

        self.__dict__['compliant'] = True
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
def __set__(self, instance, value):
        value = value if instance.direct else -value
        DxlRegister.__set__(self, instance, value)
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
def __new__(cls, name, bases, attrs):
        for n, v in attrs.items():
            if isinstance(v, DxlRegister):
                v.label = n
                attrs['registers'].append(n)
        return super(RegisterOwner, cls).__new__(cls, name, bases, attrs)
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
* voltage

        This class represents a generic robotis motor and you define your own subclass for specific motors (see :class:`~pypot.dynamixel.motor.DxlMXMotor` or :class:`~pypot.dynamixel.motor.DxlAXRXMotor`).

        Those properties are synchronized with the real motors values thanks to a :class:`~pypot.dynamixel.controller.DxlController`.

        """
    __metaclass__ = RegisterOwner

    registers = Motor.registers + ['registers',
                                   'goal_speed',
                                   'compliant', 'safe_compliant',
                                   'angle_limit']

    id = DxlRegister()
    name = DxlRegister()
    model = DxlRegister()

    present_position = DxlPositionRegister()
    goal_position = DxlPositionRegister(rw=True)
    present_speed = DxlOrientedRegister()
    moving_speed = DxlOrientedRegister(rw=True)
    present_load = DxlOrientedRegister()
    torque_limit = DxlRegister(rw=True)

    lower_limit = DxlPositionRegister()
    upper_limit = DxlPositionRegister()
    present_voltage = DxlRegister()
    present_temperature = DxlRegister()

    def __init__(self, id, name=None, model='',
                 direct=True, offset=0.0,
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
This class adds access to:
                * PID gains (see the robotis website for details)

            """
        DxlMotor.__init__(self, id, name, model,
                          direct, offset, broken,
                          angle_limit)
        self.max_pos = 180


class DxlXL320Motor(DxlMXMotor):
    registers = list(DxlMXMotor.registers)

    led = DxlRegister(rw=True)
    control_mode = DxlRegister(rw=True)

    """ This class represents the XL-320 robotis motor. """
    def __init__(self, id, name=None, model='XL-320',
                 direct=True, offset=0.0, broken=False,
                 angle_limit=None):
        DxlMXMotor.__init__(self, id, name, model,
                            direct, offset, broken,
                            angle_limit)
        self.max_pos = 150


class DxlSRMotor(DxlMotor):
    """ This class represents the robotis motor found in the seed robotics hand.

        This class adds access to:
            * force control enable
github poppy-project / pypot / pypot / dynamixel / motor.py View on Github external
class DxlSRMotor(DxlMotor):
    """ This class represents the robotis motor found in the seed robotics hand.

        This class adds access to:
            * force control enable
            * goal force
            * present current

        """
    registers = list(DxlMotor.registers)

    force_control_enable = DxlRegister(rw=True)
    goal_force = DxlRegister(rw=True)
    present_current = DxlRegister()

    def __init__(self, id, name=None, model='',
                 direct=True, offset=0.0, broken=False,
                 angle_limit=None):
        """ This class represents the robotis motor found in the seed robotics hand.

        This class adds access to:
            * PID gains (see the robotis website for details)
            * force control enable
            * goal force

            """
        DxlMotor.__init__(self, id, name, model,
                          direct, offset, broken,
                          angle_limit)
        self.max_pos = 180