|
From: <tf...@us...> - 2008-04-18 00:35:35
|
Revision: 126
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=126&view=rev
Author: tfoote
Date: 2008-04-17 17:35:41 -0700 (Thu, 17 Apr 2008)
Log Message:
-----------
cleaning up header and adding Inverse method
Modified Paths:
--------------
pkg/trunk/libTF/simple/libTF.cc
pkg/trunk/libTF/simple/libTF.hh
Modified: pkg/trunk/libTF/simple/libTF.cc
===================================================================
--- pkg/trunk/libTF/simple/libTF.cc 2008-04-18 00:32:02 UTC (rev 125)
+++ pkg/trunk/libTF/simple/libTF.cc 2008-04-18 00:35:41 UTC (rev 126)
@@ -33,42 +33,13 @@
#include "libTF.hh"
RefFrame::RefFrame() :
- parent(0),
- myQuat()
+ Quaternion3D(),
+ parent(0)
{
return;
}
-/* Quaternion 3D version */
-void RefFrame::setParamsQuaternion3D(double a,double b,double c,double d,double e,double f, double g, unsigned long long time)
-{
- myQuat.fromQuaternion(a,b,c,d,e,f,g,time);
-};
-/* Six DOF version */
-void RefFrame::setParamsEulers(double a,double b,double c,double d,double e,double f, unsigned long long time)
-{
- myQuat.fromEuler(a,b,c,d,e,f,time) ;
-}
-
-/* DH Params version */
-void RefFrame::setParamsDH(double a,double b,double c,double d, unsigned long long time)
-{
- myQuat.fromDH(a,b,c,d,time);
-}
-
-
-NEWMAT::Matrix RefFrame::getMatrix(unsigned long long time)
-{
- return myQuat.getMatrix(time);
-}
-
-NEWMAT::Matrix RefFrame::getInverseMatrix(unsigned long long time)
-{
- return myQuat.getMatrix(time).i();
-};
-
-
TransformReference::TransformReference()
{
/* initialize pointers to NULL */
@@ -89,7 +60,7 @@
frames[frameID] = new RefFrame();
getFrame(frameID)->setParent(parentID);
- getFrame(frameID)->setParamsEulers(a,b,c,d,e,f,time);
+ getFrame(frameID)->fromEuler(a,b,c,d,e,f,time);
}
void TransformReference::set(unsigned int frameID, unsigned int parentID, double a,double b,double c,double d, unsigned long long time)
@@ -101,7 +72,7 @@
frames[frameID] = new RefFrame();
getFrame(frameID)->setParent(parentID);
- getFrame(frameID)->setParamsDH(a,b,c,d,time);
+ getFrame(frameID)->fromDH(a,b,c,d,time);
}
Modified: pkg/trunk/libTF/simple/libTF.hh
===================================================================
--- pkg/trunk/libTF/simple/libTF.hh 2008-04-18 00:32:02 UTC (rev 125)
+++ pkg/trunk/libTF/simple/libTF.hh 2008-04-18 00:35:41 UTC (rev 126)
@@ -40,34 +40,20 @@
#include <vector>
#include "Quaternion3D.hh"
-class RefFrame
+class RefFrame: public Quaternion3D
{
public:
/* Constructor */
RefFrame();
- /* Set the parameters for this frame */
- void setParamsQuaternion3D(double, double, double, double, double, double, double, unsigned long long time);
- void setParamsEulers(double, double, double, double, double, double, unsigned long long time);
- void setParamsDH(double, double, double, double, unsigned long long time);
/* Get the parent node */
inline unsigned int getParent(){return parent;};
/* Return tha parent node */
inline void setParent(unsigned int parentID){parent = parentID;};
-
- /* Generate and return the transform associated with gettingn into this frame */
- NEWMAT::Matrix getMatrix(unsigned long long time);
-
- /* Generate and return the transform associated with getting out of this frame. */
- NEWMAT::Matrix getInverseMatrix(unsigned long long time);
-
-
private:
- /* Storage of the parametsrs */
- Quaternion3D myQuat;
/* Storage of the parent */
unsigned int parent;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|