public class PositionTargetFrameSource extends Object implements RobotFrameSource
| Constructor and Description |
|---|
PositionTargetFrameSource(double velocity,
Robot.RobotPositionMap targetPositions)
Creates a new MotionTargetFrameSource
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearPositions()
Clears all target positions and disables this MotionTargetFrameSource.
|
protected void |
disableAtGoal() |
boolean |
getEnabled()
Returns true if enabled
|
MotionFrame |
getMovements(long time,
long interval)
Creates a MotionFrame starting at the Robot's goal positions, and moving
towards the target positions as much as the velocity will allow in the
given time interval.
|
Robot |
getRobot() |
boolean |
getStopOnGoalFlag()
Returns the StopOnGoalFlag.
|
double |
getVelocity()
Returns the velocity, measured as (change in NormalizedDouble)/millisecond
|
protected boolean |
isAtGoal() |
void |
putPosition(Robot.JointId id,
NormalizedDouble position)
Set the target position for the given JointId and enables this
MotionTargetFrameSource.
|
void |
putPositions(Robot.RobotPositionMap targetPositions)
Puts the given positions in the target position map and enables this
MotionTargetFrameSource.
|
void |
setEnabled(boolean enabled)
If false, this MotionTargetFrameSource will return null when queried for
Movements.
|
void |
setRobot(Robot robot)
Sets the Robot to
|
void |
setStopOnGoal(boolean val)
When StopOnGoal is set true, the MotionTargetFrameSource will disable
itself after reaching the target positions.
|
void |
setVelocity(double velocity)
Set the max velocity, measured as (change in NormalizedDouble)/millisecond.
|
public PositionTargetFrameSource(double velocity,
Robot.RobotPositionMap targetPositions)
context - BundleContext used to retrieve the RobotrobotId - Id of the Robot to movevelocity - maximum allowed velocity. The velocity is measured in
terms of (change in NormalizedDouble)/millisecondtargetPositions - initial target positions to move towards.
Positions for Joints not belonging to the Robot with the given robotId
are ignoredpublic void setRobot(Robot robot)
RobotFrameSourcesetRobot in interface RobotFrameSourcepublic Robot getRobot()
getRobot in interface RobotFrameSourcepublic void setEnabled(boolean enabled)
enabled - public boolean getEnabled()
public void setVelocity(double velocity)
velocity - max velocity, measured as
(change in NormalizedDouble)/millisecondpublic double getVelocity()
public void setStopOnGoal(boolean val)
val - value for StopOnGoalpublic boolean getStopOnGoalFlag()
public void putPositions(Robot.RobotPositionMap targetPositions)
targetPositions - positions to addpublic void putPosition(Robot.JointId id, NormalizedDouble position)
id - JointId to setposition - new position to setpublic void clearPositions()
public MotionFrame getMovements(long time, long interval)
getMovements in interface FrameSource<Robot.RobotPositionMap>time - the time of this movement, often the current timeinterval - time length of the movement in millisecondsprotected void disableAtGoal()
protected boolean isAtGoal()
Copyright © 2011-2014. All Rights Reserved.