|
||||||||||
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<org.robokind.api.motion.sync.SynchronizedJoint>
org.robokind.api.motion.sync.SynchronizedRobot
public class SynchronizedRobot
Holds multiple Robots and synchronizes their movements for the given JointIds. Events and JointProperties from the primary Robot are forwarded.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.robokind.api.motion.Robot |
---|
Robot.Id, Robot.JointId, Robot.RobotPositionHashMap, Robot.RobotPositionMap |
Field Summary | |
---|---|
static String |
PROP_ADD_ROBOT
Property change event name for adding a Robot. |
static String |
PROP_REMOVE_ROBOT
Property change event name for removing a Robot. |
static org.robokind.api.common.config.VersionProperty |
VERSION
Robot type VersionProperty. |
static String |
VERSION_NAME
Robot type version name. |
static String |
VERSION_NUMBER
Robot type version number. |
Fields inherited from class org.robokind.api.motion.AbstractRobot |
---|
myJointList, myJointMap |
Fields inherited from interface org.robokind.api.motion.Robot |
---|
PROP_CONNECTED, PROP_ENABLED, PROP_ID |
Constructor Summary | |
---|---|
SynchronizedRobot(Robot.Id robotId,
Set<Joint.Id> jointIds)
Creates a new SynchronizedRobot from the given values |
|
SynchronizedRobot(SynchronizedRobotConfig config)
Creates a new SynchronizedRobot from the given configuration. |
Method Summary | |
---|---|
void |
addRobot(Robot robot)
Adds a Robot to be Synchronized. |
boolean |
connect()
The Robot will accept commands only after it is successfully connected. |
void |
disconnect()
Disconnect the Robot. |
Robot |
getPrimaryRobot()
Returns the primary Robot being synchronized. |
List<Robot> |
getRobots()
Returns a List of all Robots being Synchronized. |
boolean |
isConnected()
Returns true if the Robot is connected. |
void |
move(Robot.RobotPositionMap positions,
long lenMillisec)
Move the Joints with the given ids to the corresponding positions. |
void |
removeRobot(Robot.Id robotId)
Removes a Robot from being Synchronized. |
void |
setPrimaryRobot(Robot.Id robotId)
Sets the primary Robot. |
Methods inherited from class org.robokind.api.motion.AbstractRobot |
---|
addJoint, clearJoints, getCurrentPositions, getDefaultPositions, getGoalPositions, getJoint, getJointIds, getJointList, getJointName, getRobotId, isEnabled, removeJoint, setEnabled |
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 |
---|
public static final String VERSION_NAME
public static final String VERSION_NUMBER
public static final org.robokind.api.common.config.VersionProperty VERSION
public static final String PROP_ADD_ROBOT
public static final String PROP_REMOVE_ROBOT
Constructor Detail |
---|
public SynchronizedRobot(SynchronizedRobotConfig config)
config
- configuration for initializing the SynchronizedRobotpublic SynchronizedRobot(Robot.Id robotId, Set<Joint.Id> jointIds)
robotId
- unique Robot.Id for the SynchronizedRobot to usejointIds
- local ids of the joints to synchronizeMethod Detail |
---|
public boolean connect()
Robot
public void disconnect()
Robot
public boolean isConnected()
Robot
public void move(Robot.RobotPositionMap positions, long lenMillisec)
Robot
positions
- map of Joint logical ids and positionslenMillisec
- duration of the movement in millisecondspublic Robot getPrimaryRobot()
public List<Robot> getRobots()
public void addRobot(Robot robot)
robot
- Robot to addpublic void removeRobot(Robot.Id robotId)
robotId
- robot to removepublic void setPrimaryRobot(Robot.Id robotId)
robotId
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |