org.robokind.impl.motion.dynamixel
Class DynamixelServo

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.servos.AbstractServo<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelController>
          extended by org.robokind.impl.motion.dynamixel.DynamixelServo
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.robokind.api.common.property.PropertyChangeSource, org.robokind.api.motion.servos.Servo<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>>

public class DynamixelServo
extends org.robokind.api.motion.servos.AbstractServo<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelController>

Represents a Dynamixel servo in a Dynamixel chain.

Author:
Matthew Stevenson

Nested Class Summary
static class DynamixelServo.Id
           
 
Field Summary
 
Fields inherited from class org.robokind.api.motion.servos.AbstractServo
myConfig, myController, myGoalPosition, myServoId
 
Fields inherited from interface org.robokind.api.motion.servos.Servo
PROP_ENABLED, PROP_GOAL_POSITION
 
Constructor Summary
DynamixelServo(org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id> params, DynamixelController controller)
          Creates a new DynamixelServo from the given JointConfig and DynamixelController.
 
Method Summary
 void cacheValues()
          Reads all Registers for the DynamixelServo and updates the cache.
 boolean changed()
          Returns true if Register values have been changed.
 Integer get(Register reg)
          Returns the value at the given register.
 ErrorStatus getAlarmLed()
          Returns the ErrorStatus which triggers the Alarm LED.
 ErrorStatus getAlarmShutdown()
          Returns the ErrorStatus which triggers a servo shutdown.
 DynamixelBaudRate getBaudRate()
          Returns the BaudRate expected by the DynamixelServo.
 Integer getCcwAngleLimit()
           
 Integer getCcwComplianceMargin()
           
 Integer getCcwComplianceSlope()
           
 Integer getCurrentLoad()
           
 org.robokind.api.common.position.NormalizedDouble getCurrentPosition()
           
 Integer getCurrentPositionAbs()
          Returns the absolute position of the Dynamixel between 0-1023
 Integer getCurrentSpeed()
           
 Integer getCurrentTemperature()
           
 Integer getCurrentVoltage()
           
 Integer getCwAngleLimit()
           
 Integer getCwComplianceMargin()
           
 Integer getCwComplianceSlope()
           
 org.robokind.api.common.position.NormalizedDouble getDefaultPosition()
           
 Boolean getEnabled()
           
 Integer getFirmwareVersion()
           
 float getHighVoltageLimit()
           
 Boolean getLed()
           
 Boolean getLock()
           
 float getLowVoltageLimit()
           
 int getMaxPosition()
           
 Integer getMaxTorque()
           
 int getMinPosition()
           
 Integer getModelNumber()
           
 Boolean getMoving()
           
 Integer getMovingSpeed()
          Returns the moving speed as a value 1(slow) - 1023(fast), with 0 being full speed.
 String getName()
           
 DynamixelServo.Id getPhysicalId()
           
protected  int getPreviousPosition()
           
 Integer getPunch()
           
 Boolean getRegisteredInstruction()
           
protected  Integer GetRegisterValue(Register reg)
           
 Integer getReturnDelay()
           
 Integer getStatusReturnLevel()
           
 Integer getTemperatureLimit()
           
 Boolean getTorqueEnable()
           
 Integer getTorqueLimit()
           
protected  void put(Register reg, Integer value)
          Sets the value of a given register.
protected  boolean reset()
          Resets the DynamixelServo to the default factory settings.
 void setAlarmLed(ErrorStatus value)
          Sets the ErrorStatus which triggers the Alarm LED.
 void setAlarmShutdown(ErrorStatus value)
          Sets the ErrorStatus which triggers a servo shutdown.
 void setBaudRate(DynamixelBaudRate value)
          Sets the BaudRate expected by the DynamixelServo
 void setCcwAngleLimit(Integer value)
           
 void setCcwComplianceMargin(Integer value)
           
 void setCcwComplianceSlope(Integer value)
           
 void setCwAngleLimit(Integer value)
           
 void setCwComplianceMargin(Integer value)
           
 void setCwComplianceSlope(Integer value)
           
 void setEnabled(Boolean enabled)
           
 void setFeedbackVals(FeedbackUpdateValues vals)
           
 void setGoalPosition(org.robokind.api.common.position.NormalizedDouble value)
           
 void setHighVoltageLimit(float value)
           
 void setLed(Boolean value)
           
 void setLowVoltageLimit(float value)
           
 void setMaxTorque(Integer value)
           
 void setMovingSpeed(Integer value)
          Sets the moving speed with a value 1(slow) - 1023(fast), and 0 being full speed.
