org.robokind.impl.motion.dynamixel
Class DynamixelController

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.servos.AbstractServoController<Id,ServoConf,S,ControllerConf>
          extended by org.robokind.impl.motion.serial.SerialServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>
              extended by org.robokind.impl.motion.dynamixel.DynamixelController
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource, org.robokind.api.motion.servos.ServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>

public class DynamixelController
extends org.robokind.impl.motion.serial.SerialServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>

ServoController for a chain of DynamixelServos.

Author:
Matthew Stevenson

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.robokind.api.motion.servos.ServoController
org.robokind.api.motion.servos.ServoController.Id, org.robokind.api.motion.servos.ServoController.ServoId<ServoIdType>
 
Field Summary
static DynamixelServo.Id BROADCAST_ID
          DynamixelController broadcast id.
static org.robokind.api.common.config.VersionProperty VERSION
          Controller type VersionProperty.
static String VERSION_NAME
          Controller type version name.
static String VERSION_NUMBER
          Controller type version number.
 
Fields inherited from class org.robokind.impl.motion.serial.SerialServoController
myPort, myTimeoutLength
 
Fields inherited from class org.robokind.api.motion.servos.AbstractServoController
myChangeMonitor, myConfig, myConnectionStatus, myServoMap, myServos
 
Fields inherited from interface org.robokind.api.motion.servos.ServoController
PROP_CONNECTION_STATUS, PROP_ENABLED, PROP_ERROR_MESSAGES, PROP_SERVO_ADD, PROP_SERVO_REMOVE, PROP_SERVOS, PROP_VERSION
 
Constructor Summary
DynamixelController(DynamixelControllerConfig config)
          Creates a new DynamixelController from the given SerialServoControllerConfig.
 
Method Summary
 boolean connect()
           
protected  DynamixelServo connectServo(org.robokind.api.motion.servos.config.ServoConfig config)
           
 boolean disconnect()
           
protected  boolean disconnectServo(org.robokind.api.motion.servos.ServoController.ServoId<DynamixelServo.Id> id)
           
 DynamixelControlLoop getControlLoop()
           
 Boolean getEnabled()
           
 org.robokind.impl.motion.serial.RXTXSerialPort getPort()
           
 Class<DynamixelServo.Id> getServoIdClass()
           
 boolean moveAllServos(long lenMillisec)
           
 boolean moveServo(org.robokind.api.motion.servos.ServoController.ServoId<DynamixelServo.Id> id, long lenMillisec)
           
 boolean moveServos(org.robokind.api.motion.servos.ServoController.ServoId<DynamixelServo.Id>[] ids, int len, int offset, long lenMillisec)
           
 boolean ping(DynamixelServo.Id id)
          Pings the DynamixelServo at the given physical id.
 int readRegister(DynamixelServo.Id id, Register reg)
          Reads the Register value from the DynamixelServo with the given physical id.
 int[] readRegisters(DynamixelServo.Id id, Register regFirst, Register regLast)
          Reads the values from the Register range specified by regFirst and regLast for the DynamixelServo with the given physical id.
 void setEnabled(Boolean enabled)
           
protected  boolean setServos()
          Attempts to ping each Servo in the ServoControllerConfig.
protected  boolean writeRegister(DynamixelServo.Id id, Register reg, Integer value, Boolean deferred)
          Write a value to the given register for the given DynamixelServo.
 
Methods inherited from class org.robokind.impl.motion.serial.SerialServoController
getErrorMessages, setTimeoutLength
 
Methods inherited from class org.robokind.api.motion.servos.AbstractServoController
addingServo, addServo, changeServoId, containsId, containsIds, getConfig, getConnectionStatus, getId, getServo, getServos, removeServo, removingServo, servoId, setConnectStatus
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.robokind.api.common.property.PropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

VERSION_NAME

public static final String VERSION_NAME
Controller type version name.

See Also:
Constant Field Values

