SoJointUniversal Class Reference
[libipsa classesJoint Classes]

Defines an universal joint which has two orthogonally intersecting axis. More...

#include <SoJointUniversal.h>

Inheritance diagram for SoJointUniversal:

Inheritance graph
[legend]
Collaboration diagram for SoJointUniversal:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void setParams ()
virtual void setTorque (dReal torque1=0.0f, dReal torque2=0.0f, dReal torque3=0.0f)
 SoJointUniversal (const SbString &BodyOne="", const SbString &BodyTwo="", const SbString &nodeName="")

Static Public Member Functions

static void initClass ()

Public Attributes

SoSFFloat Bounce
SoSFFloat Bounce2
SoSFFloat CFM
SoSFFloat CFM2
SoSFFloat FudgeFactor
SoSFFloat FudgeFactor2
SoSFFloat HiStop
SoSFFloat HiStop2
SoSFFloat LoStop
SoSFFloat LoStop2
SoSFFloat MaxForce
SoSFFloat MaxForce2
SoSFVec3f soAnchor
SoSFVec3f soAxis1
SoSFVec3f soAxis2
SoSFVec2f soTorque
SoSFFloat StopCFM
SoSFFloat StopCFM2
SoSFFloat StopERP
SoSFFloat StopERP2
SoSFFloat Velocity
SoSFFloat Velocity2

Protected Member Functions

virtual void createOdeJoint (const dWorldID soWorldId)
virtual SoNode * createVisualisation ()
virtual void updateOdeJointProperties (const SbMatrix &modelMatrix)

Protected Attributes

float initMaxForce [2]
float initVelocity [2]

Private Member Functions

 SO_KIT_HEADER (SoJointUniversal)


Detailed Description

Defines an universal joint which has two orthogonally intersecting axis.

A universal joint is like a ball and socket joint that constrains an extra degree of rotational freedom.
Given axis 1 on body 1, and axis 2 on body 2 that is perpendicular to axis 1,
it keeps them perpendicular. In other words, rotation of the two bodies about the direction perpendicular to the two axes will be equal.

In the picture, the two bodies are joined together by a cross.
Axis 1 is attached to body 1, and axis 2 is attached to body 2. The cross keeps these axes at 90 degrees,
so if you grab body 1 and twist it, body 2 will twist as well.

A Universal joint is equivalent to a hinge-2 joint where the hinge-2's axes are perpendicular to each other,
and with a perfectly rigid connection in place of the suspension.

universal.jpg

An universal joint

Definition at line 34 of file SoJointUniversal.h.


Constructor & Destructor Documentation

SoJointUniversal::SoJointUniversal ( const SbString &  BodyOne = "",
const SbString &  BodyTwo = "",
const SbString &  nodeName = "" 
)

The parameterized constructor of SoJointUniversal.

Parameters:
BodyOne name of the first body to connect with (default = "")
BodyTwo name of the second body to connect with (default = "")
nodeName name of the node in the Inventor scenegraph

Definition at line 204 of file SoJointUniversal.cpp.

References Bounce, Bounce2, CFM, CFM2, FudgeFactor, FudgeFactor2, HiStop, HiStop2, SoJoint::INIT_CFM, SoJoint::INIT_ERP, LoStop, LoStop2, MaxForce, MaxForce2, soAnchor, soAxis1, soAxis2, soTorque, StopCFM, StopCFM2, StopERP, StopERP2, SoJoint::updateOdeParametersTrigger, Velocity, and Velocity2.


Member Function Documentation

void SoJointUniversal::createOdeJoint ( const dWorldID  soWorldId  )  [protected, virtual]

This method creates a universal joint using the soWorldId and stores initial values.

Parameters:
soWorldId the ODE world ID used for creating the joint

Reimplemented from SoJoint.

Definition at line 278 of file SoJointUniversal.cpp.

References initMaxForce, initVelocity, MaxForce, MaxForce2, SoJoint::soJointGroupId, SoJoint::soJointId, Velocity, and Velocity2.

