org.robokind.api.motion.utils
Class RobotMoverFrameSource

java.lang.Object
  extended by org.robokind.api.motion.utils.RobotMoverFrameSource
All Implemented Interfaces:
FrameSource<Robot.RobotPositionMap>, RobotFrameSource
Direct Known Subclasses:
RobotMoveHandler

public class RobotMoverFrameSource
extends Object
implements RobotFrameSource

A FrameSource which acts as a Robot move proxy. Accepts movements as a RobotPositionMap and time length.

Author:
Matthew Stevenson

Constructor Summary
RobotMoverFrameSource(Robot robot)
          Creates a new RobotMoverFrameSource for the given Robot.
 
Method Summary
 MotionFrame getMovements(long currentTimeUTC, long moveLengthMilliSec)
          Returns the desired Robot movement starting at the given time and lasting for the given number of milliseconds.
 Robot getRobot()
           
 void move(Robot.RobotPositionMap positions, long lenMillisec)
          Moves the Robot to the given positions in the given time length.
 void setRobot(Robot robot)
          Sets the Robot to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotMoverFrameSource

public RobotMoverFrameSource(Robot robot)
Creates a new RobotMoverFrameSource for the given Robot.

Parameters:
robot - Robot to move
Method Detail

setRobot

public void setRobot(Robot robot)
Description copied from interface: RobotFrameSource
Sets the Robot to

Specified by:
setRobot in interface RobotFrameSource

getRobot

public Robot getRobot()
Specified by:
getRobot in interface RobotFrameSource

move

public void move(Robot.RobotPositionMap positions,
                 long lenMillisec)
Moves the Robot to the given positions in the given time length.

Parameters:
positions - goal positions
lenMillisec - length of the movement in milliseconds

getMovements

public MotionFrame getMovements(long currentTimeUTC,
                                long moveLengthMilliSec)
Description copied from interface: FrameSource
Returns the desired Robot movement starting at the given time and lasting for the given number of milliseconds. The frequency and regularity of calls will depend on the Blender configuration used. The DefaultBlender runs in a continuous loop calling FrameSources at 40 millisecond intervals.

Specified by:
getMovements in interface FrameSource<Robot.RobotPositionMap>
Parameters:
currentTimeUTC - time of the move request
moveLengthMilliSec - expected length of the movement returned, the actual returned length does not have to be same, but the actual movement results will depend on the Blender used
Returns:
MotionFrame desired robot movement


Copyright © 2011-2013. All Rights Reserved.