public class CoordinateSetter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CoordinateSetter.SetStatus
Return status for set requests undertaken by the coordinate setter.
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
debug |
| Constructor and Description |
|---|
CoordinateSetter(MechModel mech)
Creates a new CoordinateSetter for setting joint coordinates
within the specified MechModel.
|
CoordinateSetter(MechModel mech,
java.util.Collection<? extends PointSpringBase> springs)
Creates a new CoordinateSetter for setting joint coordinates within the
specified MechModel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearRequests()
Clears any pending coordinate set requests, so that if
setCoordinates(), is called immediately after, no actions will be taken. |
void |
clearSolveCounts()
Clears the cummulative solve and iteration counts.
|
int |
numIterations()
Return the cummulative number of solve iterations for coordinates
associated with kinematic loops.
|
void |
request(JointBase joint,
int idx,
double value)
Requests that a specific coordinate by set to a given value.
|
void |
request(JointCoordinateHandle handle,
double value)
Requests that a specific coordinate by set to a given value.
|
void |
requestDeg(JointBase joint,
int idx,
double value)
Requests that a specific coordinate by set to a given value.
|
void |
requestDeg(JointCoordinateHandle handle,
double value)
Requests that a specific coordinate by set to a given value.
|
CoordinateSetter.SetStatus |
setCoordinate(JointBase joint,
int idx,
double value)
Sets a specific coordinate to a specific value, while attempting to keep
all other coordinate values fixed.
|
CoordinateSetter.SetStatus |
setCoordinate(JointCoordinateHandle handle,
double value)
Sets a specific coordinate to a specific value, while attempting to keep
all other coordinate values fixed.
|
CoordinateSetter.SetStatus |
setCoordinateDeg(JointBase joint,
int idx,
double value)
Sets a specific coordinate to a specific value, while attempting to keep
all other coordinate values fixed.
|
CoordinateSetter.SetStatus |
setCoordinateDeg(JointCoordinateHandle handle,
double value)
Sets a specific coordinate to a specific value, while attempting to keep
all other coordinate values fixed.
|
CoordinateSetter.SetStatus |
setCoordinates()
Attempts to satisfy all coordinate set requests that have been placed by
the
request methods, while keeping all other coordinate values
fixed. |
public CoordinateSetter(MechModel mech)
mech - MechModel in which the coordinates are locatedpublic CoordinateSetter(MechModel mech, java.util.Collection<? extends PointSpringBase> springs)
springs argument specifies
specific spring components that should be updated as coordinates are set.
Otherwise, all springs in the MechModel will be updated.mech - MechModel in which the coordinates are locatedsprings - if non-null, specifies which springs
should be updatedpublic void request(JointBase joint, int idx, double value)
setCoordinates(), which will then attempt to resolve all pending requests
at once.joint - joint containing the coordinateidx - coordinate index with respect to the jointvalue - value to set the coordinate to. Should be given
in radians for rotary coordinates.public void request(JointCoordinateHandle handle, double value)
setCoordinates(), which will then attempt to resolve all pending requests
at once.handle - handle describing the coordinatevalue - value to set the coordinate to. Should be given
in radians for rotary coordinates.public void requestDeg(JointBase joint, int idx, double value)
setCoordinates(), which will then attempt to resolve all pending requests
at once.joint - joint containing the coordinateidx - coordinate index with respect to the jointvalue - value to set the coordinate to. Should be given
in degrees for rotary coordinates.public void requestDeg(JointCoordinateHandle handle, double value)
setCoordinates(), which will then attempt to resolve all pending requests
at once.handle - handle describing the coordinatevalue - value to set the coordinate to. Should be given
in degrees for rotary coordinates.public void clearRequests()
setCoordinates(), is called immediately after, no actions will be taken.public CoordinateSetter.SetStatus setCoordinateDeg(JointCoordinateHandle handle, double value)
handle - handle describing the coordinatevalue - value to set the coordinate to. Should be given
in degrees for rotary coordinates.public CoordinateSetter.SetStatus setCoordinateDeg(JointBase joint, int idx, double value)
joint - joint containing the coordinateidx - coordinate index with respect to the jointvalue - value to set the coordinate to. Should be given
in degrees for rotary coordinates.public int numIterations()
public void clearSolveCounts()
public CoordinateSetter.SetStatus setCoordinate(JointBase joint, int idx, double value)
joint - joint containing the coordinateidx - coordinate index with respect to the jointvalue - value to set the coordinate to. Should be given
in radian for rotary coordinates.public CoordinateSetter.SetStatus setCoordinate(JointCoordinateHandle handle, double value)
handle - handle describing the coordinatevalue - value to set the coordinate to. Should be given
in radian for rotary coordinates.public CoordinateSetter.SetStatus setCoordinates()
request methods, while keeping all other coordinate values
fixed. This will generally not be possible if any of the requested
coordinates are embedded within a kinematic loop. A returned status value
gives information about how the operation fared.