dynamixel component
- Ports
- Services
- connect (activity)
- disconnect (activity)
- set_position (attribute)
- set_velocity (attribute)
- set_effort (attribute)
- set_position_effort (attribute)
- stop (function)
- servo (activity)
- configure (activity)
- set_limits (function)
- get_limits (attribute)
- set_position_pidff (function)
- get_postion_pidff (attribute)
- set_velocity_pi (function)
- get_velocity_pi (attribute)
- set_offset (function)
- get_offset (attribute)
- set_profile (function)
- get_profile (attribute)
- log (function)
- log_stop (function)
- log_info (function)
- Tasks
This component controls a chain of dynamixel motors.
The component requires dynamixel motors using the protocol 2.0. Currently, MX and XM series have been tested, but any dynamixel motor supporting protocol 2.0 should work. Up to 8 motors can be controlled simulltaneously.
Motors must be connected to a USB port, either with the USB2Dynamixel device, or with the USB2AX custom product. Other devices may work, but have not been tested.
Currently, the effort member of motors (out) and
joint_input (in) are in Amperes and are a measure of the
the current draw in the motor (for motors (out)) or the desired
current target (for joint_input (in)).
Conversion from Amperes to Newton meters may be done according to the
plots provided in the motors datasheet. This is not currently done
since no explicit numerical value is given and it must be derived from
the plot bitmap which may not be acurate.
|
Ports
joint_input (in)
Data structure
|
motors (out)
Data structure
|
Provide a view of joints state.
ts
is the last update time. Other elements are a sequence of up
to 8 joints, indexed by their id. name
is a human-readable
description of the joint and flag
indicates if the joint is
present (active
) or in an 'emergency' state.
position
and velocity
are given in meters and meters per second
for linear joints and in radians and radians per second for
revolute joints. effort
is either the measured force in Newtons
for linear joints or the torque in Newton meters for revolute
joints.
Services
connect (activity)
Inputs
|
Throws
|
Context
|
Connect to the hardware.
This opens the USB serial device serial
at the given baud
rate and detect connected motors. Discovered motors are printed on the standard output. After a successful connection, motors are configured in "postition control" mode and servoed to their current position.
Note that motors should all have a different id
, starting from 1 and up to 8. They need not to have consecutive id
, though.
disconnect (activity)
Throws
|
Context
|
Disconnect from the hardware.
All connected motors are first stopped and then released, so that they are not servoed anymore
set_position (attribute)
Inputs
|
Context
|
Set a desired position target for all motors.
This sends an array of desired position to motors starting from id 1 and up. The position in the array represents the motor id. The positions are in radian, and the origin can be set with set_offset (function).
set_velocity (attribute)
Inputs
|
Context
|
Set a desired velocity target for all motors.
This sends an array of desired velocities to motors starting from id 1 and up. The position in the array represents the motor id and velocities are given in rad/s.
set_effort (attribute)
Inputs
|
Context
|
Set a desired torque target for all motors.
This sends an array of desired torques to motors starting from id 1 and up. The position in the array represents the motor id and torques are given in Amperes.
set_position_effort (attribute)
Inputs
|
Context
|
Set a desired position target with a torque limit for all motors.
This sends an array of desired position and torque limits to motors starting from id 1 and up. The position in the array represents the motor id. Positions are in radians and torques in Amperes.
servo (activity)
Throws
|
Context
|
Control the joints via the input port joint_input (in)
The desired target present in the port is set in the joint controller, according to which member of position, velocity or effort is present. If several members are present, the position takes precedence over the velocity: if both are present, only the position is considered. If position and effort are both present, the position target is set with the indicated torque limit (in Amperes). If there is no position, the velocity takes precedence over effort.
configure (activity)
Inputs
|
Throws
|
Context
|
Configure a single motor to the given id and baud rate.
This is a configuration service that requires that only one motor is connected to the bus. The service will discover the current motor settings by testing different baud rates. If a motor is successfully detected, it will be reprogrammed to match the given settings.
set_limits (function)
Inputs
|
Throws
|
Set various software limits for motor #id
.
get_limits (attribute)
Outputs
|
Retrieve various software limits for all motors.
set_position_pidff (function)
Inputs
|
Throws
|
Set the position controller parameters for motor #id
.
get_postion_pidff (attribute)
Outputs
|
Get the position controller parameters for all motors.
set_velocity_pi (function)
Inputs
|
Throws
|
Set the velocity controller parameters for motor #id
.
get_velocity_pi (attribute)
Outputs
|
Get the velocity controller parameters for all motors.
set_offset (function)
Inputs
|
Throws
|
Set the zero offset for motor #id
.
This service sets the zero offset of the position of motor id
in radian. The set_position (attribute) parameters are given relative to this offset.
Note that this offset is not cumulative, i.e. passing 0.0 to this service will actually reset the motor offset to the absolute hardware value.
set_profile (function)
Inputs
|
Throws
|
Set motion profile for motor #id
.
The motion profile is an acceleration/deceleration control method to reduce vibration, noise and load of the motor by controlling dramatically changing velocity and acceleration in position control mode.
A zero velocity profile means acceleration and velocities will only be limited by the hardware limits and no smoothing is done. A non zero velocity profile with a zero acceleration profile will provide a rectangular velocity shape for reaching a distant position. Non zero for both velocity and acceleration will provide a trapezoïdal shape for the velocity. Refer to the dynamixel documentation for details.
get_profile (attribute)
Outputs
|
Get motion profile for all motors.
Tasks
comm
Context
|
Throws
|