OMK::Iii::Joint Class Reference
[Joints]

Ancestor of every joint, it is a lock joint. More...

#include <OMKJoint.h>

Inheritance diagram for OMK::Iii::Joint:

Inheritance graph
[legend]
Collaboration diagram for OMK::Iii::Joint:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

Interface
virtual void establishLink ()
 Initialises the link reference positions.
virtual void currentJointPosition ()
 Calculates the current position of the joint.
virtual bool retroPropagation ()
 Calculates the ideal position of the reference point.
virtual void currentObjectPosition ()
 Calculates the current position of the object.

Protected Attributes

OMK::Type::Transform _jointOffset
 The offset of the joint regarding the reference.
OMK::Type::Transform _jointOffsetInverse
 The inverse of _jointOffset.
OMK::Type::Transform _objectOffset
 The offset of the position regarding the joint.
OMK::Type::Transform _objectOffsetInverse
 The inverse of _objectOffset.
JointExtension_owner
 The joint extension which the joint is associated to.
IAttributeBaseT< OMK::Type::Transform > * _objectPosition
 The position of the object.
IAttributeBaseT< OMK::Type::Transform > * _referencePosition
 The reference position.
IAttributeBaseT< OMK::Type::Transform > * _jointPosition
 The joint position.

Private Member Functions

 DECLARE_JOINT_FACTORY (Joint)

Friends

class JointExtension

Detailed Description

Ancestor of every joint, it is a lock joint.

Date:
2007-06-20
Author:
Beno� Chanclou
This joint is the ancestor of all the kinematic joints which can be associated to the JointExtension. Every joint must be registered in the joint factory. The macros DECLARE_JOINT_FACTORY and REGISTER_JOINT_FACTORY should be used to create respectively the declaration and the registration. Each joint has its own name to be created by the factory at the extension initialisation.

Parameters are :

The following configuration can be used to lock an object on an other one.
object
{
  Class SimplePoint
  Scheduling
  {
    Frequency 60
  }
  Extensions
  {
    joint
    {
      Class Joint
      Retro enable
      Joint Lock // The name of the joint
      Attribute Position // The name of the attribute (by default "Position")
      Level 0
    }
  }
  UserParams
  {
    refPositionConnect [reference Position] // The reference position
    jointPosition[[-30 20 -400]] // The initial joint position
    Position [[30 0 -400]] // The initial object position
  }
}
Most of the joints have some parameters, see each ones to have their configuration

Definition at line 192 of file OMKJoint.h.


Member Function Documentation

OMK::Iii::Joint::DECLARE_JOINT_FACTORY ( Joint   )  [private]

void OMK::Iii::Joint::establishLink (  )  [protected, virtual]

Initialises the link reference positions.

This method is called by the extension when the link is established. The current positions will be the reference positions.

Reimplemented in OMK::Iii::BallJoint, OMK::Iii::HingeSlideJoint, and OMK::Iii::ScrewJoint.

Definition at line 61 of file OMKJoint.cpp.

References _jointOffset, _jointOffsetInverse, _jointPosition, _objectOffset, _objectOffsetInverse, _objectPosition, _referencePosition, OMK::IAccessorT< T >::get(), OMK::Type::Transform::inverse(), OMK::Type::product(), and OMK::Type::Transform::updateFlags().

Referenced by OMK::Iii::HingeSlideJoint::establishLink(), OMK::Iii::BallJoint::establishLink(), and OMK::Iii::JointExtension::postComputeParameters().

00062 {
00063   // Must calculate the new offset between the reference position and the joint position
00064   // It is the current offset
00065   _jointOffset = product( _referencePosition->get().inverse(), _jointPosition->get() ) ;
00066   _jointOffset.updateFlags() ;
00067   
00068   // Must calculate the new offset between the joint position and the object position
00069   // It is the current offset
00070   _objectOffset = product( _jointPosition->get().inverse(), _objectPosition->get() ) ;
00071   _objectOffset.updateFlags() ;
00072   
00073   // Calculates the inverse transforms for optimisation
00074   _jointOffsetInverse = _jointOffset.inverse() ;
00075   _jointOffsetInverse.updateFlags() ;
00076   
00077   _objectOffsetInverse = _objectOffset.inverse() ;
00078   _objectOffsetInverse.updateFlags() ;
00079 }

void OMK::Iii::Joint::currentJointPosition (  )  [protected, virtual]

Calculates the current position of the joint.

The position is calculated according to the reference position object and the offset of the joint.

Definition at line 82 of file OMKJoint.cpp.

References _jointOffset, _jointPosition, _referencePosition, OMK::IAccessorT< T >::get(), OMK::Type::product(), and OMK::IAccessorT< T >::set().

Referenced by OMK::Iii::JointExtension::postComputeParameters().

00083 {
00084   // calculates the new joint position
00085   _jointPosition->set( product( _referencePosition->get(), _jointOffset ) ) ;
00086 }

bool OMK::Iii::Joint::retroPropagation (  )  [protected, virtual]

Calculates the ideal position of the reference point.

Returns:
true if the reference position should moves.
Must be overwritten to introduce freedom in the joint. This method updates the object position and the "

