|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.robokind.api.common.property.PropertyChangeNotifier
org.robokind.api.motion.AbstractRobot<J>
J - Type of Joint used by this Robotpublic abstract class AbstractRobot<J extends Joint>
Provides common functionality for Robot implementations
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.robokind.api.motion.Robot |
|---|
Robot.Id, Robot.JointId, Robot.RobotPositionHashMap, Robot.RobotPositionMap |
| Field Summary | |
|---|---|
protected List<J> |
myJointList
List of Joints to preserve order |
protected Map<Robot.JointId,J> |
myJointMap
Map of the Robot's JointIds and Joints. |
| Fields inherited from interface org.robokind.api.motion.Robot |
|---|
PROP_CONNECTED, PROP_ENABLED, PROP_ID |
| Constructor Summary | |
|---|---|
AbstractRobot(Robot.Id robotId)
Creates an empty Robot with the given RobotId |
|
| Method Summary | |
|---|---|
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. |
| 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.motion.Robot |
|---|
connect, disconnect, isConnected, move |
| Methods inherited from interface org.robokind.api.common.property.PropertyChangeSource |
|---|
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
protected Map<Robot.JointId,J extends Joint> myJointMap
protected List<J extends Joint> myJointList
| Constructor Detail |
|---|
public AbstractRobot(Robot.Id robotId)
robotId - unique RobotId| Method Detail |
|---|
public Robot.Id getRobotId()
Robot
getRobotId in interface Robot<J extends Joint>public J getJoint(Robot.JointId id)
Robot
getJoint in interface Robot<J extends Joint>id - Joint's logical id
public Set<Robot.JointId> getJointIds()
Robot
getJointIds in interface Robot<J extends Joint>public String getJointName(Robot.JointId id)
Robot
getJointName in interface Robot<J extends Joint>id - Joint's logical id
public boolean isEnabled()
isEnabled in interface Robot<J extends Joint>public void setEnabled(boolean val)
setEnabled in interface Robot<J extends Joint>val - enabled valuepublic Robot.RobotPositionMap getDefaultPositions()
Robot
getDefaultPositions in interface Robot<J extends Joint>public Robot.RobotPositionMap getCurrentPositions()
Robot
getCurrentPositions in interface Robot<J extends Joint>public Robot.RobotPositionMap getGoalPositions()
Robot
getGoalPositions in interface Robot<J extends Joint>protected boolean addJoint(J j)
j - Joint to add
protected boolean removeJoint(J j)
j - Joint to remove
protected void clearJoints()
public List<J> getJointList()
Robot
getJointList in interface Robot<J extends Joint>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||