protected  void setPreviousPosition(int pos)
           
 void setPunch(Integer value)
           
 void setRegisteredInstruction(Boolean value)
           
protected  void SetRegisterValue(Register reg, Integer value)
          Sets the value for the given Register.
 void setReturnDelay(Integer value)
           
 void setStatusReturnLevel(Integer value)
           
 void setTemperatureLimit(Integer value)
           
 void setTorqueEnabled(Boolean value)
           
 void setTorqueLimit(Integer value)
           
 
Methods inherited from class org.robokind.api.motion.servos.AbstractServo
getAbsoluteGoalPosition, getConfig, getController, getGoalPosition, getId, getPositionRange, propertyChange
 
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
 

Constructor Detail

DynamixelServo

public DynamixelServo(org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id> params,
                      DynamixelController controller)
Creates a new DynamixelServo from the given JointConfig and DynamixelController.

Parameters:
params - JointConfig for the new Joint
controller - DynamixelController for the new Joint
Method Detail

getPhysicalId

public final DynamixelServo.Id getPhysicalId()

setEnabled

public void setEnabled(Boolean enabled)

getEnabled

public Boolean getEnabled()

getName

public String getName()

getMinPosition

public int getMinPosition()

getMaxPosition

public int getMaxPosition()

getPreviousPosition

protected int getPreviousPosition()

setPreviousPosition

protected void setPreviousPosition(int pos)

getDefaultPosition

public org.robokind.api.common.position.NormalizedDouble getDefaultPosition()

get

public Integer get(Register reg)
Returns the value at the given register.

Parameters:
reg - register to read
Returns:
value at the given register

put

protected void put(Register reg,
                   Integer value)
Sets the value of a given register.

Parameters:
reg - register to set
value - value to set

setGoalPosition

public void setGoalPosition(org.robokind.api.common.position.NormalizedDouble value)
Specified by:
setGoalPosition in interface org.robokind.api.motion.servos.Servo<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>>
Overrides:
setGoalPosition in class org.robokind.api.motion.servos.AbstractServo<DynamixelServo.Id,org.robokind.api.motion.servos.config.ServoConfig<DynamixelServo.Id>,DynamixelController>

getMovingSpeed

public Integer getMovingSpeed()
Returns the moving speed as a value 1(slow) - 1023(fast), with 0 being full speed.

Returns:
moving speed as a value 1(slow) - 1023(fast), with 0 being full speed

setMovingSpeed

public void setMovingSpeed(Integer value)
Sets the moving speed with a value 1(slow) - 1023(fast), and 0 being full speed.

Parameters:
value - moving speed value; 1(slow) - 1023(fast), and 0 being full speed

getAlarmLed

public ErrorStatus getAlarmLed()
Returns the ErrorStatus which triggers the Alarm LED.

Returns:
ErrorStatus which triggers the Alarm LED

setAlarmLed

public void setAlarmLed(ErrorStatus value)
Sets the ErrorStatus which triggers the Alarm LED.

Parameters:
value - ErrorStatus to triggers the Alarm LED

getAlarmShutdown

public ErrorStatus getAlarmShutdown()
Returns the ErrorStatus which triggers a servo shutdown.

Returns:
ErrorStatus which triggers a servo shutdown

setAlarmShutdown

public void setAlarmShutdown(ErrorStatus value)
Sets the ErrorStatus which triggers a servo shutdown.

Parameters:
value - ErrorStatus to triggers a servo shutdown

getBaudRate

public DynamixelBaudRate getBaudRate()
Returns the BaudRate expected by the DynamixelServo.

Returns:
BaudRate expected by the DynamixelServo

setBaudRate

public void setBaudRate(DynamixelBaudRate value)
Sets the BaudRate expected by the DynamixelServo

Parameters:
value - BaudRate to be expected by the DynamixelServo

getCcwAngleLimit

public Integer getCcwAngleLimit()
Returns:

setCcwAngleLimit

public void setCcwAngleLimit(Integer value)
Parameters:
value -

getCwAngleLimit

public Integer getCwAngleLimit()
Returns:

setCwAngleLimit

public void setCwAngleLimit(Integer value)
Parameters:
value -

