org.robokind.api.motion.servos
Class ServoRobot

java.lang.Object
  extended by org.robokind.api.motion.AbstractRobot<ServoJoint>
      extended by org.robokind.api.motion.servos.ServoRobot
All Implemented Interfaces:
Robot

public class ServoRobot
extends AbstractRobot<ServoJoint>

Robot implementation using Servos.

Author:
Matthew Stevenson

Nested Class Summary
static class ServoRobot.ServoControllerContext<T extends Servo<?,?>>
          Contains the objects used for loading and creating a ServoController.
 
Nested classes/interfaces inherited from interface org.robokind.api.motion.Robot
Robot.Id, Robot.JointId, Robot.RobotPositionHashMap, Robot.RobotPositionMap
 
Field Summary
static org.robokind.api.common.config.VersionProperty VERSION
          Controller type VersionProperty.
static String VERSION_NAME
          Controller type version name.
static String VERSION_NUMBER
          Controller type version number.
 
Fields inherited from class org.robokind.api.motion.AbstractRobot
myJointList, myJointMap
 
Fields inherited from interface org.robokind.api.motion.Robot
PROP_ID
 
Constructor Summary
ServoRobot(ServoRobotConfig config)
          Creates a new ServoRobot with the given BundleContext and RobotConfig.
 
Method Summary
 boolean connect()
          The Robot will accept commands only after it is successfully connected.
 void disconnect()
          Disconnect the Robot.
 List<ServoController> getControllerList()
          Returns a List of ServoControllers.
 Map<ServoController.Id,ServoController> getControllers()
          Returns an unmodifiable Map of ServoController.Ids and ServoControllers.
 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 setEnabled(boolean val)
          Sets the enabled status of the Robot.
 
Methods inherited from class org.robokind.api.motion.AbstractRobot
addJoint, clearJoints, getCurrentPositions, getDefaultPositions, getGoalPositions, getJoint, getJointIds, getJointList, getJointName, getJointNames, getJoints, getRobotId, isEnabled, removeJoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_NAME

public static final String VERSION_NAME
Controller type version name.

See Also:
Constant Field Values

VERSION_NUMBER

public static final String VERSION_NUMBER
Controller type version number.

See Also:
Constant Field Values

VERSION

public static final org.robokind.api.common.config.VersionProperty VERSION
Controller type VersionProperty.

Constructor Detail

ServoRobot

public ServoRobot(ServoRobotConfig config)
Creates a new ServoRobot with the given BundleContext and RobotConfig.

Parameters:
config - Robot's configuration parameters
Method Detail

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
Overrides:
setEnabled in class AbstractRobot<ServoJoint>
Parameters:
val - enabled value

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

getControllers

public Map<ServoController.Id,ServoController> getControllers()
Returns an unmodifiable Map of ServoController.Ids and ServoControllers.

Returns:
unmodifiable Map of ServoController.Ids and ServoControllers

getControllerList

public List<ServoController> getControllerList()
Returns a List of ServoControllers.

Returns:
List of ServoControllers


Copyright © 2011. All Rights Reserved.