reachy.parts.motor

Motor abstraction module.

Define:
  • DynamixelMotor

  • OrbitaActuator

Module Contents

Classes

DynamixelMotor

DynamixelMotor abstraction class.

OrbitaActuator

Orbita Actuator abstraction.

reachy.parts.motor.logger
class reachy.parts.motor.DynamixelMotor(root_part, name, luos_motor, config)

Bases: object

DynamixelMotor abstraction class.

Parameters
  • root_part (str) – name of the part where the motor is attached to (eg ‘right_arm.hand’)

  • name (str) – name of the motor (eg. ‘shoulder_pitch’)

  • luos_motor (pyluos.modules.DxlMotor) – pyluos motor

  • config (dict) – extra motor config (must include ‘offset’ and ‘orientation’ fields)

Wrap the pyluos motor object to simplify and make the API homogeneous.

__repr__(self)

Motor representation.

property name(self)

Fullname of the motor (eg. right_arm.hand.gripper).

property present_position(self)

Present position (in degrees) of the motor.

property goal_position(self)

Get current goal position (in degrees) of the motor.

property offset(self)

Get motor real zero (in degrees).

is_direct(self)

Check whether the motor is direct or not.

_as_local_pos(self, pos)
_to_motor_pos(self, pos)
property moving_speed(self)

Get the maximum speed (in degree per second) of the motor.

property compliant(self)

Check whether or not the motor is compliant.

property torque_limit(self)

Check the maximum torque allowed (in %) of the motor.

property temperature(self)

Check the current motor temp. (in °C).

goto(self, goal_position, duration, starting_point='present_position', wait=False, interpolation_mode='linear')

Set trajectory goal for the motor.

Parameters
  • goal_position (float) – target position (in degrees)

  • duration (float) – duration of the movement (in seconds)

  • starting_point (str) – register used to determine the starting point (eg. ‘goal_position’ can also be used in some specific case)

  • wait (bool) – whether or not to wait for the end of the motion

  • interpolation_mode (str) – interpolation technique used for computing the trajectory (‘linear’, ‘minjerk’)

Returns

trajectory player that can be used to monitor the trajectory, stop it, etc

Return type

reachy.trajectory.TrajectoryPlayer

use_static_error_fix(self, activate)

Trigger the static error fix.

Parameters

activate (bool) – whether to activate/deactivate the static error issue fix

If activated, the static error fix will check the reach position a fixed delay after the send of a new goal position. The static error may result in the motor’s load increasing, and yet not managing to move. To prevent this behavior we automatically adjust the target goal position to reduce this error.

_schedule_static_error_fix(self, delay)
_fix_static_error(self, threshold=2)
class reachy.parts.motor.OrbitaActuator(root_part, name, disks_motor, Pc_z, Cp_z, R, R0, hardware_zero)

Bases: object

Orbita Actuator abstraction.

Parameters
  • root_part (str) – name of the part where the motor is attached to (eg ‘head’)

  • name (str) – name of the actuator (eg. ‘neck’)

  • disks_motor (list of pyluos.motor_controller) – list of the three disks controllers

  • Pc_z (float, float, float) – 3D coordinates of the center of the platform (in mm)

  • Cp_z (float, float, float) – center of the disks rotation circle (in mm)

  • R (float) – radius of the arms rotation circle around the platform (in mm)

  • R0 (ndarray) – rotation matrix for the initial rotation

  • hardware_zero (float, float, float) – absolute hardware zero position of the orbita disks

Wrap the three disk and the computation model of Orbita to expose higher-level functionalities such as:

  • quaternion control

  • compliancy mode

  • goto

__repr__(self)

Orbita representation.

property disks(self)

Get three disks [top, middle, bottom].

property compliant(self)

Check the disks compliancy.

goto(self, thetas, duration, wait, interpolation_mode='linear')

Set trajectory goal for three disks.

Parameters
  • thetas (float, float, float) – target position (in degrees) for each disks (top, middle, bottom)

  • duration (float) – duration of the movement (in seconds)

  • wait (bool) – whether or not to wait for the end of the motion

  • interpolation_mode (str) – interpolation technique used for computing the trajectory (‘linear’, ‘minjerk’)

Returns

trajectory player that can be used to monitor the trajectory, stop it, etc

Return type

reachy.trajectory.TrajectoryPlayer

point_at(self, vector, angle, duration, wait)

Make orbita point at the given vector.

Parameters
  • vector (float, float, float) – 3D vector indicating the poiting direction (in m)

  • angle (float) – rotation around the vector (in degrees)

  • duration (float) – move duration (in seconds)

  • wait (bool) – whether or not to wait for the end of the motion

Returns

trajectory player that can be used to monitor the trajectory, stop it, etc

Return type

reachy.trajectory.TrajectoryPlayer

orient(self, quat, duration, wait)

Orient orbita given a quaternion.

Parameters
  • quat (pyquaternion.Quaterion) – quaternion goal orientation

  • duration (float) – move duration (in seconds)

  • wait (bool) – whether or not to wait for the end of the motion

Returns

trajectory player that can be used to monitor the trajectory, stop it, etc

Return type

reachy.trajectory.TrajectoryPlayer

setup(self)

Configure each of the three disks.

Note

automatically called at instantiation.