Klamp't  0.8.1
Classes | Public Member Functions | Public Attributes | List of all members
GeneralizedRobot Class Reference

A collection of robots and objects that can be treated like one "big robot". More...

#include <GeneralizedRobot.h>

Classes

struct  Element
 

Public Member Functions

 GeneralizedRobot (RobotWorld &world)
 
int Add (Robot *robot, const char *name=NULL)
 
int Add (RigidObject *object, const char *name=NULL)
 
void Remove (int id)
 
void Remove (const char *name)
 
void Remove (Robot *robot)
 
void Remove (RigidObject *object)
 
int ID (const char *name) const
 Returns the array index of the given named element.
 
int ID (Robot *robot) const
 Returns the array index of the given robot.
 
int ID (RigidObject *object) const
 Returns the array index of the given object.
 
int NumDof () const
 Returns the total number of DOF.
 
string DofName (int index) const
 Returns a name for the given DOF index.
 
int DofToID (int index) const
 Returns the ID for the indicated DOF.
 
pair< int, int > Dofs (int id) const
 Returns the DOF index range associated with the given id.
 
pair< int, int > Dofs (const char *name) const
 Returns the DOF index range associated with the given named element.
 
pair< int, int > Dofs (Robot *robot) const
 Returns the DOF index range associated with the given robot.
 
pair< int, int > Dofs (RigidObject *object) const
 Returns the DOF index range associated with the given object.
 
int Dof (int id, int link) const
 Returns the DOF index associated with the element of the given id, offset by link.
 
int Dof (Robot *robot, int link) const
 Returns the DOF index associated with the element of the given id, offset by link.
 
int Dof (const char *name, int link) const
 Returns the DOF index associated with the element of the given name.
 
void SetConfig (const Config &q)
 Sets a joint configuration of all the elements.
 
void SetVelocity (const Vector &v)
 Sets a joint velocity of all the elements.
 
void GetConfig (Config &q) const
 Gets the joint configuration of all the elements.
 
void GetVelocity (Vector &v) const
 Gets the joint velocity of all the elements.
 
void UpdateGeometry ()
 Updates the geometry of all the elements.
 
void Split (const Config &q, vector< Config > &qsplit) const
 Splits the joint configuration to a list of configurations of individual elements.
 
void SplitRefs (const Config &q, vector< Config > &qsplit) const
 Same as split, but generates references to q in order to minimize copying.
 
void Join (const vector< Config > &qsplit, Config &q) const
 Joins a list of configurations of indivdual elements into a single joint configuration.
 
void Interpolate (const Config &a, const Config &b, Real u, Config &out) const
 Interpolates two configurations.
 
void InterpolateVelocity (const Config &a, const Config &b, Real u, Vector &dq) const
 Returns the velocity vector that will move from a to b at the parameter u.
 
void Integrate (const Config &q, const Vector &dq, Config &out) const
 
Real Distance (const Config &a, const Config &b, Real floatingRotationWeight=1.0) const
 Returns a distance metric between two configurations.
 
void GetJointLimits (Config &qmin, Config &qmax) const
 Gets joint limits among all objects.
 
Vector3 GetCOM () const
 Gets the overall center of mass.
 
void GetMegaRobot (Robot &voltron) const
 Gets the "mega robot" that merges all robots and objects together.
 

Public Attributes

map< int, Elementelements
 

Detailed Description

A collection of robots and objects that can be treated like one "big robot".

Allows treating configuration in a single vector. Configurations of objects are specified as 6 DOF (x,y,z,rz,ry,rx).


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