org.robokind.api.motion.sync
Class SynchronizedRobot

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.AbstractRobot<org.robokind.api.motion.sync.SynchronizedJoint>
          extended by org.robokind.api.motion.sync.SynchronizedRobot
All Implemented Interfaces:
PropertyChangeSource, Robot<org.robokind.api.motion.sync.SynchronizedJoint>

public class SynchronizedRobot
extends AbstractRobot<org.robokind.api.motion.sync.SynchronizedJoint>

Holds multiple Robots and synchronizes their movements for the given JointIds. Events and JointProperties from the primary Robot are forwarded.

Author:
Matthew Stevenson

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
           
static String PROP_REMOVE_ROBOT
           
static 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)
           
SynchronizedRobot(SynchronizedRobotConfig config)
           
 
Method Summary
 void addRobot(Robot robot)
           
 boolean connect()
          The Robot will accept commands only after it is successfully connected.
 void disconnect()
          Disconnect the Robot.
 Robot getPrimaryRobot()
           
 List<Robot> getRobots()
           
 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)
           
 void setPrimaryRobot(Robot.Id robotId)
           
 
Methods inherited from class org.robokind.api.motion.AbstractRobot
addJoint, clearJoints, getCurrentPositions, getDefaultPositions, getGoalPositions, getJoint, getJointIds, getJointList, getJointName, getJointNames, getJoints, getRobotId, isEnabled, removeJoint, setEnabled
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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

VERSION_NAME

public static final String VERSION_NAME
Robot type version name.

See Also:
Constant Field Values

VERSION_NUMBER

public static final String VERSION_NUMBER
Robot type version number.

See Also:
Constant Field Values

VERSION

public static final VersionProperty VERSION
Robot type VersionProperty.


PROP_ADD_ROBOT

public static final String PROP_ADD_ROBOT
See Also:
Constant Field Values

PROP_REMOVE_ROBOT

public static final String PROP_REMOVE_ROBOT
See Also:
Constant Field Values
Constructor Detail

SynchronizedRobot

public SynchronizedRobot(SynchronizedRobotConfig config)

SynchronizedRobot

public SynchronizedRobot(Robot.Id robotId,
                         Set<Joint.Id> jointIds)
Method Detail

connect

public boolean connect()
Description copied from interface: Robot
The Robot will accept commands only after it is successfully connected.

Returns:
true is successful

disconnect

public void disconnect()
Description copied from interface: Robot
Disconnect the Robot.


isConnected

public boolean isConnected()
Description copied from interface: Robot
Returns true if the Robot is connected.

Returns:
true if the Robot is connected

move

public void move(Robot.RobotPositionMap positions,
                 long lenMillisec)
Description copied from interface: Robot
Move the Joints with the given ids to the corresponding positions.

Parameters:
positions - map of Joint logical ids and positions
lenMillisec - duration of the movement in milliseconds

getPrimaryRobot

public Robot getPrimaryRobot()

getRobots

public List<Robot> getRobots()

addRobot

public void addRobot(Robot robot)

removeRobot

public void removeRobot(Robot.Id robotId)

setPrimaryRobot

public void setPrimaryRobot(Robot.Id robotId)


Copyright © 2011-2012. All Rights Reserved.