Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update view_frames to use AllFramesAsDot(rospy.time.now()) #77

Merged
merged 1 commit into from Mar 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tf/include/tf/tf.h
Expand Up @@ -294,7 +294,7 @@ class Transformer
/** \brief A way to see what frames have been cached
* Useful for debugging
*/
std::string allFramesAsDot() const;
std::string allFramesAsDot(double current_time = 0) const;

/** \brief A way to get a std::vector of available frame ids */
void getFrameStrings(std::vector<std::string>& ids) const;
Expand Down
2 changes: 1 addition & 1 deletion tf/scripts/view_frames
Expand Up @@ -61,7 +61,7 @@ def listen(duration):
print "Listening to /tf for %f seconds"%duration
time.sleep(duration)
print "Done Listening"
return tf_listener.allFramesAsDot()
return tf_listener.allFramesAsDot(rospy.Time.now())


def poll(node_name):
Expand Down
10 changes: 7 additions & 3 deletions tf/src/pytf.cpp
Expand Up @@ -139,10 +139,14 @@ static PyObject *getTFPrefix(PyObject *self, PyObject *args)
return PyString_FromString(t->getTFPrefix().c_str());
}

static PyObject *allFramesAsDot(PyObject *self, PyObject *args)
static PyObject *allFramesAsDot(PyObject *self, PyObject *args, PyObject *kw)
{
tf::Transformer *t = ((transformer_t*)self)->t;
return PyString_FromString(t->allFramesAsDot().c_str());
static const char *keywords[] = { "time", NULL };
ros::Time time;
if (!PyArg_ParseTupleAndKeywords(args, kw, "|O&", (char**)keywords, rostime_converter, &time))
return NULL;
return PyString_FromString(t->allFramesAsDot(time.toSec()).c_str());
}

static PyObject *allFramesAsString(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -445,7 +449,7 @@ static PyObject *getFrameStrings(PyObject *self, PyObject *args)

static struct PyMethodDef transformer_methods[] =
{
{"allFramesAsDot", allFramesAsDot, METH_VARARGS},
{"allFramesAsDot", (PyCFunction)allFramesAsDot, METH_KEYWORDS},
{"allFramesAsString", allFramesAsString, METH_VARARGS},
{"setTransform", setTransform, METH_VARARGS},
{"canTransform", (PyCFunction)canTransform, METH_KEYWORDS},
Expand Down
4 changes: 2 additions & 2 deletions tf/src/tf.cpp
Expand Up @@ -436,9 +436,9 @@ std::string Transformer::allFramesAsString() const
return tf2_buffer_.allFramesAsString();
}

std::string Transformer::allFramesAsDot() const
std::string Transformer::allFramesAsDot(double current_time) const
{
return tf2_buffer_._allFramesAsDot();
return tf2_buffer_._allFramesAsDot(current_time);
}


Expand Down