Home

KT_joint Class Reference
[Basic operations]

Provides the data required to define a joint between two links. More...

#include <kt_joint.hxx>

Inheritance diagram for KT_joint:

Inheritance graph
[legend]
Collaboration diagram for KT_joint:

Collaboration graph
[legend]

List of all members.

Public Types

enum  KT_rotate_e {
  ROTATE_SPHERICAL = 0,
  ROTATE_REVOLUTE,
  ROTATE_NONE
}
 Enumerator for the rotation types. More...
enum  KT_translate_e {
  TRANSLATE_NONE = 0,
  TRANSLATE_I,
  TRANSLATE_J,
  TRANSLATE_K,
  TRANSLATE_ANY
}
 Enumerator for the translation types. More...

Public Member Functions

double get_angle () const
 For a revolute joint returns the angle between the constrained EDGEs.
double get_distance () const
const KT_geometry_locatorget_locator_1 () const
const KT_geometry_locatorget_locator_2 () const
KT_manipulatorget_manipulator ()
const wchar_t * get_name () const
KT_joint::KT_rotate_e get_rotate_type () const
const SPAintervalget_translate_interval () const
KT_joint::KT_translate_e get_translate_type () const
virtual char * get_type () const
virtual logical initialize ()
 Initialize the joint.
 KT_joint (const wchar_t *p_name, KT_manipulator *p_manipulator, KT_geometry_locator *p_locator_1, KT_geometry_locator *p_locator_2, const KT_rotate_e rotate_type, const SPAinterval rotate_interval, const KT_translate_e translate_type, const SPAinterval translate_interval)
 Initializes the member variables from the input data.
virtual logical log_step (const int timestep, KT_scene_log_text *p_log)
 Adds the joint information to the log for a step.
virtual logical make_cosmetics ()
 Make any cosmetic data.
virtual void reset ()
 Set joint angles and distances back to their initial positions.
virtual void update ()
 Update the joint information from the modified link positions.

Protected Attributes

double m_angle
 Angle between the "i" directions of the two locators.
double m_distance
 Distance between "common" vertices of the two locators.
KT_geometry_locatorm_locator_1
 First locator referenced in the joint.
KT_geometry_locatorm_locator_2
 Second locator referenced in the joint.
KT_manipulatorm_manipulator
 Owning manipulator.
SPAinterval m_rotate_interval
 Range of rotational motion allowed at the joint.
KT_rotate_e m_rotate_type
 Type of rotational motion allowed at the joint.
SPAinterval m_translate_interval
 Range of translational motion allowed at the joint.
KT_translate_e m_translate_type
 Type of translational motion allowed at the joint.


Detailed Description

Provides the data required to define a joint between two links.

This object describes a joint between two links in terms of the movement that is allowed between the links.

It acts as a base class for the addition of solving functionality. It is left up to applications to use the joint description as input to a solver.

Additionaly this base class provides a log of the joint angles or distances each step of a simulation. To customise the logging sub-class the object and override the log_step method.

Two sorts of joint movement are allowed, rotational and translational, the values of the member variales m_rotate_type and m_translate_type are used to control what sort of constraints which are created for in constraint manager workspace.


Member Enumeration Documentation

Enumerator for the rotation types.

Enumerator:
ROTATE_SPHERICAL  Allow all rotations. No constrains are created the joint may rotate freely.
ROTATE_REVOLUTE  Align the two i directions.

The two "i" direction EDGEs of the locators are constrained to be parallel, so only rotation about that axis is allowed.

ROTATE_NONE  Align all directions.

The "i" and "j" direction EDGEs of the locators are constrained to be parallel, which prevents any rotation at the joint.

Enumerator for the translation types.

