Skip to content
Snippets Groups Projects
Commit 770b844c authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Clean RosTfListener commands.

parent 0a259f5b
No related branches found
No related tags found
No related merge requests found
#include <dynamic-graph/python/module.hh>
#include "ros_tf_listener.hh"
namespace dg = dynamicgraph;
BOOST_PYTHON_MODULE(wrap)
{
bp::import("dynamic_graph");
dg::python::exposeEntity<dg::RosTfListener, bp::bases<dg::Entity>, dg::python::AddCommands>()
.def("add", &dg::RosTfListener::add,
"Add a signal containing the transform between two frames.",
bp::args( "to_frame_name", "from_frame_name", "out_signal_name"))
.def("setMaximumDelay", &dg::RosTfListener::setMaximumDelay,
"Set the maximum time delay of the transform obtained from tf.",
bp::args("signal_name", "delay_seconds"))
;
}
#include "ros_tf_listener.hh"
typedef boost::mpl::vector< dynamicgraph::RosTfListener > entities_t;
...@@ -72,31 +72,11 @@ class RosTfListener : public Entity { ...@@ -72,31 +72,11 @@ class RosTfListener : public Entity {
: Entity(_name) : Entity(_name)
, buffer() , buffer()
, listener(buffer, rosInit(), false) , listener(buffer, rosInit(), false)
{ {}
std::string docstring =
"\n"
" Add a signal containing the transform between two frames.\n"
"\n"
" Input:\n"
" - to : frame name\n"
" - from: frame name,\n"
" - signalName: the signal name in dynamic-graph"
"\n";
addCommand("add", command::makeCommandVoid3(*this, &RosTfListener::add, docstring));
docstring =
"\n"
" Set the maximum time delay of the transform obtained from tf.\n"
"\n"
" Input:\n"
" - signalName: the signal name,\n"
" - delay : in seconds\n"
"\n";
addCommand("setMaximumDelay", command::makeCommandVoid2(*this, &RosTfListener::setMaximumDelay, docstring));
}
~RosTfListener() ~RosTfListener()
{ {
for (Map_t::const_iterator _it = listenerDatas.begin(); _it != listenerDatas.end(); ++_it) delete _it->second; for (const auto& pair : listenerDatas) delete pair.second;
} }
void add(const std::string& to, const std::string& from, const std::string& signame) void add(const std::string& to, const std::string& from, const std::string& signame)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment