org.robokind.api.motion.blending
Class NaiveMotionFrameAverager<Id,PosMap extends JointPositionMap<Id,org.robokind.api.common.position.NormalizedDouble>>

java.lang.Object
  extended by org.robokind.api.motion.blending.NaiveMotionFrameAverager<Id,PosMap>
Type Parameters:
Id - type of id used in the PositionMaps being combined
PosMap - type of PositionMaps being combined
All Implemented Interfaces:
FrameCombiner<MotionFrame<PosMap>,FrameSource<PosMap>,PosMap>

public class NaiveMotionFrameAverager<Id,PosMap extends JointPositionMap<Id,org.robokind.api.common.position.NormalizedDouble>>
extends Object
implements FrameCombiner<MotionFrame<PosMap>,FrameSource<PosMap>,PosMap>

Naively combines MotionFrames by averaging the goal positions. Ignores MotionFrame start positions and timing.

Author:
Matthew Stevenson

Constructor Summary
NaiveMotionFrameAverager(org.jflux.api.core.Source<PosMap> posMapFact)
          Creates a new NaiveMotionFrameAverager/
 
Method Summary
 PosMap combineFrames(long time, long interval, PosMap curPos, Map<? extends MotionFrame<PosMap>,? extends FrameSource<PosMap>> frames)
          Averages the goal positions from the MotionFrames into a single PositionMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NaiveMotionFrameAverager

public NaiveMotionFrameAverager(org.jflux.api.core.Source<PosMap> posMapFact)
Creates a new NaiveMotionFrameAverager/

Parameters:
posMapFact - factory for creating new PositionMaps
Method Detail

combineFrames

public PosMap combineFrames(long time,
                            long interval,
                            PosMap curPos,
                            Map<? extends MotionFrame<PosMap>,? extends FrameSource<PosMap>> frames)
Averages the goal positions from the MotionFrames into a single PositionMap. The MotionFrames' start positions, timing, and FrameSources are ignored.

Specified by:
combineFrames in interface FrameCombiner<MotionFrame<PosMap extends JointPositionMap<Id,org.robokind.api.common.position.NormalizedDouble>>,FrameSource<PosMap extends JointPositionMap<Id,org.robokind.api.common.position.NormalizedDouble>>,PosMap extends JointPositionMap<Id,org.robokind.api.common.position.NormalizedDouble>>
Parameters:
time - time of the move request
interval - time since last move request
curPos - set of current Joint positions
frames - map of Frames and their originating FrameSources
Returns:
PositionMap with averaged goal positions from the MotionFrames


Copyright © 2011-2013. All Rights Reserved.