These pages are auto-generated from self-documenting comments embedded in class files.
For more information on breve and steve, refer to the breve homepage.

## Abstract : Joint

This class is included as part of the file Joint.tz.
To use this class in a simulation, include the line "@use Joint."

### Class description:

> Joint a is class used to connect two Mobile objects together. The Joint class itself is actually never instantiated--instead, one of the following joint subclasses should be used.
> - PrismaticJoint for linear sliding joints between links
> - RevoluteJoint for rotational joints between links
> - FixedJoint for static joints between links
> - BallJoint for ball joints between links
> - UniversalJoint for ball joints between links

> Although the class itself is never instantiated, the class methods described below are often used with the object's subclasses.

> The joints supported in breve can be 1, 2 or 3 degrees of freedom (DOF), meaning that they allow motion in 1, 2 or 3 independent directions.

### Class methods:

> Getting the Objects Connected by a Joint

> - get-child
> - get-parent

> Setting parameters for joint springs and damping (friction)

> - set-cfm
> - set-double-spring
> - set-erp
> - set-joint-damping

> Getting and Setting the Velocity of a Joint

> - get-joint-velocity
> - get-joint-velocity-vector
> - set-joint-velocity

> Manipulating Joint Strength

> - get-force
> - get-max-joint-limit-vector
> - get-min-joint-limit-vector
> - get-strength-hard-limit
> - get-strength-limit
> - get-torque
> - set-joint-limit-vectors
> - set-joint-torque-vector
> - set-strength-limit

> Getting and Setting Joint Position & Orientation

> - get-child-link-point
> - get-joint-normal
> - get-parent-link-point
> - set-child-link-point
> - set-joint-normal
> - set-parent-link-point
> - set-relative-rotation
> - set-relative-rotation-matrix

> Breaking Joints

> - break-joint

> Automatic Joint Scaling

> - disable-automatic-joint-scaling
> - enable-automatic-joint-scaling

`break-joint`

> Breaks this joint--removes the child (and all of the links connected to it) from the body. The child link (and its descendents) are therefore removed from the world and placed in limbo. They may be reconnected later by creating another Joint, or it may be associated with a MultiBody of its own.

> The Joint object is not freed—this has been changed from breve 1.7. By calling this method, you break the joint without releasing it such that it can be used again. If you do not with to use the Joint object again, then simply freeing the Joint object will break the joint and delete the object.

`disable-automatic-joint-scaling`

> Disables automatic joint scaling, if it had previously been enabled using enable-automatic-joint-scaling.

`enable-automatic-joint-scaling`

> Tracks changes to sizes in the link shapes, and automatically "scales" the joint (more accurately, the link points) such that the resized links will maintain the same relative distance from one another. This feature is likely to be desirable whenever "growth" of MultiBody objects is simulated.

> This can be later disabled using disable-automatic-joint-scaling.

`get-child`

> Returns the object identified as the "child" ojbect.

`get-child-link-point`

> Returns the child link point.

`get-force`

> Returns the force applied by this joint to maintain the desired relationships of the connected bodies. In other words, the stress force on the joint.

> The forces applied to connected bodies are generally equal and opposite, so this value is computed as f1 + -f2, where f1 and f2 are the forces acting on the first and second bodies.

`get-joint-normal`

> Returns the joint's normal vector.

`get-joint-velocity`

> Returns the scalar velocity of the joint. This is only useful for 1-DOF joints (prismatic and revolute). For higher-DOF joints, use get-joint-velocity-vector.

`get-joint-velocity-vector`

> Returns the vector velocity of the joint. For 1-DOF joints (prismatic, revolute), only the X-component is valid. For 2-DOF joints (universal), both the X- and the Y-components are used. For a ball joint, all three values are provided.

> Note: due to a limitation of the physical simulation engine, this method is not currently implemented for ball or universal joints.

`get-max-joint-limit-vector`

> Returns the maximum joint limit vector, if it has been set.

`get-min-joint-limit-vector`

> Returns the minimum joint limit vector, if it has been set.

`get-parent`

