|
From: <tf...@us...> - 2008-04-28 15:46:23
|
Revision: 210
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=210&view=rev
Author: tfoote
Date: 2008-04-28 08:46:01 -0700 (Mon, 28 Apr 2008)
Log Message:
-----------
adding time to constructor and documenting. ticket:21
Modified Paths:
--------------
pkg/trunk/libTF/doc/libTF_Manual.tex
pkg/trunk/libTF/include/libTF/libTF.h
pkg/trunk/libTF/src/simple/libTF.cpp
Modified: pkg/trunk/libTF/doc/libTF_Manual.tex
===================================================================
--- pkg/trunk/libTF/doc/libTF_Manual.tex 2008-04-28 14:05:55 UTC (rev 209)
+++ pkg/trunk/libTF/doc/libTF_Manual.tex 2008-04-28 15:46:01 UTC (rev 210)
@@ -108,6 +108,26 @@
\subsection{libTF API}
\index{libTF API}
+The class which provides external functionality is named TransformReference.
+
+\subsubsection{Data Types}
+\begin{verbatim}
+typedef unsigned long long ULLtime;
+\end{verbatim}
+
+\texttt{ULLtime} provides a simple typedef for the timestamp used in this library.
+\texttt{ULLtime} is the number of nanoseconds since the epoch(1970) expressed as
+an unsigned long long, which should be equivilant to a \texttt{uint64\_t}.
+
+\subsubsection{Constructor}
+\index{libTF API!Constructor}
+\begin{verbatim}
+TransformReference(ULLtime cache_time = DEFAULT_CACHE_TIME);
+\end{verbatim}
+This is the constructor for the class. It's optional argument is
+how long to keep a history of the transforms. It is expressed in
+\texttt{ULLtime}, nanoseconds since the epoch(1970).
+
\subsubsection{Mutators}
\paragraph{setWithEulers}
@@ -159,14 +179,6 @@
unsigned int source_frame);
\end{verbatim}
-\subsubsection{Constructor}
-\index{libTF API!Constructor}
-\begin{verbatim}
-TransformReference();
-\end{verbatim}
-\todo{add max time default argument}
-
-
\section{ROS Integration}
unimplemented
Modified: pkg/trunk/libTF/include/libTF/libTF.h
===================================================================
--- pkg/trunk/libTF/include/libTF/libTF.h 2008-04-28 14:05:55 UTC (rev 209)
+++ pkg/trunk/libTF/include/libTF/libTF.h 2008-04-28 15:46:01 UTC (rev 210)
@@ -83,6 +83,9 @@
class TransformReference
{
public:
+ // A typedef for clarity
+ typedef unsigned long long ULLtime;
+
/************* Constants ***********************/
static const unsigned int ROOT_FRAME = 1; //Hard Value for ROOT_FRAME
static const unsigned int NO_PARENT = 0; //Value for NO_PARENT
@@ -90,10 +93,11 @@
static const unsigned int MAX_NUM_FRAMES = 100; /* The maximum number of frames possible */
static const unsigned int MAX_GRAPH_DEPTH = 100; /* The maximum number of times to descent before determining that graph has a loop. */
- typedef unsigned long long ULLtime;
+ static const ULLtime DEFAULT_CACHE_TIME = 10 * 1000000000ULL; //10 seconds in nanoseconds
+
/* Constructor */
- TransformReference();
+ TransformReference(ULLtime cache_time = DEFAULT_CACHE_TIME);
/********** Mutators **************/
/* Set a new frame or update an old one. */
@@ -157,6 +161,8 @@
* The frames will be dynamically allocated at run time when set the first time. */
RefFrame* frames[MAX_NUM_FRAMES];
+ // How long to cache transform history
+ ULLtime cache_time;
/* This struct is how the list of transforms are stored before being passed to computeTransformFromList. */
typedef struct
Modified: pkg/trunk/libTF/src/simple/libTF.cpp
===================================================================
--- pkg/trunk/libTF/src/simple/libTF.cpp 2008-04-28 14:05:55 UTC (rev 209)
+++ pkg/trunk/libTF/src/simple/libTF.cpp 2008-04-28 15:46:01 UTC (rev 210)
@@ -40,7 +40,8 @@
}
-TransformReference::TransformReference()
+TransformReference::TransformReference(ULLtime cache_time):
+ cache_time(cache_time)
{
/* initialize pointers to NULL */
for (unsigned int i = 0; i < MAX_NUM_FRAMES; i++)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|