SoNode * SoJointUniversal::createVisualisation (  )  [protected, virtual]

This method must be overridden by any subclass of SoJoint to return a visualisation matching the joint type.

Reimplemented from SoJoint.

Definition at line 321 of file SoJointUniversal.cpp.

References SoJoint::GenerateCylinderAlignmentRotation(), soAnchor, soAxis1, and soAxis2.

void SoJointUniversal::initClass (  )  [static]

Initialises the class and it's type id variables.

Reimplemented from SoJoint.

Definition at line 192 of file SoJointUniversal.cpp.

void SoJointUniversal::setParams (  )  [virtual]

This method must be overridden by any subclass of SoJoint to set the ODE parameters of the object.

Reimplemented from SoJoint.

Definition at line 366 of file SoJointUniversal.cpp.

References Bounce, Bounce2, CFM, CFM2, FudgeFactor, FudgeFactor2, HiStop, HiStop2, LoStop, LoStop2, MaxForce, MaxForce2, SoJoint::soJointId, StopCFM, StopCFM2, StopERP, StopERP2, Velocity, and Velocity2.

void SoJointUniversal::setTorque ( dReal  torque1 = 0.0f,
dReal  torque2 = 0.0f,
dReal  torque3 = 0.0f 
) [virtual]

This method uses torque1 and torque2 to set torques on the universal joint.

Parameters:
torque1 applied to axis1
torque2 applied to axis2
torque3 UNUSED

Reimplemented from SoJoint.

Definition at line 267 of file SoJointUniversal.cpp.

References SoJoint::soJointId.

SoJointUniversal::SO_KIT_HEADER ( SoJointUniversal   )  [private]

void SoJointUniversal::updateOdeJointProperties ( const SbMatrix &  modelMatrix  )  [protected, virtual]

This method updates the anchor and the axis of the universal joint using the modelMatrix as reference.

Parameters:
modelMatrix model matrix taken from Coin

Reimplemented from SoJoint.

Definition at line 296 of file SoJointUniversal.cpp.

References initMaxForce, initVelocity, MaxForce, MaxForce2, soAnchor, soAxis1, soAxis2, SoJoint::soJointId, Velocity, and Velocity2.


Member Data Documentation

The bouncyness of the stops of axis 1 (default = 0.0). This is a restitution parameter in the range 0..1. 0 means the stops are not bouncy at all, 1 means maximum bouncyness.

Definition at line 57 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The bouncyness of the stops of axis 2 (default = 0.0). This is a restitution parameter in the range 0..1. 0 means the stops are not bouncy at all, 1 means maximum bouncyness.

Definition at line 67 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The constraint force mixing (CFM) value used for axis 1 when not at a stop (default = SoJoint::INIT_CFM).

Definition at line 58 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The constraint force mixing (CFM) value used for axis 2 when not at a stop (default = SoJoint::INIT_CFM).

Definition at line 68 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

(default = 1.0)
The current (ODE) joint stop/motor implementation has a small problem: when the joint is at one stop and the motor is set to move it away from the stop, too much force may be applied for one time step, causing a ``jumping'' motion. This fudge factor is used to scale this excess force. It should have a value between zero and one (the default value). If the jumping motion is too visible in a joint, the value can be reduced. Making this value too small can prevent the motor from being able to move the joint away from a stop.

Definition at line 56 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

(default = 1.0)
The current (ODE) joint stop/motor implementation has a small problem: when the joint is at one stop and the motor is set to move it away from the stop, too much force may be applied for one time step, causing a ``jumping'' motion. This fudge factor is used to scale this excess force. It should have a value between zero and one (the default value). If the jumping motion is too visible in a joint, the value can be reduced. Making this value too small can prevent the motor from being able to move the joint away from a stop.

Definition at line 66 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

High stop for the angle of axis 1 (default = dInfinity). Setting this to dInfinity turns off the high stop. For rotational joints, this stop must be less than pi to be effective.

