maspack.spatialmotion
Class RevoluteCoupling

java.lang.Object
  extended by maspack.spatialmotion.RigidBodyCoupling
      extended by maspack.spatialmotion.RevoluteCoupling

public class RevoluteCoupling
extends RigidBodyCoupling

Implements a one DOF revolute coupling. Frames C and D share a common origin and rotate about a common z axis. The distance from the x axis of C to the x axis of D, about the z axis, is described by the angle theta. Range limits can be placed on theta.


Field Summary
 
Fields inherited from class maspack.spatialmotion.RigidBodyCoupling
BILATERAL, LINEAR, ROTARY
 
Constructor Summary
RevoluteCoupling()
           
 
Method Summary
 void getConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info, RigidTransform3d XCD, RigidTransform3d XFD, RigidTransform3d XERR, boolean setEngaged)
          Computes the constraint frame C and the associated constraint information.
 double getMaximumTheta()
          Returns the maximum value of theta for this revolute coupling.
 double getMinimumTheta()
          Returns the minimum value of theta for this revolute coupling.
 double getTheta(RigidTransform3d XCD)
           
 boolean hasRestrictedRange()
          Returns true if this coupling has a range restriction; this will be true if the range of theta is less than [-PI, PI].
 void initializeConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info)
           
 int maxUnilaterals()
          Returns the maximum number of unilateral constraints associated with this coupling.
 int numBilaterals()
          Returns the number of bilateral constraints associated with this coupling.
 void projectToConstraint(RigidTransform3d XCD, RigidTransform3d XFD)
          Computes the frame C on the constraint surface which is closest to a given frame F.
 void setMaximumTheta(double max)
          Sets the maximum value of theta for this revolute coupling.
 void setMinimumTheta(double min)
          Sets the minimum value of theta for this revolute coupling.
 void setTheta(RigidTransform3d XCD, double theta)
           
 
Methods inherited from class maspack.spatialmotion.RigidBodyCoupling
findNearestAngle, getAuxState, getBilateralConstraints, getBilateralForceF, getBilateralImpulses, getBreakAccel, getBreakSpeed, getCompliance, getConstraint, getConstraintInfo, getContactDistance, getDamping, getInitialAuxState, getUnilateralConstraints, getUnilateralForceF, getUnilateralImpulses, maxConstraints, numUnilaterals, scaleDistance, setAuxState, setBilateralImpulses, setBreakAccel, setBreakSpeed, setCompliance, setContactDistance, setDamping, setDistanceAndZeroDerivative, setDistancesAndZeroDerivatives, setUnilateralImpulses, skipAuxState, transformGeometry, updateBodyStates, updateConstraintsFromC, updateUnilateralConstraints, zeroImpulses
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RevoluteCoupling

public RevoluteCoupling()
Method Detail

setMaximumTheta

public void setMaximumTheta(double max)
Sets the maximum value of theta for this revolute coupling. The default value is PI.

Parameters:
max - maximum value for theta

getMaximumTheta

public double getMaximumTheta()
Returns the maximum value of theta for this revolute coupling.

Returns:
maximum value for theta

setMinimumTheta

public void setMinimumTheta(double min)
Sets the minimum value of theta for this revolute coupling. The default value is -PI.

Parameters:
min - minimum value for theta

getMinimumTheta

public double getMinimumTheta()
Returns the minimum value of theta for this revolute coupling.

Returns:
minimum value for theta

hasRestrictedRange

public boolean hasRestrictedRange()
Returns true if this coupling has a range restriction; this will be true if the range of theta is less than [-PI, PI].

Returns:
true if this coupling has a range restriction.

maxUnilaterals

public int maxUnilaterals()
Description copied from class: RigidBodyCoupling
Returns the maximum number of unilateral constraints associated with this coupling.

Specified by:
maxUnilaterals in class RigidBodyCoupling
Returns:
maximum number of unilateral constraints

numBilaterals

public int numBilaterals()
Description copied from class: RigidBodyCoupling
Returns the number of bilateral constraints associated with this coupling.

Specified by:
numBilaterals in class RigidBodyCoupling
Returns:
number of bilateral constraints

projectToConstraint

public void projectToConstraint(RigidTransform3d XCD,
                                RigidTransform3d XFD)
Description copied from class: RigidBodyCoupling
Computes the frame C on the constraint surface which is closest to a given frame F. The input consists of the transform from F to D.

Specified by:
projectToConstraint in class RigidBodyCoupling
Parameters:
XCD - returns the transform from C to D
XFD - transform from frame F to D

getTheta

public double getTheta(RigidTransform3d XCD)

setTheta

public void setTheta(RigidTransform3d XCD,
                     double theta)

initializeConstraintInfo

public void initializeConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info)
Specified by:
initializeConstraintInfo in class RigidBodyCoupling

getConstraintInfo

public void getConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info,
                              RigidTransform3d XCD,
                              RigidTransform3d XFD,
                              RigidTransform3d XERR,
                              boolean setEngaged)
Description copied from class: RigidBodyCoupling
Computes the constraint frame C and the associated constraint information. C is determined by projecting F onto the constraint surface.

Information for each constraint wrench is returned through an array of ConstraintInfo objects supplied by the argument info. This array should have a fixed number of elements equal to the number of bilateral constraints plus the maximum number of unilateral constraints. Bilateral constraints appear first, followed by the unilateral constraints. Constraint wrenches and their derivatives (with respect to frame C) are set within the fields wrenchC and dotWrenchC, repsectively. Distances to set within the distance; each of these should be the dot product of the wrench with the linearization of the constraint error XFC. For computing wrench derivatives, this method may use myVelBA, which gives the current velocity of B with repsect to A, in coordinate frame D. Information only needs to be returned for constraints which are potentially active, or engaged. Constraints which are engaged have their ConstraintInfo.engaged field set to a non-zero value. Bilateral constraints are always engaged, and their ConstraintInfo.engaged field is automatically set to 1 by the system. For unilateral constraints, the determination of whether or not the constraint is engaged, and the setting of the engaged field, should be done by this method if the argument setEngaged is true. Otherwise, if setEngaged is false, the method should take the engaged settings as given. Constraints which are engaged are those which are returned by the calls getBilateralConstraints or getUnilateralConstraints.

Specified by:
getConstraintInfo in class RigidBodyCoupling
Parameters:
info - used to return information for each possible constraint wrenches
XCD - returns the transform from C to D
XFD - transform from operation frame F to D
XERR - TODO
setEngaged - if true, this method should determine if the constraint is engaged.