org.robokind.api.motion
Interface Robot

All Known Implementing Classes:
AbstractRobot, ServoRobot

public interface Robot

A Robot provides access to a List of Joints backed by a List of JointControllers.

Author:
Matthew Stevenson

Nested Class Summary
static class Robot.Id
          Id is an immutable globally unique identifier for a Robot.
static class Robot.JointId
          JointId is an immutable globally unique identifier for a Joint belonging to a Robot.
static class Robot.RobotPositionHashMap
          RobotPositionMap backed by java.util.HashMap.
static interface Robot.RobotPositionMap
          RobotPositionMap expected by the Robot.
 
Field Summary
static String PROP_ID
          Property String for the Id.
 
Method Summary
 boolean connect()
          The Robot will accept commands only after it is successfully connected.
 void disconnect()
          Disconnect 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.
 Joint 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<Joint> 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.
 Map<Robot.JointId,String> getJointNames()
          Returns a map of the Robot's Joint's ids and their names.
 Map<Robot.JointId,? extends Joint> getJoints()
          Returns a map of the Robot's Joints and their ids.
 Robot.Id getRobotId()
          Returns a String uniquely identifying this Robot.
 boolean isConnected()
          Returns true if the Robot is connected.
 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.
 

Field Detail

PROP_ID

static final String PROP_ID
Property String for the Id.

See Also:
Constant Field Values
Method Detail

getRobotId

Robot.Id getRobotId()
Returns a String uniquely identifying this Robot.

Returns:
unique identifier for this Robot

connect

boolean connect()
The Robot will accept commands only after it is successfully connected.

Returns:
true is successful

disconnect

void disconnect()
Disconnect the Robot.


isConnected

boolean isConnected()
Returns true if the Robot is connected.

Returns:
true if the Robot is connected

setEnabled

void setEnabled(boolean val)
Sets the enabled status of the Robot. The Robot only accepts new movements when Enabled is set to true.

Parameters:
val - enabled value

isEnabled

boolean isEnabled()
Returns true if the Robot is enabled and accepting commands.

Returns:
true if the Robot is enabled and accepting commands

getJoint

Joint getJoint(Robot.JointId id)
Return the Joint with the given id.

Parameters:
id - Joint's logical id
Returns:
Joint with the given logical id, null if no Joint is found

getJointIds

Set<Robot.JointId> getJointIds()
Returns a set of the Robot's Joint ids.

Returns:
set of the Robot's Joint ids

getJointList

List<Joint> getJointList()
Returns a List of the Robot's Joints.

Returns:
List of the Robot's Joints

getJoints

Map<Robot.JointId,? extends Joint> getJoints()
Returns a map of the Robot's Joints and their ids.

Returns:
map of the Robot's Joints and their ids

getJointName

String getJointName(Robot.JointId id)
The Robot's name for the Joint with the given logical id.

Parameters:
id - Joint's logical id
Returns:
Robot's name for the Joint with the given logical id

getJointNames

Map<Robot.JointId,String> getJointNames()
Returns a map of the Robot's Joint's ids and their names.

Returns:
map of the Robot's Joint's ids and their names

getDefaultPositions

Robot.RobotPositionMap getDefaultPositions()
Returns a map of the Robot's Joint's ids and their default positions.

Returns:
map of the Robot's Joint's ids and their default positions

getCurrentPositions

Robot.RobotPositionMap getCurrentPositions()
Returns a map of the Robot's Joint's ids and their current positions.

Returns:
map of the Robot's Joint's ids and their current positions

getGoalPositions

Robot.RobotPositionMap getGoalPositions()
Returns a map of the Robot's Joint's ids and their goal positions.

Returns:
map of the Robot's Joint's ids and their goal positions

move

void move(Robot.RobotPositionMap positions,
          long lenMillisec)
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. All Rights Reserved.