J - Type of Joint used by this Robotpublic abstract class AbstractRobot<J extends Joint> extends PropertyChangeNotifier implements Robot<J>
Robot.Id, Robot.JointId, Robot.RobotPositionHashMap, Robot.RobotPositionMap| Modifier and Type | Field and Description |
|---|---|
protected List<J> |
myJointList
List of Joints to preserve order
|
protected Map<Robot.JointId,J> |
myJointMap
Map of the Robot's JointIds and Joints.
|
PROP_CONNECTED, PROP_ENABLED, PROP_ID| Constructor and Description |
|---|
AbstractRobot(Robot.Id robotId)
Creates an empty Robot with the given RobotId
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addJoint(J j)
Adds the given Joint to the Robot.
|
protected void |
clearJoints()
Removes all Joints from the Robot.
|
Robot.RobotPositionMap |
getCurrentPositions()
Returns a map of the Robot's Joint's ids and their current positions.
|
Robot.RobotPositionMap |
getDefaultPositions()
Returns a map of the Robot's Joint's ids and their default positions.
|
Robot.RobotPositionMap |
getGoalPositions()
Returns a map of the Robot's Joint's ids and their goal positions.
|
J |
getJoint(Robot.JointId id)
Return the Joint with the given id.
|
Set<Robot.JointId> |
getJointIds()
Returns a set of the Robot's Joint ids.
|
List<J> |
getJointList()
Returns a List of the Robot's Joints.
|
String |
getJointName(Robot.JointId id)
The Robot's name for the Joint with the given logical id.
|
Robot.Id |
getRobotId()
Returns a String uniquely identifying this Robot.
|
boolean |
isEnabled()
Returns true if the Robot is enabled and accepting commands.
|
protected boolean |
removeJoint(J j)
Removes the given Joint from the Robot.
|
void |
setEnabled(boolean val)
Sets the enabled status of the Robot.
|
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, disconnect, isConnected, moveaddPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListenerprotected Map<Robot.JointId,J extends Joint> myJointMap
public AbstractRobot(Robot.Id robotId)
robotId - unique RobotIdpublic Robot.Id getRobotId()
RobotgetRobotId in interface Robot<J extends Joint>public J getJoint(Robot.JointId id)
Robotpublic Set<Robot.JointId> getJointIds()
RobotgetJointIds in interface Robot<J extends Joint>public String getJointName(Robot.JointId id)
RobotgetJointName in interface Robot<J extends Joint>id - Joint's logical idpublic boolean isEnabled()
public void setEnabled(boolean val)
setEnabled in interface Robot<J extends Joint>val - enabled valuepublic Robot.RobotPositionMap getDefaultPositions()
RobotgetDefaultPositions in interface Robot<J extends Joint>public Robot.RobotPositionMap getCurrentPositions()
RobotgetCurrentPositions in interface Robot<J extends Joint>public Robot.RobotPositionMap getGoalPositions()
RobotgetGoalPositions in interface Robot<J extends Joint>protected boolean addJoint(J j)
j - Joint to addprotected boolean removeJoint(J j)
j - Joint to removeprotected void clearJoints()
Copyright © 2011-2014. All Rights Reserved.