Warning:
If SoJointUniversal::HiStop is less than SoJointUniversal::LowStop then both stops will be ineffective.

Definition at line 53 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

High stop for the angle of axis 2 (default = dInfinity). Setting this to dInfinity turns off the high stop. For rotational joints, this stop must be less than pi to be effective.

Warning:
If SoJointUniversal::HiStop is less than SoJointUniversal::LowStop then both stops will be ineffective.

Definition at line 63 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

float SoJointUniversal::initMaxForce[2] [protected]

Definition at line 78 of file SoJointUniversal.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

float SoJointUniversal::initVelocity[2] [protected]

Definition at line 77 of file SoJointUniversal.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

Low stop for the angle of axis 1 (default = -dInfinity). Setting this to -dInfinity turns off the low stop. For rotational joints, this stop must be greater than - pi to be effective.

Definition at line 52 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

Low stop for the angle of axis 2 (default = -dInfinity). Setting this to -dInfinity turns off the low stop. For rotational joints, this stop must be greater than - pi to be effective.

Definition at line 62 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The maximum force or torque that the motor of axis 1 will use to achieve the desired velocity (default = 0.0). This must always be greater than or equal to zero. Setting this to zero turns off the motor.

Definition at line 55 of file SoJointUniversal.h.

Referenced by createOdeJoint(), setParams(), SoJointUniversal(), and updateOdeJointProperties().

The maximum force or torque that the motor of axis 2 will use to achieve the desired velocity (default = 0.0). This must always be greater than or equal to zero. Setting this to zero turns off the motor.

Definition at line 65 of file SoJointUniversal.h.

Referenced by createOdeJoint(), setParams(), SoJointUniversal(), and updateOdeJointProperties().

The anchor for the universal joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 47 of file SoJointUniversal.h.

Referenced by createVisualisation(), SoJointUniversal(), and updateOdeJointProperties().

The first axis for the universal joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 48 of file SoJointUniversal.h.

Referenced by createVisualisation(), SoJointUniversal(), and updateOdeJointProperties().

The second axis for the universal joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 49 of file SoJointUniversal.h.

Referenced by createVisualisation(), SoJointUniversal(), and updateOdeJointProperties().

The torque for the universal joint (default = {0.0f, 0.0f}).

Definition at line 50 of file SoJointUniversal.h.

Referenced by SoJointUniversal().

The constraint force mixing (CFM) value used by the stops of axis 1 (default = SoJoint::INIT_CFM). Together with the ERP value this can be used to get spongy or soft stops.

Warning:
Note that this is intended for unpowered joints, it does not really work as expected when a powered joint reaches its limit.

Definition at line 60 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The constraint force mixing (CFM) value used by the stops of axis 2 (default = SoJoint::INIT_CFM). Together with the ERP value this can be used to get spongy or soft stops.

Warning:
Note that this is intended for unpowered joints, it does not really work as expected when a powered joint reaches its limit.

Definition at line 70 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The error reduction parameter (ERP) used by the stops of axis 1 (default = SoJoint::INIT_ERP).

Definition at line 59 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

The error reduction parameter (ERP) used by the stops of axis 2 (default = SoJoint::INIT_ERP).

Definition at line 69 of file SoJointUniversal.h.

Referenced by setParams(), and SoJointUniversal().

Desired angular or linear velocity of the motor of axis 1 (default = 0.0).

Definition at line 54 of file SoJointUniversal.h.

Referenced by createOdeJoint(), setParams(), SoJointUniversal(), and updateOdeJointProperties().

Desired angular or linear velocity of the motor of axis 2 (default = 0.0).

Definition at line 64 of file SoJointUniversal.h.

Referenced by createOdeJoint(), setParams(), SoJointUniversal(), and updateOdeJointProperties().


The documentation for this class was generated from the following files:

Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:21 2012 for IPSA by  doxygen 1.5.8