Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
IK Class Reference

Main class for inverse kinematic computation. More...

#include <ik.h>

Inheritance diagram for IK:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ConstIndex { HAVE_CONSTRAINT, NO_CONSTRAINT }
enum  ConstType {
  HANDLE_CONSTRAINT, DESIRE_CONSTRAINT, COM_CONSTRAINT, SCALAR_JOINT_LIMIT_CONSTRAINT,
  IK_NUM_CONSTRAINT_TYPES
}
enum  Priority { HIGH_PRIORITY = 0, HIGH_IF_POSSIBLE, LOW_PRIORITY, N_PRIORITY_TYPES }

Public Member Functions

int AddConstraint (IKConstraint *_constraint)
IKHandleAddMarker (const std::string &label, const std::string &linkname, const std::string &charname, const fVec3 &rel_pos)
 Add new marker constraint.
IKHandleAddMarker (const char *marker_name, Joint *parent_joint, const fVec3 &abs_pos=0.0)
int ConstraintID (ConstType _type, const char *jname)
int ConstraintID (int _index)
int ConstraintIndex (ConstType _type, const char *jname)
int ConstraintIndex (int _id)
int DisableDesire (const char *jname)
 Disable desire constraint of the specific joint.
int EditMarker (IKHandle *marker, const char *body_name, Joint *parent_joint, const fVec3 &abs_pos=0.0)
int EnableDesire (const char *jname)
 Enable desire constraint of the specific joint.
IKConstraintFindConstraint (ConstType _type, const char *jname, const char *charname=0)
IKConstraintFindConstraint (int _id)
double GetMaxConditionNumber ()
 Get maximum condition number.
 IK ()
 Default constructor.
int LoadMarkerXML (const char *fname, const char *_charname)
 Load marker information from XML file.
int NumConstraints ()
 Number of constraints.
int NumConstraints (ConstType t)
 Number of constraints with specific type.
int RemoveAllConstraints ()
int RemoveConstraint (int _id)
int ResetAllConstraints ()
 Reset all constraints.
int ResetConstraints (ConstType t)
 Reset the constraints with the specific type.
int SaveMarkers (const char *fname)
void SetCharacterScale (double _scale, const char *charname=0)
 Set character scale parameter.
void SetConstraintScale (double _scale, const char *charname=0)
 Set constraint scale parameter.
int SetDesireGain (const char *jname, double _gain)
 Set gain of desire constraint of the specific joint.
int SetJointWeight (const char *jname, double _weight)
 Set joint weight, for single-DOF joints.
int SetJointWeight (const char *jname, const fVec &_weight)
 Set joint weight, for multiple-DOF joints.
void SetMaxConditionNumber (double cn)
 Set maximum condition number.
double Update (double timestep)
double Update (double max_timestep, double min_timestep, double max_integ_error=DEFAULT_MAX_INTEG_ERROR)
 Perform inverse kinematics with adaptive time step.
 ~IK ()
 Destructor.

Protected Member Functions

IKHandleadd_marker (const char *marker_name, Joint *parent_joint, const fVec3 &abs_pos)
IKHandleadd_marker (TransformNode *tn)
int assign_constraints (int _n)
int calc_feedback ()
int calc_jacobian ()
 compute the Jacobian matrix
int copy_jacobian ()
int edit_marker (IKHandle *marker, const char *body_name, Joint *parent_joint, const fVec3 &abs_pos)
int init (SceneGraph *sg)
 Initialize the parameters.
int load_markers (SceneGraph *sg, Joint *rj)
int load_markers (TransformNode *marker_top)
int myinit (SceneGraph *sg)
int save_marker (TransformNode *top_tnode, IKHandle *h)
void set_character_scale (Joint *jnt, double _scale, const char *charname)
double solve_ik ()
 compute the joint velocity

Protected Attributes

IKConstraint ** constraints
 list of current constraints
fVec fb [N_PRIORITY_TYPES]
 constraint error of each type
fMat J [N_PRIORITY_TYPES]
 Jacobian matrix of each type.
fVec joint_weights
 joint weights
double max_condnum
 maximum condition number
int n_all_const
int n_assigned_constraints
int n_const [N_PRIORITY_TYPES]
 number of constraints of each type
int n_constraints
 number of current constraints
int n_total_const
 number of total constraints used so far, including removed ones
fVec weight [N_PRIORITY_TYPES]
 weight of each type

Friends

class IKConstraint
class IKDesire
class IKHandle

Detailed Description

