org.robokind.api.motion.messaging
Class RemoteRobot

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.AbstractRobot<RemoteJoint>
          extended by org.robokind.api.motion.messaging.RemoteRobot
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource, Robot<RemoteJoint>

public class RemoteRobot
extends AbstractRobot<RemoteJoint>

RemoteRobot is a facade for controlling a remotely connected Robot. The RemoteRobot controls the Robot using a RemoteRobotClient.

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
 
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
RemoteRobot(RemoteRobotClient client)
          Creates a RemoteRobot which uses the given RemoteRobotClient.
 
Method Summary
 boolean connect()
          Sends a command for the remote robot to connect.
 void disconnect()
          Sends a command for the remote robot to disconnect.
 boolean isConnected()
          Returns the remote robot's connection status.
 boolean isEnabled()
          Returns true if the Robot is enabled and accepting commands.
 void move(Robot.RobotPositionMap positions, long lenMillisec)
          Move the Joints with the given ids to the corresponding positions.
 void setEnabled(boolean val)
          Sets the enabled status of the Robot.
 boolean updateRobot()
          Updates all cached values.
 
Methods inherited from class org.robokind.api.motion.AbstractRobot
addJoint, clearJoints, getCurrentPositions, getDefaultPositions, getGoalPositions, getJoint, getJointIds, getJointList, getJointName, getRobotId, removeJoint
 
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

RemoteRobot

public RemoteRobot(RemoteRobotClient client)
Creates a RemoteRobot which uses the given RemoteRobotClient.

Parameters:
client - client for the remote Robot
Method Detail

updateRobot

public boolean updateRobot()
Updates all cached values.

Returns:
true if successful

connect

public boolean connect()
Sends a command for the remote robot to connect.

Returns:
true if successful

disconnect

public void disconnect()
Sends a command for the remote robot to disconnect.


isConnected

public boolean isConnected()
Returns the remote robot's connection status.

Returns:
true if successful

setEnabled

public void setEnabled(boolean val)
Description copied from class: AbstractRobot
Sets the enabled status of the Robot. The Robot only accepts new movements when Enabled is set to true.

Specified by:
setEnabled in interface Robot<RemoteJoint>
Overrides:
setEnabled in class AbstractRobot<RemoteJoint>
Parameters:
val - enabled value

isEnabled

public boolean isEnabled()
Description copied from class: AbstractRobot
Returns true if the Robot is enabled and accepting commands.

Specified by:
isEnabled in interface Robot<RemoteJoint>
Overrides:
isEnabled in class AbstractRobot<RemoteJoint>
Returns:
true if the Robot is enabled and accepting commands

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


Copyright © 2011-2013. All Rights Reserved.