getCcwComplianceMargin

public Integer getCcwComplianceMargin()
Returns:

setCcwComplianceMargin

public void setCcwComplianceMargin(Integer value)
Parameters:
value -

getCwComplianceMargin

public Integer getCwComplianceMargin()
Returns:

setCwComplianceMargin

public void setCwComplianceMargin(Integer value)
Parameters:
value -

getCcwComplianceSlope

public Integer getCcwComplianceSlope()
Returns:

setCcwComplianceSlope

public void setCcwComplianceSlope(Integer value)
Parameters:
value -

getCwComplianceSlope

public Integer getCwComplianceSlope()
Returns:

setCwComplianceSlope

public void setCwComplianceSlope(Integer value)
Parameters:
value -

getCurrentLoad

public Integer getCurrentLoad()
Returns:

getCurrentPosition

public org.robokind.api.common.position.NormalizedDouble getCurrentPosition()
Returns:

getCurrentPositionAbs

public Integer getCurrentPositionAbs()
Returns the absolute position of the Dynamixel between 0-1023

Returns:
absolute position of the Dynamixel between 0-1023

getCurrentSpeed

public Integer getCurrentSpeed()
Returns:

getCurrentTemperature

public Integer getCurrentTemperature()
Returns:

getCurrentVoltage

public Integer getCurrentVoltage()
Returns:

getTorqueEnable

public Boolean getTorqueEnable()
Returns:

setTorqueEnabled

public void setTorqueEnabled(Boolean value)
Parameters:
value -

getFirmwareVersion

public Integer getFirmwareVersion()
Returns:

getLed

public Boolean getLed()
Returns:

setLed

public void setLed(Boolean value)
Parameters:
value -

getLock

public Boolean getLock()
Returns:

getTemperatureLimit

public Integer getTemperatureLimit()
Returns:

setTemperatureLimit

public void setTemperatureLimit(Integer value)
Parameters:
value -

getMaxTorque

public Integer getMaxTorque()
Returns:

setMaxTorque

public void setMaxTorque(Integer value)
Parameters:
value -

getHighVoltageLimit

public float getHighVoltageLimit()
Returns:

setHighVoltageLimit

public void setHighVoltageLimit(float value)
Parameters:
value -

getLowVoltageLimit

public float getLowVoltageLimit()
Returns:

setLowVoltageLimit

public void setLowVoltageLimit(float value)
Parameters:
value -

getModelNumber

public Integer getModelNumber()
Returns:

getMoving

public Boolean getMoving()
Returns:

getPunch

public Integer getPunch()
Returns:

setPunch

public void setPunch(Integer value)
Parameters:
value -

getRegisteredInstruction

public Boolean getRegisteredInstruction()
Returns:

setRegisteredInstruction

public void setRegisteredInstruction(Boolean value)
Parameters:
value -

getReturnDelay

public Integer getReturnDelay()
Returns:

setReturnDelay

public void setReturnDelay(Integer value)
Parameters:
value -

getStatusReturnLevel

public Integer getStatusReturnLevel()
Returns:

setStatusReturnLevel

public void setStatusReturnLevel(Integer value)
Parameters:
value -

getTorqueLimit

public Integer getTorqueLimit()
Returns:

setTorqueLimit

public void setTorqueLimit(Integer value)
Parameters:
value -

reset

protected boolean reset()
Resets the DynamixelServo to the default factory settings. WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! USE THIS METHOD WITH CAUTION. THIS WILL CAUSE THE JOINT'S PHYSICAL ID AND BAUD RATE TO CHANGE. This method should not be used with robots from HansonRobokind as it will cause the Joint to stop functioning properly. This is included only to provide complete Dynamixel functionality for use in other applications.

Returns:
true if successful

GetRegisterValue

protected Integer GetRegisterValue(Register reg)
Parameters:
reg -
Returns:

SetRegisterValue

protected void SetRegisterValue(Register reg,
                                Integer value)
Sets the value for the given Register.

Parameters:
reg - Register to set
value - value to set

cacheValues

public void cacheValues()
Reads all Registers for the DynamixelServo and updates the cache.


changed

public boolean changed()
Returns true if Register values have been changed.

Returns:
true if Register values have been changed

setFeedbackVals

public void setFeedbackVals(FeedbackUpdateValues vals)


Copyright © 2011-2013. All Rights Reserved.