SoJointAMotor Class Reference
[libipsa classesJoint Classes]

Defines an angular motor joint with a maximum of 3 axis. More...

#include <SoJointAMotor.h>

Inheritance diagram for SoJointAMotor:

Inheritance graph
[legend]
Collaboration diagram for SoJointAMotor:

Collaboration graph
[legend]

List of all members.

Public Types


Public Member Functions

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

Static Public Member Functions

static void initClass ()

Public Attributes

SoSFFloat Bounce
SoSFFloat Bounce2
SoSFFloat Bounce3
SoSFFloat CFM
SoSFFloat CFM2
SoSFFloat CFM3
SoSFFloat FudgeFactor
SoSFFloat FudgeFactor2
SoSFFloat FudgeFactor3
SoSFFloat HiStop
SoSFFloat HiStop2
SoSFFloat HiStop3
SoSFFloat LoStop
SoSFFloat LoStop2
SoSFFloat LoStop3
SoSFFloat MaxForce
SoSFFloat MaxForce2
SoSFFloat MaxForce3
SoMFVec3f soAngle
SoMFVec3f soAxis
SoSFInt32 soMotorMode
SoSFInt32 soNumberAxes
SoMFInt32 soRelativeOrientation
SoSFVec3f soTorque
SoSFFloat StopCFM
SoSFFloat StopCFM2
SoSFFloat StopCFM3
SoSFFloat StopERP
SoSFFloat StopERP2
SoSFFloat StopERP3
SoSFFloat SuspensionCFM
SoSFFloat SuspensionCFM2
SoSFFloat SuspensionCFM3
SoSFFloat SuspensionERP
SoSFFloat SuspensionERP2
SoSFFloat SuspensionERP3
SoSFFloat Velocity
SoSFFloat Velocity2
SoSFFloat Velocity3

Protected Member Functions

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

Protected Attributes

float initMaxForce [3]
SbVec3f initTorque
float initVelocity [3]

Private Member Functions

 SO_KIT_HEADER (SoJointAMotor)


Detailed Description

Defines an angular motor joint with a maximum of 3 axis.

An angular motor (AMotor) allows the relative angular velocities of two bodies to be controlled.
The angular velocity can be controlled on up to three axes, allowing torque motors and stops to be set for rotation about those axes. This is mainly useful in conjunction with ball joints, but it can be used in any situation where angular control is needed.

amotor.jpg

An angular motor joint

Definition at line 36 of file SoJointAMotor.h.


Member Enumeration Documentation

Enumerator:
eMMUserMode 
eMMEulerMode 

Definition at line 49 of file SoJointAMotor.h.


Constructor & Destructor Documentation

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

The parameterized constructor of SoJointAMotor.

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 302 of file SoJointAMotor.cpp.

References Bounce, Bounce2, Bounce3, CFM, CFM2, CFM3, eMMEulerMode, FudgeFactor, FudgeFactor2, FudgeFactor3, HiStop, HiStop2, HiStop3, SoJoint::INIT_CFM, SoJoint::INIT_ERP, LoStop, LoStop2, LoStop3, MaxForce, MaxForce2, MaxForce3, soAngle, soAxis, soMotorMode, soNumberAxes, soRelativeOrientation, soTorque, StopCFM, StopCFM2, StopCFM3, StopERP, StopERP2, StopERP3, SuspensionCFM, SuspensionCFM2, SuspensionCFM3, SuspensionERP, SuspensionERP2, SuspensionERP3, SoJoint::updateOdeParametersTrigger, Velocity, Velocity2, and Velocity3.


Member Function Documentation

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

This method creates a hinge 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 438 of file SoJointAMotor.cpp.

References initMaxForce, initTorque, initVelocity, MaxForce, MaxForce2, MaxForce3, SoJoint::soJointGroupId, SoJoint::soJointId, soNumberAxes, soTorque, Velocity, Velocity2, and Velocity3.

SoNode * SoJointAMotor::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 497 of file SoJointAMotor.cpp.

void SoJointAMotor::initClass (  )  [static]

Initialises the class and it's type id variables.

Reimplemented from SoJoint.

Definition at line 290 of file SoJointAMotor.cpp.

void SoJointAMotor::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 399 of file SoJointAMotor.cpp.

References Bounce, Bounce2, Bounce3, CFM, CFM2, CFM3, FudgeFactor, FudgeFactor2, FudgeFactor3, HiStop, HiStop2, HiStop3, LoStop, LoStop2, LoStop3, MaxForce, MaxForce2, MaxForce3, SoJoint::soJointId, StopCFM, StopCFM2, StopCFM3, StopERP, StopERP2, StopERP3, Velocity, Velocity2, and Velocity3.

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

This method uses the values of torque1, torque2 and torque3 to set torques on the angular motor joint.

