93 int getParentId(
CFrame *parent) {
for (
unsigned int i=0; i<parents.size(); i++)
if (parents[i] == parent)
return (
int)i;
return -1; };
96 bool setData(
bool value) { _isData = value;
return value;};
99 void lock() { _isLocked =
true; };
102 virtual void setName(
const char* str);
103 virtual char*
getName() {
return (
char*) name.c_str(); };
106 virtual bool hasName(
char* str);
128 void getDofs(std::vector<unsigned int> &dofs);
129 void getDofs(std::vector<double> &dofs_min, std::vector<double> &dofs_max);
130 void setDofs(
const std::vector<double> &dofs_min,
const std::vector<double> &dofs_max);
148 virtual std::string getFrameAsXml();
186 virtual CFrame* getBaseOrientation();
187 virtual void setBaseOrientation(
CFrame*
base);
206 unsigned int size() {
return frames.size(); };
207 int add(
CFrame* newFrame);
208 bool getFrameByName(
const char*
name,
CFrame* &frame);
209 int getFrameByName(
const char* name,
bool create =
false);
214 bool xmlToFrame(
CFrame *frame, TiXmlElement* frameNode,
bool create =
false);
215 bool xmlToFrame(
CFrame *frame, TiXmlElement* frameNode,
DataPairs &additionalData,
bool create =
false);
216 bool xmlToFrameCombination(
CFrameCombination *frame, TiXmlElement* frameNode,
DataPairs &additionalData,
bool create =
false);
218 void updateBaseLinks();
219 void updateBaseLinks(std::vector<CFrame*> &frames);
220 void updateBaseLinks(
CFrame* frame);
221 void loadFromFile(
const char* filename);
224 CFrame*
getFrame(
unsigned int id) {
if (
id < frames.size())
return frames[
id];
return NULL; };
225 CFrame*
getFrame(
const char* name) {
int id = getFrameByName(name,
false);
if (
id < 0)
return NULL;
return frames[id]; };
230 void checkBaseFrames();
232 static bool isRelativeTo(
CFrame* first,
CFrame* relative);
234 void resolve(std::vector<std::string> &in, std::vector<CFrame*> &out);
259 void setAngle(
double angle);
260 void set(
double rot_z,
double trans_z,
double rot_x,
double trans_x);
272 void setName(std::string value) { this->name = value; };
289 CDh& getDhParameters(
unsigned int id);
290 CFrame* getFrame(
unsigned int id);
303 void setLength(
int len);
304 unsigned int getLength() {
return (
unsigned int) length; };
324 unsigned int getLength() {
return (
unsigned int) length; };
368 if (getBaseOrientation() != NULL)
401 if (getBaseOrientation() != NULL)
427 for (
int i=0; i<length; i++)
436 frames[0]->invalidate();
437 for (
int i=0; i<length; i++)
440 frames[i]->setPoseNoInvalidation(
tmpMatrix);
447 frames[0]->invalidate();
455 for (
unsigned int i=0; i<frames.size(); i++)
461 frames[i]->invalidate();
477 for (
unsigned int i=0; i<
parents.size(); i++)
std::vector< double > dofs_max
double trans_x
Translation offset along rotated x-axis.
virtual void getPose(CMatrix &pose)
int getParentId(CFrame *parent)
virtual CFrame * getFrame()
Denavit Hartenberg Link information.
virtual bool hasName(char *str)
CFrame * getFrame(const char *name)
CFrame ** frames
Array of frames associated with every link in the chain.
virtual void setBase(CFrame *base)
std::string baseName
Name associated with frame.
unsigned long int counter
int id
Index of servo motor associated with the frame.
void invalidate(bool time=false)
Transforms a <FRAME> (xml object) into a frame.
void setDh(const robotLibPbD::CDh &dh)
Creates Denavit Hartenberg matrix.
virtual void update()
Updates the frames.
void mul(const CMatrix &first, const CMatrix &second)
Assigns product of two matrices to matrix.
Frame in cartesian space.
void setName(std::string value)
void update()
Updates denavit hartenberg matrices of all chains.
virtual CFrame * getByName(char *str)
Returns frame associated with /a str.
double sgn
Direction of rotation (+1.0 clockwise, -1.0 counterclockwise)
void getDofs(std::vector< unsigned int > &dofs)
CKinematicChain * chain
Array of kinematic chains.
virtual CMatrix getRelativeToBase()
Returns pose in the base (frame with no predecessor) frame.
Frame in cartesian space.
CFrame * baseOrientation
(Relative) base frame (f.e. the static robot frame or the frame of the previous link in a kinematic c...
int length
Number of kinematic chains.
void mulNoAlloc(const CMatrix &first, const CMatrix &second)
virtual void setBaseOrientationName(const char *str)
std::vector< CFrame * > getFrames()
CMatrix getRelativeToBase()
Returns pose in the base (frame with no predecessor) frame.
virtual void setRelativePose(const CMatrix &value)
double rot_x
Rotation offset around rotated x-axis.
Data Storage Class (Attribute-Value Pairs)
virtual void setPoseNoInvalidation(const CMatrix &pose)
virtual unsigned int getFrameType()
CMatrix pose
Translation and rotation relative to base frame (f.e. denavit hartenberg matrix)
double rot_z
Rotation offset around z-axis.
virtual void setFrame(CFrame *frame)
virtual void setBaseName(const char *str)
std::vector< CFrame * > frames
virtual void setTime(double time)
std::vector< CFrame * > childs
virtual char * getBaseName()
CDh * dhParameters
Array of denavit hartenberg parameters.
std::string baseOrientationName
Name associated with frame.
void setPose(const CMatrix &pose)
double angle
Current angle of rotation aroung z-axis (changes with the real servo position)
virtual void invalidateAll()
virtual void invalidate()
virtual void setBaseType(unsigned int type)
double trans_z
Translation offset along z-axis.
std::vector< CFrame * > parents
virtual void setPose(const CMatrix &pose)
Robot types with implemented inverse kinematics.
std::vector< CFrame * > & getParents()
virtual CFrame * getBase()
unsigned long int baseCounter
virtual CMatrix getPose()
void addParent(CFrame *parent)
CFrame * getFrame(unsigned int id)
virtual void invalidate()
virtual void setName(const char *str)
std::vector< double > dofs_min
virtual void invalidate()
virtual void setFrameType(unsigned int type)
void setDofs(const std::vector< double > &dofs_min, const std::vector< double > &dofs_max)
virtual ~CFrameContainer()
Configuration file wrapper.
virtual void invalidateAll()
CFrame * base
(Relative) base frame (f.e. the static robot frame or the frame of the previous link in a kinematic c...
CMatrix getRelativeToBase()
Returns pose in the base (frame with no predecessor) frame.
virtual char * getBaseOrientationName()
int length
Number of links in the chain.
virtual unsigned int getBaseType()
void removeParent(CFrame *parent)
void update()
Updates denavit hartenberg matrices.