Main class for inverse kinematic computation.

Definition at line 37 of file ik.h.


Member Enumeration Documentation

Enumerator:
HAVE_CONSTRAINT 

with constraint

NO_CONSTRAINT 

without constraint

Definition at line 66 of file ik.h.

Enumerator:
HANDLE_CONSTRAINT 

position/orientation of link

DESIRE_CONSTRAINT 

desired joint values

COM_CONSTRAINT 

center of mass position

SCALAR_JOINT_LIMIT_CONSTRAINT 

joint limit for rotate and slide joints

IK_NUM_CONSTRAINT_TYPES 

Definition at line 47 of file ik.h.

Enumerator:
HIGH_PRIORITY 

strictly satisfied

HIGH_IF_POSSIBLE 

strictly satisfied if possible

LOW_PRIORITY 

lower priority

N_PRIORITY_TYPES 

Definition at line 57 of file ik.h.


Constructor & Destructor Documentation

IK::IK ( )

Default constructor.

Definition at line 17 of file ik.cpp.

IK::~IK ( )

Destructor.

Definition at line 29 of file ik.cpp.


Member Function Documentation

IKHandle * IK::add_marker ( const char *  marker_name,
Joint parent_joint,
const fVec3 abs_pos 
) [protected]

Definition at line 282 of file ik.cpp.

IKHandle * IK::add_marker ( TransformNode *  tn) [protected]

Definition at line 125 of file ik.cpp.

int IK::AddConstraint ( IKConstraint _constraint)

Add a new constraint.

Parameters:
[in]_constraintpointer to the new constraint object
Returns:
ID of the constraint

Definition at line 428 of file ik.cpp.

IKHandle * IK::AddMarker ( const std::string &  label,
const std::string &  linkname,
const std::string &  charname,
const fVec3 rel_pos 
)

Add new marker constraint.

Add new marker constraint.

Parameters:
[in]labelmarker label
[in]linknamename of the link to which the marker is attached
[in]charnamecharacter name of the link
[in]rel_posposition of the marker in joint frame

Definition at line 244 of file ik.cpp.

IKHandle * IK::AddMarker ( const char *  marker_name,
Joint parent_joint,
const fVec3 abs_pos = 0.0 
)

Definition at line 271 of file ik.cpp.

int IK::assign_constraints ( int  _n) [protected]

Definition at line 402 of file ik.cpp.

int IK::calc_feedback ( ) [protected]

Definition at line 112 of file update_ik.cpp.

int IK::calc_jacobian ( ) [protected]

compute the Jacobian matrix

Definition at line 66 of file update_ik.cpp.

int IK::ConstraintID ( ConstType  _type,
const char *  jname 
)

Obtaint the constraint ID by its type and joint name.

Returns:
constraint ID

Definition at line 493 of file ik.cpp.

int IK::ConstraintID ( int  _index)

Obtaint the constraint ID by its index.

Returns:
constraint ID

Definition at line 504 of file ik.cpp.

int IK::ConstraintIndex ( ConstType  _type,
const char *  jname 
)

Obtain the index of a constraint by its type and joint name.

Returns:
index of the constraint

Definition at line 511 of file ik.cpp.

Obtain the index of a constraint by its type and ID.

Returns:
index of the constraint

Definition at line 522 of file ik.cpp.

int IK::copy_jacobian ( ) [protected]

Definition at line 125 of file update_ik.cpp.

int IK::DisableDesire ( const char *  jname)

Disable desire constraint of the specific joint.

Definition at line 596 of file ik.cpp.

int IK::edit_marker ( IKHandle marker,
const char *  body_name,
Joint parent_joint,
const fVec3 abs_pos 
) [protected]

Definition at line 306 of file ik.cpp.

int IK::EditMarker ( IKHandle marker,
const char *  body_name,
Joint parent_joint,
const fVec3 abs_pos = 0.0 
)

Definition at line 295 of file ik.cpp.

int IK::EnableDesire ( const char *  jname)

Enable desire constraint of the specific joint.

Definition at line 587 of file ik.cpp.

IKConstraint * IK::FindConstraint ( ConstType  _type,
const char *  jname,
const char *  charname = 0 
)

Search a constraint by constraint type and joint name.

Parameters:
[in]_typeconstraint type
[in]jnamejoint name
[in]charnamecharacter name (optional)
Returns:
pointer to the constraint

Definition at line 465 of file ik.cpp.

Search a constraint by the ID

Returns:
pointer to the constraint