Parameters:
torque1 applied to axis1
torque2 applied to axis2 (if set)
torque3 applied to axis3 (if set)

Reimplemented from SoJoint.

Definition at line 393 of file SoJointAMotor.cpp.

References SoJoint::soJointId.

Referenced by updateOdeJointProperties().

SoJointAMotor::SO_KIT_HEADER ( SoJointAMotor   )  [private]

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

This method updates the anchors of the angular motor joint using the modelMatrix as reference and sets the initial torque.

Parameters:
modelMatrix model matrix taken from Coin

Reimplemented from SoJoint.

Definition at line 460 of file SoJointAMotor.cpp.

References initMaxForce, initTorque, initVelocity, MaxForce, MaxForce2, MaxForce3, setTorque(), soAxis, SoJoint::soJointId, soRelativeOrientation, soTorque, Velocity, Velocity2, and Velocity3.


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 66 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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 78 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

The bouncyness of the stops of axis 3 (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 90 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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

Definition at line 67 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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

Definition at line 79 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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

Definition at line 91 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

(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 65 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

(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 77 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

(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 89 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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 SoJointAMotor::HiStop is less than SoJointAMotor::LowStop then both stops will be ineffective.

Definition at line 62 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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 SoJointAMotor::HiStop is less than SoJointAMotor::LowStop then both stops will be ineffective.

Definition at line 74 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

High stop for the angle of axis 3 (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 SoJointAMotor::HiStop is less than SoJointAMotor::LowStop then both stops will be ineffective.

Definition at line 86 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

float SoJointAMotor::initMaxForce[3] [protected]

Definition at line 103 of file SoJointAMotor.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

SbVec3f SoJointAMotor::initTorque [protected]

Definition at line 104 of file SoJointAMotor.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

float SoJointAMotor::initVelocity[3] [protected]

Definition at line 102 of file SoJointAMotor.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 61 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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 73 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

Low stop for the angle of axis 3 (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 85 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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 64 of file SoJointAMotor.h.

Referenced by createOdeJoint(), setParams(), SoJointAMotor(), 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 76 of file SoJointAMotor.h.

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

The maximum force or torque that the motor of axis 3 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 88 of file SoJointAMotor.h.

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

The angle for each axis of the angular motor joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 57 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

The axis of the angular motor joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 56 of file SoJointAMotor.h.

Referenced by SoJointAMotor(), and updateOdeJointProperties().

The motor mode for the angular motor joint (default = EulerMode).

  • eMMUserMode
  • eMMEulerMode

Definition at line 55 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

The number of axes (0 to 3) for the angular motor joint (default = 3).
Set this to 0 to disable the angular motor.

Definition at line 54 of file SoJointAMotor.h.

Referenced by createOdeJoint(), and SoJointAMotor().

The relative orientation of each of the three axes (default = 0). The first value represents axis 1...
Each axis can have one of three ``relative orientation'' modes, selected by rel:

  • 0: The axis is anchored to the global frame.
  • 1: The axis is anchored to the first body.
  • 2: The axis is anchored to the second body.

Definition at line 59 of file SoJointAMotor.h.

Referenced by SoJointAMotor(), and updateOdeJointProperties().

The torque of the angular motor joint (default = 0.0f).

Definition at line 58 of file SoJointAMotor.h.

Referenced by createOdeJoint(), SoJointAMotor(), and updateOdeJointProperties().

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 69 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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 81 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

The constraint force mixing (CFM) value used by the stops of axis 3 (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 93 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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

Definition at line 68 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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

Definition at line 80 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

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

Definition at line 92 of file SoJointAMotor.h.

Referenced by setParams(), and SoJointAMotor().

Suspension constraint force mixing (CFM) value for axis 1(default = SoJoint::INIT_CFM). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 71 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

Suspension constraint force mixing (CFM) value for axis 2(default = SoJoint::INIT_CFM). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 83 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

Suspension constraint force mixing (CFM) value for axis 3(default = SoJoint::INIT_CFM). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 95 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

Suspension error reduction parameter (ERP) for axis 1 (default = SoJoint::INIT_ERP). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 70 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

Suspension error reduction parameter (ERP) for axis 2 (default = SoJoint::INIT_ERP). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 82 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

Suspension error reduction parameter (ERP) for axis 3 (default = SoJoint::INIT_ERP). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 94 of file SoJointAMotor.h.

Referenced by SoJointAMotor().

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

Definition at line 63 of file SoJointAMotor.h.

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

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

Definition at line 75 of file SoJointAMotor.h.

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

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

Definition at line 87 of file SoJointAMotor.h.

Referenced by createOdeJoint(), setParams(), SoJointAMotor(), 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:20 2012 for IPSA by  doxygen 1.5.8