VERSION_NUMBER

public static final String VERSION_NUMBER
Controller type version number.

See Also:
Constant Field Values

VERSION

public static final org.robokind.api.common.config.VersionProperty VERSION
Controller type VersionProperty.


BROADCAST_ID

public static final DynamixelServo.Id BROADCAST_ID
DynamixelController broadcast id. This is an invalid DynamixelServo physical id, reserved to indicate the controller to the joints.

Constructor Detail

DynamixelController

public DynamixelController(DynamixelControllerConfig config)
Creates a new DynamixelController from the given SerialServoControllerConfig.

Parameters:
config - SerialServoControllerConfig for the new controller
Method Detail

setServos

protected boolean setServos()
Attempts to ping each Servo in the ServoControllerConfig. A joint is added if it responds, otherwise it is added to the UnresponsiveServos List.

Specified by:
setServos in class org.robokind.impl.motion.serial.SerialServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>
Returns:
true if successful

moveServo

public boolean moveServo(org.robokind.api.motion.servos.ServoController.ServoId<DynamixelServo.Id> id,
                         long lenMillisec)

moveServos

public boolean moveServos(org.robokind.api.motion.servos.ServoController.ServoId<DynamixelServo.Id>[] ids,
                          int len,
                          int offset,
                          long lenMillisec)

moveAllServos

public boolean moveAllServos(long lenMillisec)

ping

public boolean ping(DynamixelServo.Id id)
Pings the DynamixelServo at the given physical id.

Parameters:
id - physical id of the DynamixelServo to ping
Returns:
true if the DynamixelServo responds

readRegister

public int readRegister(DynamixelServo.Id id,
                        Register reg)
Reads the Register value from the DynamixelServo with the given physical id.

Parameters:
id - physical id of the DynamixelServo to read
reg - Register to read
Returns:
unsigned value at the given register

readRegisters

public int[] readRegisters(DynamixelServo.Id id,
                           Register regFirst,
                           Register regLast)
Reads the values from the Register range specified by regFirst and regLast for the DynamixelServo with the given physical id.

Parameters:
id - physical id of the DynamixelServo to read
regFirst - first Register in the range
regLast - last Register in the range
Returns:
array of unsigned values from the Registers specified

writeRegister

protected boolean writeRegister(DynamixelServo.Id id,
                                Register reg,
                                Integer value,
                                Boolean deferred)
Write a value to the given register for the given DynamixelServo.

Parameters:
id - physical id of the DynamixelServo
reg - Register to write
value - value to write
deferred - if true, data is written but the DynamixelServo state will not change until it receives an ACTION instruction.
Returns:
true if successful

connectServo

protected DynamixelServo connectServo(org.robokind.api.motion.servos.config.ServoConfig config)
Specified by:
connectServo in class org.robokind.api.motion.servos.AbstractServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>

disconnectServo

protected boolean disconnectServo(org.robokind.api.motion.servos.ServoController.ServoId<DynamixelServo.Id> id)
Specified by:
disconnectServo in class org.robokind.api.motion.servos.AbstractServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>

setEnabled

public void setEnabled(Boolean enabled)

getEnabled

public Boolean getEnabled()

connect

public boolean connect()
Specified by:
connect in interface org.robokind.api.motion.servos.ServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>
Overrides:
connect in class org.robokind.impl.motion.serial.SerialServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>

disconnect

public boolean disconnect()
Specified by:
disconnect in interface org.robokind.api.motion.servos.ServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>
Overrides:
disconnect in class org.robokind.impl.motion.serial.SerialServoController<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelServo,DynamixelControllerConfig>

getServoIdClass

public Class<DynamixelServo.Id> getServoIdClass()

getPort

public org.robokind.impl.motion.serial.RXTXSerialPort getPort()

getControlLoop

public DynamixelControlLoop getControlLoop()


Copyright © 2011-2013. All Rights Reserved.