Reimplemented in OMK::Iii::BallJoint, and OMK::Iii::HingeSlideJoint.

Definition at line 88 of file OMKJoint.cpp.

References _jointOffsetInverse, _objectOffsetInverse, _objectPosition, _referencePosition, OMK::IAccessorT< T >::get(), OMK::Type::product(), and OMK::IAccessorT< T >::set().

Referenced by OMK::Iii::JointExtension::postComputeParameters().

00089 {
00090   // Calculates the optimal position of the reference position to retro-propagates
00091   _referencePosition->set( product( product( _objectPosition->get(), _objectOffsetInverse ), _jointOffsetInverse ) ) ;
00092   return true ;
00093 }

void OMK::Iii::Joint::currentObjectPosition (  )  [protected, virtual]

Calculates the current position of the object.

The position is calculated according to the joint position object and the offset of the object.

Reimplemented in OMK::Iii::BallJoint, and OMK::Iii::HingeSlideJoint.

Definition at line 95 of file OMKJoint.cpp.

References _jointPosition, _objectOffset, _objectPosition, OMK::IAccessorT< T >::get(), OMK::Type::product(), and OMK::IAccessorT< T >::set().

Referenced by OMK::Iii::JointExtension::postComputeParameters().

00096 {
00097   // calculates the new object position
00098   _objectPosition->set( product( _jointPosition->get(), _objectOffset ) ) ;
00099 }


Friends And Related Function Documentation

friend class JointExtension [friend]

Definition at line 194 of file OMKJoint.h.


Member Data Documentation

OMK::Type::Transform OMK::Iii::Joint::_jointOffset [protected]

The offset of the joint regarding the reference.

This offset is used to calculate the new joint position compared to the reference position, see currentJointPosition.

Definition at line 222 of file OMKJoint.h.

Referenced by currentJointPosition(), and establishLink().

OMK::Type::Transform OMK::Iii::Joint::_jointOffsetInverse [protected]

The inverse of _jointOffset.

Definition at line 224 of file OMKJoint.h.

Referenced by establishLink(), OMK::Iii::HingeSlideJoint::retroPropagation(), OMK::Iii::BallJoint::retroPropagation(), and retroPropagation().

OMK::Type::Transform OMK::Iii::Joint::_objectOffset [protected]

The offset of the position regarding the joint.

This offset is used to calculate the new object position compared to the joint position, see currentObjectPosition.

Definition at line 228 of file OMKJoint.h.

Referenced by OMK::Iii::HingeSlideJoint::currentObjectPosition(), OMK::Iii::BallJoint::currentObjectPosition(), currentObjectPosition(), OMK::Iii::HingeSlideJoint::establishLink(), OMK::Iii::BallJoint::establishLink(), establishLink(), OMK::Iii::HingeSlideJoint::retroPropagation(), and OMK::Iii::BallJoint::retroPropagation().

OMK::Type::Transform OMK::Iii::Joint::_objectOffsetInverse [protected]

The inverse of _objectOffset.

Definition at line 230 of file OMKJoint.h.

Referenced by establishLink(), OMK::Iii::HingeSlideJoint::retroPropagation(), OMK::Iii::BallJoint::retroPropagation(), and retroPropagation().

JointExtension* OMK::Iii::Joint::_owner [protected]

The joint extension which the joint is associated to.

Definition at line 232 of file OMKJoint.h.

IAttributeBaseT< OMK::Type::Transform >* OMK::Iii::Joint::_objectPosition [protected]

The position of the object.

The reference to the attribute which define the position of the object.

The name can be defined by the configuration parameter named Attribute, if not defined the default is Position.

Definition at line 238 of file OMKJoint.h.

Referenced by OMK::Iii::HingeSlideJoint::currentObjectPosition(), OMK::Iii::BallJoint::currentObjectPosition(), currentObjectPosition(), OMK::Iii::HingeSlideJoint::establishLink(), OMK::Iii::BallJoint::establishLink(), establishLink(), OMK::Iii::HingeSlideJoint::retroPropagation(), OMK::Iii::BallJoint::retroPropagation(), and retroPropagation().

IAttributeBaseT< OMK::Type::Transform >* OMK::Iii::Joint::_referencePosition [protected]

The reference position.

This attribute is used to retrieve the position of the reference object.

Definition at line 241 of file OMKJoint.h.

Referenced by currentJointPosition(), establishLink(), OMK::Iii::HingeSlideJoint::retroPropagation(), OMK::Iii::BallJoint::retroPropagation(), and retroPropagation().

IAttributeBaseT< OMK::Type::Transform >* OMK::Iii::Joint::_jointPosition [protected]

The joint position.

This attribute defines the position of the joint. This position follows the reference position and it is calculated by offsetting this one.

Definition at line 246 of file OMKJoint.h.

Referenced by currentJointPosition(), OMK::Iii::HingeSlideJoint::currentObjectPosition(), OMK::Iii::BallJoint::currentObjectPosition(), currentObjectPosition(), OMK::Iii::ScrewJoint::establishLink(), OMK::Iii::HingeSlideJoint::establishLink(), establishLink(), OMK::Iii::HingeSlideJoint::retroPropagation(), and OMK::Iii::BallJoint::retroPropagation().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:04 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007