|
From: <tf...@us...> - 2008-03-26 20:48:56
|
Revision: 34
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=34&view=rev
Author: tfoote
Date: 2008-03-26 13:49:00 -0700 (Wed, 26 Mar 2008)
Log Message:
-----------
lots of documentation in headers
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-03-26 02:28:34 UTC (rev 33)
+++ pkg/trunk/libTF/simple/libTF.cc 2008-03-26 20:49:00 UTC (rev 34)
@@ -1,8 +1,7 @@
#include "libTF.hh"
RefFrame::RefFrame() :
- parent(0),
- active(false)
+ parent(0)
{
return;
}
@@ -34,14 +33,12 @@
}
-TransformReference::TransformReference():
- mMat(4,4)
-{
-
+/*TransformReference::TransformReference()
+ *{
+ * return;
+ *}
+ */
- return;
-}
-
void TransformReference::set(unsigned int frameID, unsigned int parentID, double a,double b,double c,double d,double e,double f)
{
frames[frameID].setParent(parentID);
Modified: pkg/trunk/libTF/simple/libTF.hh
===================================================================
--- pkg/trunk/libTF/simple/libTF.hh 2008-03-26 02:28:34 UTC (rev 33)
+++ pkg/trunk/libTF/simple/libTF.hh 2008-03-26 20:49:00 UTC (rev 34)
@@ -10,43 +10,71 @@
class RefFrame
{
public:
+ /* The type of frame
+ * This determines how many different parameters to expect to be updated, versus fixed */
// static enum FrameType {SIXDOF, DH //how to tell which mode it's in //todo add this process i'm going to start with 6dof only
+
+ /* Constructor */
RefFrame();
+
+ /* Set the parameters for this frame */
void setParams(double, double, double, double, double, double);
+
+ /* 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();
+
+ /* Generate and return the transform associated with getting out of this frame. */
NEWMAT::Matrix getInverseMatrix();
private:
+ /* Storage of the parametsrs */
double params[6];
+
+ /* A helper function to build a homogeneous transform based on 6dof parameters */
static bool fill_transformation_matrix(NEWMAT::Matrix& matrix_pointer, double ax,
double ay, double az, double yaw,
double pitch, double roll);
+ /* Storage of the parent */
unsigned int parent;
- bool active;
};
class TransformReference
{
public:
+ /* Set a new frame or update an old one. */
void set(unsigned int framid, unsigned int parentid, double,double,double,double,double,double);
+
+ /* Get the transform between two frames. */
NEWMAT::Matrix get(unsigned int target_frame, unsigned int source_frame);
- TransformReference();
+ /* Constructor */
+ // TransformReference();
+
+ /* Debugging function that will print to std::cout the transformation matrix */
void view(unsigned int target_frame, unsigned int source_frame);
+
private:
- double rD[6];
- NEWMAT::Matrix mMat;
+ /* The frames that the tree can be made of */
RefFrame frames[100];
+
+ /* This struct is how the list of transforms are stored before being generated. */
typedef struct
{
std::vector<unsigned int> inverseTransforms;
std::vector<unsigned int> forwardTransforms;
} TransformLists;
+ /* Find the list of connected frames necessary to connect two different frames */
TransformLists lookUpList(unsigned int target_frame, unsigned int source_frame);
+
+ /* Compute the transform based on the list of frames */
NEWMAT::Matrix computeTransformFromList(TransformLists list);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|