Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LinkComponent Class Reference

these let you build the link from a series of model and material settings instead of one static model/material for the whole link More...

#include <KinematicJoint.h>

Inheritance diagram for LinkComponent:

Detailed Description

these let you build the link from a series of model and material settings instead of one static model/material for the whole link

note recursive structure... in this case, each is relative to its recursive parent instead of preceeding item in the array (as is done for KinematicJoint's serialization)

Definition at line 22 of file KinematicJoint.h.

List of all members.

Public Member Functions

 LinkComponent ()
 constructor
 LinkComponent (const LinkComponent &c)
 explicit copy constructor needed to set bbLowListener and bbHighListener (which aren't copied)
LinkComponentoperator= (const LinkComponent &link)
 assignment, except for parent
virtual ~LinkComponent ()
PlannerObstacle2DgetObstacle (const fmat::Transform &worldT) const
 Returns a 2D planner obstacle of this component's collision object, or NULL if no collision model is specified.
void getObstacles (const fmat::Transform &worldT, HierarchicalObstacle &obs, bool recurse) const
 Inserts 2D projections of this link's collision components into obs, if recurse is set, recurses on branches.
virtual BoundingBox3D getOwnAABB () const
 Returns the axis-aligned bounding box (relative to link frame) of this component only (i.e. for KinematicJoint, ignores subcomponents).
const BoundingBox3DgetAABB () const
 Returns the axis-aligned bounding box (relative to link frame) of this component and any subcomponents.
bool getOwnBB2D (const fmat::Transform &worldT, RectangularObstacle &ro) const
 Computes the tightest-fitting 2D rectangle for this link (writing the result into ro).
bool getOwnBB3D (const fmat::Transform &worldT, BoxObstacle &bo) const
 Computes a 3D box for this link (writing the result into bo).
bool getBB2D (const fmat::Transform &worldT, RectangularObstacle &ro) const
 Computes a 2D rectangle for this link and its subcomponents (writing the result into ro).
bool getBB3D (const fmat::Transform &worldT, BoxObstacle &bo) const
 Computes a 3D box for this link and its subcomponents (writing the result into bo).
fmat::Column< 4 > getMassVector () const
 return the center of mass of this component, ONLY, as a homogenous scaled vector
virtual void sumLinkCenterOfMass (fmat::Column< 3 > &cOfM, float &totalMass) const
 returns the center of mass of this link only, not including any branches; if this is actually a KinematicJoint, will include subcomponents
virtual fmat::Column< 4 > sumLinkCenterOfMass () const
 returns the unnormalized center of mass of this link only, not including any branches; if this is actually a KinematicJoint, will include subcomponents
virtual bool hasMass () const
 returns true if mass is greater than zero, of if this is a KinematicJoint, if any of the components have mass greater than zero
void getModelTransform (fmat::Transform &tr) const
 converts the model rotation and offset members into the supplied fmat::Transform
fmat::Transform getModelTransform () const
 returns the model rotation and offset members as a fmat::Transform
void getCollisionModelTransform (fmat::Transform &tr) const
 converts the collision model rotation and offset members into the supplied fmat::Transform
fmat::Transform getCollisionModelTransform () const
 returns the model rotation and offset members as a fmat::Transform
KinematicJointgetParent () const
 returns parent joint, or NULL if this is the first joint, see addBranch()/removeBranch()
KinematicJointgetNextMobileAncestor () const
 returns the next mobile ancestor joint in the kinematic chain
virtual LinkComponentclone () const __attribute__((warn_unused_result))
 clone implementation for Dictionary

Public Attributes

plist::Primitive< floatmass
 the mass of the component in kilograms
plist::Point centerOfMass
 the center of mass of this component
plist::Primitive< bool > visible
 if false, will only be shown in the Mirage host's flying camera
plist::Primitive< std::string > material
 mesh files specify "default" textures, but this can override with a different material
plist::Primitive< std::string > model
 name of an OGRE mesh file; if set to "CollisionModel" will display collisionModel (and apply values from collisionModelScale, collisionModelRotation, and collisionModelOffset)
plist::Point modelScale
 scaling factor to apply to model
plist::Point modelRotation
 rotation to apply to model (specifies axis component of quaternion, e.g. from axis/angle: axis * sin(angle/2) )
plist::Point modelOffset
 a translation to apply to model
plist::Primitive< std::string > collisionModel
 name of an OGRE mesh file, or one of a set of primitives (Cube, Cylinder, Sphere)
plist::Point collisionModelScale
 scaling factor to apply to collisionModel
plist::Point collisionModelRotation
 rotation to apply to collisionModel (specifies axis component of quaternion, e.g. from axis/angle: axis * sin(angle/2) )
plist::Point collisionModelOffset
 a translation to apply to collisionModel

Protected Member Functions

virtual void dirtyBB ()
 sets bbDirty to true to cause it to be recomputed on next getAABB() call
virtual void updateBB () const
 recomputes boundingBoxLow and boundingBoxHigh based on collision model parameters
void computeOwnAABB (BoundingBox3D &bb) const
void init ()

Static Protected Member Functions

static void computeBB2D (const fmat::Transform &fullT, RectangularObstacle &ro, const fmat::Column< 3 > &obD)

Protected Attributes

KinematicJointparent
 if non-NULL, the parent joint to which this one is attached
bool bbDirty
 indicates bounding boxes need to be recomputed
BoundingBox3D boundingBox
 bounding box of this link (including subcomponents, but not child links)
plist::PrimitiveCallbackMember
< LinkComponent
collisionModelListener
 if going from empty string to non-empty string, indicates bounding box values need to be rebuilt
plist::CollectionCallbackMember
< LinkComponent
collisionModelScaleListener
 indicates bounding box values need to be rebuilt
plist::CollectionCallbackMember
< LinkComponent
collisionModelRotationListener
 indicates bounding box values need to be rebuilt
plist::CollectionCallbackMember
< LinkComponent
collisionModelOffsetListener
 indicates bounding box values need to be rebuilt

Friends

class KinematicJoint

Constructor & Destructor Documentation

LinkComponent::LinkComponent (  ) 

constructor

Definition at line 27 of file KinematicJoint.h.

LinkComponent::LinkComponent ( const LinkComponent c  ) 

explicit copy constructor needed to set bbLowListener and bbHighListener (which aren't copied)

Definition at line 42 of file KinematicJoint.h.

virtual LinkComponent::~LinkComponent (  )  [virtual]

Definition at line 78 of file KinematicJoint.h.


Member Function Documentation

LinkComponent * LinkComponent::clone (  )  const [virtual]

clone implementation for Dictionary

implements the clone function for dictionary

Reimplemented from plist::DictionaryOf< PO, Alloc >.

Reimplemented in KinematicJoint.

Definition at line 12 of file KinematicJoint.cc.

void LinkComponent::computeBB2D ( const fmat::Transform fullT,
RectangularObstacle ro,
const fmat::Column< 3 > &  obD 
) [static, protected]

Definition at line 677 of file KinematicJoint.cc.

Referenced by getBB2D(), and getOwnBB2D().

void LinkComponent::computeOwnAABB ( BoundingBox3D bb  )  const [protected]

Definition at line 596 of file KinematicJoint.cc.

Referenced by KinematicJoint::getOwnAABB(), and updateBB().

void LinkComponent::dirtyBB (  )  [protected, virtual]

sets bbDirty to true to cause it to be recomputed on next getAABB() call

Reimplemented in KinematicJoint.

Definition at line 590 of file KinematicJoint.cc.

const BoundingBox3D& LinkComponent::getAABB (  )  const

Returns the axis-aligned bounding box (relative to link frame) of this component and any subcomponents.

Definition at line 108 of file KinematicJoint.h.

Referenced by getBB2D(), getBB3D(), and getOwnAABB().

bool LinkComponent::getBB2D ( const fmat::Transform worldT,
RectangularObstacle ro 
) const

Computes a 2D rectangle for this link and its subcomponents (writing the result into ro).

will be in the world coordinates, projecting the link collision model down the world's Z into its XY plane. The rectangle will be aligned to the link axis (i.e. this is getAABB() projected into the world.)

Definition at line 655 of file KinematicJoint.cc.

Referenced by RRTNode2DR< N >::CollisionChecker::LinkObstacle::setObstacle(), and RRTNode2DR< N >::CollisionChecker::JointObstacle::setObstacle().

bool LinkComponent::getBB3D ( const fmat::Transform worldT,
BoxObstacle bo 
) const

Computes a 3D box for this link and its subcomponents (writing the result into bo).

will be in the world coordinates. The rectangle will be aligned to the link axis (i.e. this is getAABB() projected into the world.)

Definition at line 665 of file KinematicJoint.cc.

Referenced by RRTNode3DR< N >::CollisionChecker::LinkObstacle::setupObstacle(), and RRTNode3DR< N >::CollisionChecker::JointObstacle::setupObstacle().

fmat::Transform LinkComponent::getCollisionModelTransform (  )  const

returns the model rotation and offset members as a fmat::Transform

Definition at line 155 of file KinematicJoint.h.

Referenced by getOwnBB2D(), and getOwnBB3D().

void LinkComponent::getCollisionModelTransform ( fmat::Transform tr  )  const

converts the collision model rotation and offset members into the supplied fmat::Transform

Definition at line 533 of file KinematicJoint.cc.

Referenced by ShapeSpaceCollisionCheckerBase< 3 >::createBodyObstacle().

fmat::Column<4> LinkComponent::getMassVector (  )  const

return the center of mass of this component, ONLY, as a homogenous scaled vector

The last element (homogeneous scale factor) is left as the total mass, so divide by this value to normalize. Otherwise, just access centerOfMass directly.

Definition at line 131 of file KinematicJoint.h.

Referenced by XWalkMC::sendLoadPredictions(), sumLinkCenterOfMass(), and KinematicJoint::sumLinkCenterOfMass().

fmat::Transform LinkComponent::getModelTransform (  )  const

returns the model rotation and offset members as a fmat::Transform

Definition at line 147 of file KinematicJoint.h.

void LinkComponent::getModelTransform ( fmat::Transform tr  )  const

converts the model rotation and offset members into the supplied fmat::Transform

Definition at line 528 of file KinematicJoint.cc.

KinematicJoint * LinkComponent::getNextMobileAncestor (  )  const
PlannerObstacle2D * LinkComponent::getObstacle ( const fmat::Transform worldT  )  const

Returns a 2D planner obstacle of this component's collision object, or NULL if no collision model is specified.

This is a new allocation, caller is responsible for deallocation.

Definition at line 548 of file KinematicJoint.cc.

Referenced by getObstacles().

void LinkComponent::getObstacles ( const fmat::Transform worldT,
HierarchicalObstacle obs,
bool  recurse 
) const

Inserts 2D projections of this link's collision components into obs, if recurse is set, recurses on branches.

Reimplemented in KinematicJoint.

Definition at line 571 of file KinematicJoint.cc.

virtual BoundingBox3D LinkComponent::getOwnAABB (  )  const [virtual]

Returns the axis-aligned bounding box (relative to link frame) of this component only (i.e. for KinematicJoint, ignores subcomponents).

Reimplemented in KinematicJoint.

Definition at line 105 of file KinematicJoint.h.

bool LinkComponent::getOwnBB2D ( const fmat::Transform worldT,
RectangularObstacle ro 
) const

Computes the tightest-fitting 2D rectangle for this link (writing the result into ro).

will be in the world coordinates, projecting the link collision model down the world's Z into its XY plane.

Definition at line 633 of file KinematicJoint.cc.

Referenced by ShapeSpaceCollisionCheckerBase< 2 >::addDisplayRobotObstacles(), ShapeSpaceCollisionCheckerBase< 2 >::addRobotObstacles(), ShapeSpacePlanner2DR< N >::getBoxes(), getObstacle(), RRTNode2DR< N >::CollisionChecker::LinkObstacle::setObstacle(), and RRTNode2DR< N >::CollisionChecker::JointObstacle::setObstacle().

bool LinkComponent::getOwnBB3D ( const fmat::Transform worldT,
BoxObstacle bo 
) const
virtual bool LinkComponent::hasMass (  )  const [virtual]

returns true if mass is greater than zero, of if this is a KinematicJoint, if any of the components have mass greater than zero

Reimplemented in KinematicJoint.

Definition at line 141 of file KinematicJoint.h.

void LinkComponent::init (  )  [protected]

Definition at line 178 of file KinematicJoint.h.

Referenced by LinkComponent().

LinkComponent& LinkComponent::operator= ( const LinkComponent link  ) 

assignment, except for parent

Definition at line 57 of file KinematicJoint.h.

virtual fmat::Column<4> LinkComponent::sumLinkCenterOfMass (  )  const [virtual]

returns the unnormalized center of mass of this link only, not including any branches; if this is actually a KinematicJoint, will include subcomponents

The last element (homogeneous scale factor) is left as the total mass, so divide by this value to normalize.

Reimplemented in KinematicJoint.

Definition at line 138 of file KinematicJoint.h.

Referenced by sumLinkCenterOfMass().

void LinkComponent::sumLinkCenterOfMass ( fmat::Column< 3 > &  cOfM,
float totalMass 
) const [virtual]

returns the center of mass of this link only, not including any branches; if this is actually a KinematicJoint, will include subcomponents

Definition at line 298 of file KinematicJoint.cc.

void LinkComponent::updateBB (  )  const [protected, virtual]

recomputes boundingBoxLow and boundingBoxHigh based on collision model parameters

Reimplemented in KinematicJoint.

Definition at line 619 of file KinematicJoint.cc.

Referenced by getAABB().


Friends And Related Function Documentation

friend class KinematicJoint [friend]

Definition at line 23 of file KinematicJoint.h.


Member Data Documentation

bool LinkComponent::bbDirty [mutable, protected]

indicates bounding boxes need to be recomputed

Definition at line 170 of file KinematicJoint.h.

Referenced by KinematicJoint::dirtyBB(), dirtyBB(), getAABB(), operator=(), and updateBB().

bounding box of this link (including subcomponents, but not child links)

Definition at line 171 of file KinematicJoint.h.

Referenced by getAABB(), operator=(), KinematicJoint::updateBB(), and updateBB().

the center of mass of this component

Definition at line 81 of file KinematicJoint.h.

Referenced by getMassVector(), init(), and operator=().

if going from empty string to non-empty string, indicates bounding box values need to be rebuilt

Definition at line 195 of file KinematicJoint.h.

indicates bounding box values need to be rebuilt

Definition at line 198 of file KinematicJoint.h.

rotation to apply to collisionModel (specifies axis component of quaternion, e.g. from axis/angle: axis * sin(angle/2) )

Definition at line 94 of file KinematicJoint.h.

Referenced by computeOwnAABB(), getCollisionModelTransform(), getObstacle(), init(), and operator=().

indicates bounding box values need to be rebuilt

Definition at line 197 of file KinematicJoint.h.

indicates bounding box values need to be rebuilt

Definition at line 196 of file KinematicJoint.h.

the mass of the component in kilograms

Definition at line 80 of file KinematicJoint.h.

Referenced by getMassVector(), hasMass(), KinematicJoint::hasMass(), init(), and operator=().

mesh files specify "default" textures, but this can override with a different material

Definition at line 85 of file KinematicJoint.h.

Referenced by init(), and operator=().

a translation to apply to model

Definition at line 90 of file KinematicJoint.h.

Referenced by getModelTransform(), init(), and operator=().

rotation to apply to model (specifies axis component of quaternion, e.g. from axis/angle: axis * sin(angle/2) )

Definition at line 89 of file KinematicJoint.h.

Referenced by getModelTransform(), init(), and operator=().

scaling factor to apply to model

Definition at line 88 of file KinematicJoint.h.

Referenced by init(), and operator=().

if false, will only be shown in the Mirage host's flying camera

Definition at line 83 of file KinematicJoint.h.

Referenced by init(), and operator=().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:12 2016 by Doxygen 1.6.3