Definition at line 483 of file ik.cpp.

double IK::GetMaxConditionNumber ( ) [inline]

Get maximum condition number.

Definition at line 173 of file ik.h.

int IK::init ( SceneGraph *  sg) [protected, virtual]

Initialize the parameters.

Reimplemented from Chain.

Definition at line 54 of file ik.cpp.

int IK::load_markers ( SceneGraph *  sg,
Joint rj 
) [protected]

Definition at line 89 of file ik.cpp.

int IK::load_markers ( TransformNode *  marker_top) [protected]

Definition at line 110 of file ik.cpp.

int IK::LoadMarkerXML ( const char *  fname,
const char *  _charname 
)

Load marker information from XML file.

int IK::myinit ( SceneGraph *  sg) [protected]

Definition at line 70 of file ik.cpp.

int IK::NumConstraints ( ) [inline]

Number of constraints.

Definition at line 77 of file ik.h.

Number of constraints with specific type.

Definition at line 392 of file ik.cpp.

Remove all constraints.

Definition at line 454 of file ik.cpp.

Remove a constraint.

Parameters:
[in]_idID of the constraint to be removed
Returns:
0 if success, -1 if failure (e.g. constraint not found)

Definition at line 439 of file ik.cpp.

Reset all constraints.

Definition at line 532 of file ik.cpp.

Reset the constraints with the specific type.

Definition at line 540 of file ik.cpp.

int IK::save_marker ( TransformNode *  top_tnode,
IKHandle h 
) [protected]

Definition at line 357 of file ik.cpp.

int IK::SaveMarkers ( const char *  fname)

Definition at line 336 of file ik.cpp.

void IK::set_character_scale ( Joint jnt,
double  _scale,
const char *  charname 
) [protected]

Definition at line 623 of file ik.cpp.

void IK::SetCharacterScale ( double  _scale,
const char *  charname = 0 
)

Set character scale parameter.

Definition at line 605 of file ik.cpp.

void IK::SetConstraintScale ( double  _scale,
const char *  charname = 0 
)

Set constraint scale parameter.

Definition at line 614 of file ik.cpp.

int IK::SetDesireGain ( const char *  jname,
double  _gain 
)

Set gain of desire constraint of the specific joint.

Definition at line 578 of file ik.cpp.

int IK::SetJointWeight ( const char *  jname,
double  _weight 
)

Set joint weight, for single-DOF joints.

Definition at line 551 of file ik.cpp.

int IK::SetJointWeight ( const char *  jname,
const fVec _weight 
)

Set joint weight, for multiple-DOF joints.

Definition at line 565 of file ik.cpp.

void IK::SetMaxConditionNumber ( double  cn) [inline]

Set maximum condition number.

Definition at line 169 of file ik.h.

double IK::solve_ik ( ) [protected]

compute the joint velocity

Definition at line 157 of file update_ik.cpp.

double IK::Update ( double  timestep)

Perform inverse kinematics computation.

Parameters:
[in]timestepintegration time step
Returns:
the maximum condition number

Definition at line 24 of file update_ik.cpp.

double IK::Update ( double  max_timestep,
double  min_timestep,
double  max_integ_error = DEFAULT_MAX_INTEG_ERROR 
)

Perform inverse kinematics with adaptive time step.

Definition at line 46 of file update_ik.cpp.


Friends And Related Function Documentation

friend class IKConstraint [friend]

Definition at line 40 of file ik.h.

friend class IKDesire [friend]

Definition at line 42 of file ik.h.

friend class IKHandle [friend]

Definition at line 41 of file ik.h.


Member Data Documentation

list of current constraints

Definition at line 230 of file ik.h.

constraint error of each type

Definition at line 236 of file ik.h.

fMat IK::J[N_PRIORITY_TYPES] [protected]

Jacobian matrix of each type.

Definition at line 235 of file ik.h.

fVec IK::joint_weights [protected]

joint weights

Definition at line 245 of file ik.h.

double IK::max_condnum [protected]

maximum condition number

Definition at line 242 of file ik.h.

int IK::n_all_const [protected]

Definition at line 239 of file ik.h.

Definition at line 232 of file ik.h.

number of constraints of each type

Definition at line 238 of file ik.h.

int IK::n_constraints [protected]

number of current constraints

Definition at line 224 of file ik.h.

int IK::n_total_const [protected]

number of total constraints used so far, including removed ones

Definition at line 227 of file ik.h.

weight of each type

Definition at line 237 of file ik.h.


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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:21