> Returns the object identified as the "parent" ojbect.

`get-parent-link-point`

> Returns the child link point.

`get-strength-hard-limit`

> Returns the "hard" limit of the joint--the maximum torque that you are allowed to put on a single joint.

`get-strength-limit`

> Returns the user set strength limit of the joint.

`get-torque`

> Returns the torque applied by this joint to maintain the desired relationships of the connected bodies. In other words, the stress torque on the joint.

> The torques applied to connected bodies are generally equal and opposite, so this value is computed as t1 + -t2, where t1 and t2 are the torques acting on the first and second bodies.

`set-cfm to cfmValue (double)`

> Sets the joint's constraint force mixing parameter. See the ODE physics engine documentation for more details.

`set-child-link-point to linkPoint (vector)`

> Dynamically sets the child's link point for this joint. This method can be called over the course of the simulation to change the way the joint works.

> If the Joint is not linked, this call has no effect.

`set-double-spring with-strength theStrength (float) with-max theMax (float) with-min theMin (float)`

> Enable this joint's spring to take effect when the rotation is above theMax or below theMin. When the position of the joint is between theMin and theMax, the spring applies no force to the joint. When the position goes out of this range a force is applied according to the strength of the joint (theStrength) and distance to the "natural" range.

> To revert to the default behavior of no spring acting on the joint, use the method remove-spring.

`set-erp to erpValue (double)`

> Sets the joint's error correction parameter. See the ODE physics engine documentation for more details.

`set-joint-damping to dampingValue (float)`

> Sets the joint damping--the friction of the joint.

`set-joint-limit-vectors min minV (vector) max maxV (vector)`

> A convenience method for setting joint limits for any kind of joint. For 1-DOF joints (prismatic, revolute) only the X values from the vectors are used. For 2-DOF joints (universal), both X and Y values are used. For 3-DOF joints, all the values are used.

> Note that this method is just an alternative to the set-joint-limit methods which exist in all of the joints which support limits.

`set-joint-normal to normal (vector)`

> If this type of joint supports it this method sets the normal vector for the motion for the joint. The precise meaning of the normal vector depends on the exact type of joint. See each joint's link method documentation for more details.

`set-joint-torque-vector to torqueVector (vector)`

> Applies torque on one or more axes. This method can be used when setting the torque of ball or universal joints.

`set-joint-velocity to newVelocity (float)`

> Sets the joint velocity to newVelocity.

`set-parent-link-point to linkPoint (vector)`

> Dynamically sets the parent's link point for this joint. This method can be called over the course of the simulation to change the way the joint works.

> If the Joint is not linked, this call has no effect.

`set-relative-rotation around-axis theAxis (vector) by theAngle (float)`

> To avoid undesirable "jumping" behavior, this method should be called before linking the joint.

> Sets the relative rotation between the child and parent Link to newRotation. This rotation specifies the rotation of the child link when the joint is "relaxed" or at its natural position.

> Changing the relative rotation of the joint fundamentally changes the way the joint works, and should not be used as a "normal" joint motion: the relative rotation may be changed dynamically over the course of the simulation, though it may cause unexpected and unrealistic behavior if the change is not made gradually, or if the bodies involved are in contact with other bodies at the time of the change.

`set-relative-rotation-matrix to newRotation (matrix)`

> To avoid undesirable "jumping" behavior, this method should be called before linking the joint.

> Sets the relative rotation between the child and parent Link to newRotation. This rotation specifies the rotation of the child link when the joint is "relaxed" or at its natural position.

> The method set-relative-rotation is somewhat easier to use, since it does not require the actual rotation matrix.

> Changing the relative rotation of the joint fundamentally changes the way the joint works, and should not be used as a "normal" joint motion: the relative rotation may be changed dynamically over the course of the simulation, though it may cause unexpected and unrealistic behavior if the change is not made gradually, or if the bodies involved are in contact with other bodies at the time of the change.

`set-strength-limit to newLimit (float)`

> Sets the maximum torque to be used by this joint when attempting to attain the target speed.

Documentation created Fri Aug 8 15:16:49 2008