org.robokind.api.motion.messaging
Class RemoteJoint

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.messaging.RemoteJoint
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource, Joint

public class RemoteJoint
extends org.robokind.api.common.property.PropertyChangeNotifier
implements Joint

RemoteJoint represents a Joint on a RemoteRobot.

Author:
Matthew Stevenson

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.robokind.api.motion.Joint
Joint.Id
 
Field Summary
 
Fields inherited from interface org.robokind.api.motion.Joint
PROP_ENABLED, PROP_GOAL_POSITION
 
Constructor Summary
RemoteJoint(RemoteRobot robot, RobotDefinitionResponse.JointDefinition def)
          Creates a RemoteJoint with the given values.
 
Method Summary
 org.robokind.api.common.position.NormalizedDouble getDefaultPosition()
          Returns the Joint's default position.
 Boolean getEnabled()
          If enabled, this Joint will accept move commands.
 org.robokind.api.common.position.NormalizedDouble getGoalPosition()
          Returns the goal position.
 Joint.Id getId()
          Returns the Joint's logical id.
 String getName()
          Returns the name of the Joint.
 org.robokind.api.common.position.NormalizableRange<Double> getPositionRange()
          Returns the NormalizableRange describing the range of motion.
 Collection<JointProperty> getProperties()
           
 JointProperty getProperty(String name)
          Returns the JointProperty with the given name.
<T> JointProperty<T>
getProperty(String name, Class<T> propertyType)
          Returns the JointProperty with the given name, ensuring the value is assignable to propertyType.
 void setEnabled(Boolean enabled)
          If enabled, this Joint will accept move commands.
protected  void setGoalPosition(org.robokind.api.common.position.NormalizedDouble goal)
           
 Boolean updateEnabledStatus()
          Makes a request to the remote joint for the actual enabled status, and updates this joint, firing a property change event.
 
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

RemoteJoint

public RemoteJoint(RemoteRobot robot,
                   RobotDefinitionResponse.JointDefinition def)
Creates a RemoteJoint with the given values.

Parameters:
robot - RemoteRobot this RemoteJoint belongs to
def - JointDefinition for initializing this Joint
Method Detail

getId

public Joint.Id getId()
Description copied from interface: Joint
Returns the Joint's logical id.

Specified by:
getId in interface Joint
Returns:
Joint's logical id

getName

public String getName()
Description copied from interface: Joint
Returns the name of the Joint.

Specified by:
getName in interface Joint
Returns:
name of the Joint

getDefaultPosition

public org.robokind.api.common.position.NormalizedDouble getDefaultPosition()
Description copied from interface: Joint
Returns the Joint's default position.

Specified by:
getDefaultPosition in interface Joint
Returns:
Joint's default position

setGoalPosition

protected void setGoalPosition(org.robokind.api.common.position.NormalizedDouble goal)
Parameters:
goal -

getGoalPosition

public org.robokind.api.common.position.NormalizedDouble getGoalPosition()
Description copied from interface: Joint
Returns the goal position.

Specified by:
getGoalPosition in interface Joint
Returns:
goal position

setEnabled

public void setEnabled(Boolean enabled)
Description copied from interface: Joint
If enabled, this Joint will accept move commands. If not enabled, this joint should not move.

Specified by:
setEnabled in interface Joint

getEnabled

public Boolean getEnabled()
Description copied from interface: Joint
If enabled, this Joint will accept move commands. If not enabled, this joint should not move.

Specified by:
getEnabled in interface Joint
Returns:
true if enabled

updateEnabledStatus

public Boolean updateEnabledStatus()
Makes a request to the remote joint for the actual enabled status, and updates this joint, firing a property change event. Returns true if the request was successful and false if it timed out.

Returns:
true if the request was successful and false if it timed out

getProperty

public <T> JointProperty<T> getProperty(String name,
                                        Class<T> propertyType)
Description copied from interface: Joint
Returns the JointProperty with the given name, ensuring the value is assignable to propertyType.

Specified by:
getProperty in interface Joint
Type Parameters:
T - Value Type returned by the JointProperty
Parameters:
name - name of the JointProperty
propertyType - Class for T
Returns:
the JointProperty with the given name and value assignable to propertyType

getProperty

public JointProperty getProperty(String name)
Description copied from interface: Joint
Returns the JointProperty with the given name.

Specified by:
getProperty in interface Joint
Parameters:
name - name of the JointProperty
Returns:
the JointProperty with the given name

getPositionRange

public org.robokind.api.common.position.NormalizableRange<Double> getPositionRange()
Description copied from interface: Joint
Returns the NormalizableRange describing the range of motion.

Specified by:
getPositionRange in interface Joint
Returns:
NormalizableRange describing the range of motion

getProperties

public Collection<JointProperty> getProperties()
Specified by:
getProperties in interface Joint


Copyright © 2011-2013. All Rights Reserved.