RigidDOF Class Reference

#include <dof.h>

Inheritance diagram for RigidDOF:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool accumulateMove (double q1, double *jointVals, int *stoppedJoints)
 Any stopped joint stops all joints of this DOF.
virtual void buildDynamicCouplingConstraints (std::map< Body *, int > &islandIndices, int numBodies, double *Nu, double *eps, int &ncn)
 Rigid coupling constraints ensure all joints move together.
virtual void buildDynamicLimitConstraints (std::map< Body *, int > &islandIndices, int numBodies, double *H, double *g, int &hcn)
 Only one, applied to first joint in the DOF.
virtual bool computeStaticJointTorques (double *, double)
 Zero everywhere, no static torques.
virtual void getJointValues (double *jointVals) const
 Each joint only depepends on dof value.
virtual int getNumCouplingConstraints ()
 Rigid coupling constraints ensure all joints move together.
virtual int getNumLimitConstraints ()
 At most one, if any of the joints is close or outside limit.
virtual double getStaticRatio (Joint *j) const
 For a rigid DOF, the coupling ratio decides the ratio of movement, since the coupling is rigid.
Type getType () const
 Returns the type of this DOF.
virtual void reset ()
 This is empty for the rigid DOF which is entirely state-less, nothing to reset.
 RigidDOF (RigidDOF *original)
 RigidDOF ()
virtual void setForce (double f)
 Only sets force to first joint, coupling constraints should take care of rest.
virtual void updateFromJointValues (const double *jointVals=NULL)
 Sets based on first joint in the list.
virtual void updateVal (double q1)
 Nothing special to do here.

Private Member Functions

double getClosestJointLimit (int *direction)
 Checks the most that any of the joints is outside of its legal range by.

Detailed Description

The RigidDOF is the simplest form of DOF. All of its joints are rigidly connected, so if one stops, all stop.

Definition at line 267 of file dof.h.


Constructor & Destructor Documentation

RigidDOF::RigidDOF (  )  [inline]

Definition at line 273 of file dof.h.

RigidDOF::RigidDOF ( RigidDOF original  )  [inline]

Definition at line 274 of file dof.h.


Member Function Documentation

bool RigidDOF::accumulateMove ( double  q1,
double *  jointVals,
int *  stoppedJoints 
) [virtual]

Any stopped joint stops all joints of this DOF.

The RigidDOF stops altogether if a single joint that it controls is stopped. If not, it sets all joints based on their ratio to the DOF value

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 467 of file dof.cpp.

void RigidDOF::buildDynamicCouplingConstraints ( std::map< Body *, int > &  islandIndices,
int  numBodies,
double *  Nu,
double *  eps,
int &  ncn 
) [virtual]

Rigid coupling constraints ensure all joints move together.

On the rigid dof, all joints are coupled together, enforcing that the movement in all joints is identical to the movement in the first joint in the list controlled by this DOF.

Implements DOF.

Definition at line 392 of file dof.cpp.

void RigidDOF::buildDynamicLimitConstraints ( std::map< Body *, int > &  islandIndices,
int  numBodies,
double *  H,
double *  g,
int &  hcn 
) [virtual]

Only one, applied to first joint in the DOF.

The regular DOF only imposes a single limit constraint, which will be placed on the first joint in this DOF. Assumes the rest of the joints are rigidly connected, so coupling constraints will take care of the rest.

Implements DOF.

Definition at line 357 of file dof.cpp.

virtual bool RigidDOF::computeStaticJointTorques ( double *  ,
double   
) [inline, virtual]

Zero everywhere, no static torques.

In the RigidDOF there is never any excess force applied at any joint. All joints are rigidly connected to the DOF, so once a joint is stopped the DOF can not advance any more so no more force is applied.

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 294 of file dof.h.

double RigidDOF::getClosestJointLimit ( int *  direction  )  [private]

Checks the most that any of the joints is outside of its legal range by.

Returns how far this dof is from exceeding one of it's joint limits. The return value is the distance between the current value and the joint limit, positive if the joint is inside its limit or negative if the joint has already exceeded its limit. direction is set to +1 if the limit is a positive one, or -1 if the limit is a negative one.

Definition at line 313 of file dof.cpp.

void RigidDOF::getJointValues ( double *  jointVals  )  const [virtual]

Each joint only depepends on dof value.

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 456 of file dof.cpp.

virtual int RigidDOF::getNumCouplingConstraints (  )  [inline, virtual]

Rigid coupling constraints ensure all joints move together.

Implements DOF.

Definition at line 303 of file dof.h.

int RigidDOF::getNumLimitConstraints (  )  [virtual]

At most one, if any of the joints is close or outside limit.

If any of the joints are too close (or over) their range, we still have a single contraint that we will use to correct this

Implements DOF.

Definition at line 345 of file dof.cpp.

double RigidDOF::getStaticRatio ( Joint j  )  const [virtual]

For a rigid DOF, the coupling ratio decides the ratio of movement, since the coupling is rigid.

Implements DOF.

Definition at line 450 of file dof.cpp.

Type RigidDOF::getType (  )  const [inline, virtual]

Returns the type of this DOF.

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 275 of file dof.h.

virtual void RigidDOF::reset (  )  [inline, virtual]

This is empty for the rigid DOF which is entirely state-less, nothing to reset.

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 285 of file dof.h.

void RigidDOF::setForce ( double  f  )  [virtual]

Only sets force to first joint, coupling constraints should take care of rest.

Sets the current force applied to this DOF, keeping it within the maximum force limits. This force is then applied to the joints based on the transmission type implemented by each dof.

Implements DOF.

Definition at line 294 of file dof.cpp.

void RigidDOF::updateFromJointValues ( const double *  jointVals = NULL  )  [virtual]

Sets based on first joint in the list.

In the RigidDOF all joint values behave the same way (either they are all stopped or they all move based on the DOF ratios. Therefore it is enough to look at a single joint in the list (such as the first one) to know what the DOF value should be.

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 488 of file dof.cpp.

virtual void RigidDOF::updateVal ( double  q1  )  [inline, virtual]

Nothing special to do here.

Implements DOF.

Reimplemented in BreakAwayDOF.

Definition at line 283 of file dof.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


graspit
Author(s):
autogenerated on Wed Jan 25 11:00:24 2012