Enumerator:
TRANSLATE_NONE  Fixed in space, the common VERTEX of each locator is constrained to be coincident.
TRANSLATE_I  Allow translation along i direction. The VERTEX of the second locator is constrained to lie on the "i".
TRANSLATE_J  Allow translation along j direction. The VERTEX of the second locator is constrained to lie on the "j" EDGE of the first locator.
TRANSLATE_K  Allow translation along k direction. The VERTEX of the second locator is constrained to lie on the "k" EDGE of the first locator.
TRANSLATE_ANY  Allow translation in any direction.


Constructor & Destructor Documentation

KT_joint::KT_joint ( const wchar_t *  p_name,
KT_manipulator p_manipulator,
KT_geometry_locator p_locator_1,
KT_geometry_locator p_locator_2,
const KT_rotate_e  rotate_type,
const SPAinterval  rotate_interval,
const KT_translate_e  translate_type,
const SPAinterval  translate_interval 
)

Initializes the member variables from the input data.

Role:
Creates the object and variables but does not make any geometry until KT_joint::initialize is called.
Note:
There is no order dependency for the locators in the joint in terms of one being the driver or the other driven, however the constraints added to them may be different depending on the type movements allowed at the joint.
Parameters:
name Name of the element in the scene.
p_locator_1 First locator that is constrained by the joint.
p_locator_2 Second locator that is constrained by the joint.
rotate_type The type of rotation that is allowed at the joint
rotate_interval The range of the rotation that is allowed.
rotate_type The type of translation that is allowed at the joint
translate_interval The range of the translation that is allowed.


Member Function Documentation

double KT_joint::get_angle (  )  const

For a revolute joint returns the angle between the constrained EDGEs.

double KT_joint::get_distance (  )  const

Returns:
the distance between the common VERTEX at the joint.

const KT_geometry_locator* KT_joint::get_locator_1 (  )  const [inline]

Returns:
the first locator referenced in the joint.

const KT_geometry_locator* KT_joint::get_locator_2 (  )  const [inline]

Returns:
the second locator referenced in the joint.

KT_manipulator* KT_joint::get_manipulator (  )  [inline]

Returns:
Pointer to the owning manipulator for this joint

const wchar_t* KT_list_entry::get_name (  )  const [inline, inherited]

Returns:
entry's name

KT_joint::KT_rotate_e KT_joint::get_rotate_type (  )  const [inline]

Returns:
the rotation allowed for the joint.

const SPAinterval& KT_joint::get_translate_interval (  )  const [inline]

Returns:
the range of translation for the joint.

KT_joint::KT_translate_e KT_joint::get_translate_type (  )  const [inline]

Returns:
the translation allowed for the joint.

virtual char* KT_joint::get_type (  )  const [inline, virtual]

Returns:
the name of the object (for parsing).

Implements KT_list_entry.

Reimplemented in KT_GGCM_joint.

virtual logical KT_joint::initialize (  )  [virtual]

Initialize the joint.

Role:
This method does nothing in the base class but is provided so that sub-classes can add constraints to the joint.

virtual logical KT_joint::log_step ( const int  timestep,
KT_scene_log_text p_log 
) [virtual]

Adds the joint information to the log for a step.

Parameters:
timestep The current timestep in the simulation.
p_log Text item to log text into.

virtual logical KT_joint::make_cosmetics (  )  [virtual]

Make any cosmetic data.

virtual void KT_joint::reset (  )  [virtual]

Set joint angles and distances back to their initial positions.

virtual void KT_joint::update (  )  [virtual]

Update the joint information from the modified link positions.

Note:
Should be called after the scene has been solved to update the joint angles and distances before logging occurs.


Member Data Documentation

double KT_joint::m_angle [protected]

Angle between the "i" directions of the two locators.

double KT_joint::m_distance [protected]

Distance between "common" vertices of the two locators.

First locator referenced in the joint.

Second locator referenced in the joint.

Owning manipulator.

Range of rotational motion allowed at the joint.

Type of rotational motion allowed at the joint.

Range of translational motion allowed at the joint.

Type of translational motion allowed at the joint.