org.robokind.impl.motion.openservo.feedback
Class ConcurrentOpenServoCache

java.lang.Object
  extended by org.robokind.impl.motion.openservo.feedback.ConcurrentOpenServoCache

public class ConcurrentOpenServoCache
extends Object

Provides concurrency for reading and updating values used by the DynamixelControlLoop. This will accept new values, both dynamixel feedback values and new goal positions, merging them in a thread-safe manner.

Author:
Matthew Stevenson

Constructor Summary
ConcurrentOpenServoCache()
           
 
Method Summary
 Collection<MoveParams<OpenServo.Id>> acquireMoveParams()
          Locks the cache and returns the MoveParams.
 void addFeedbackValues(Collection<OpenServoFeedbackValues> values)
          Attempts to merge the given values into the MoveParam cache.
 boolean getMoveFlag()
           
 Map<OpenServo.Id,OpenServoCache> getValueMap()
           
 void releaseMoveParams()
           
 void setGoalPositions(Collection<GoalUpdateValues<OpenServo.Id>> goals)
           
 void setMoveFlag(boolean val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentOpenServoCache

public ConcurrentOpenServoCache()
Method Detail

acquireMoveParams

public Collection<MoveParams<OpenServo.Id>> acquireMoveParams()
Locks the cache and returns the MoveParams. releaseMoveParams() must be called when done using the params.

Returns:

releaseMoveParams

public void releaseMoveParams()

addFeedbackValues

public void addFeedbackValues(Collection<OpenServoFeedbackValues> values)
Attempts to merge the given values into the MoveParam cache. If the params are in use and locked, the values are queued to be merged when unlocked.


setGoalPositions

public void setGoalPositions(Collection<GoalUpdateValues<OpenServo.Id>> goals)

getMoveFlag

public boolean getMoveFlag()

setMoveFlag

public void setMoveFlag(boolean val)

getValueMap

public Map<OpenServo.Id,OpenServoCache> getValueMap()


Copyright © 2011-2013. All Rights Reserved.