Commit 67b23caa authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix names of signals.

parent 29c9c516
......@@ -40,8 +40,8 @@ namespace dynamicgraph {
template<>const std::string TypeNameHelper<typeid>::typeName = #typeid
......@@ -93,19 +93,19 @@ namespace dynamicgraph
const std::string& topic = values[2].value ();
if (type == "double")
entity.add<double> (signal, topic);
entity.add<double> (type, signal, topic);
else if (type == "unsigned")
entity.add<unsigned int> (signal, topic);
entity.add<unsigned int> (type, signal, topic);
else if (type == "matrix")
entity.add<dg::Matrix> (signal, topic);
entity.add<dg::Matrix> (type, signal, topic);
else if (type == "vector")
entity.add<dg::Vector> (signal, topic);
entity.add<dg::Vector> (type, signal, topic);
else if (type == "vector3")
entity.add<specific::Vector3> (signal, topic);
entity.add<specific::Vector3> (type, signal, topic);
else if (type == "matrixHomo")
entity.add<sot::MatrixHomogeneous> (signal, topic);
entity.add<sot::MatrixHomogeneous> (type, signal, topic);
else if (type == "twist")
entity.add<specific::Twist> (signal, topic);
entity.add<specific::Twist> (type, signal, topic);
throw std::runtime_error("bad type");
return Value ();
......@@ -123,7 +123,6 @@ namespace dynamicgraph
virtual std::string getDocString () const;
void display (std::ostream& os) const;
void add (const std::string& signal, const std::string& topic);
void rm (const std::string& signal);
std::string list ();
void clear ();
......@@ -132,7 +131,7 @@ namespace dynamicgraph
std::size_t queueSize (const std::string& signal) const;
template <typename T>
void add (const std::string& signal, const std::string& topic);
void add (const std::string& type, const std::string& signal, const std::string& topic);
std::map<std::string, bindedSignal_t>&
bindedSignal ()
......@@ -20,6 +20,7 @@ namespace dynamicgraph
struct Add
void operator () (RosQueuedSubscribe& rosSubscribe,
const std::string& type,
const std::string& signal,
const std::string& topic)
......@@ -33,8 +34,8 @@ namespace dynamicgraph
SotToRos<T>::setDefault (bs->last);
// Initialize the signal.
boost::format signalName ("RosQueuedSubscribe(%1%)::%2%");
signalName % rosSubscribe.getName () % signal;
boost::format signalName ("RosQueuedSubscribe(%1%)::output(%2%)::%3%");
signalName % rosSubscribe.getName () % type % signal;
bs->signal.reset (new Signal_t (signalName.str ()));
bs->signal->setFunction (boost::bind(&BindedSignal_t::reader, bs, _1, _2));
......@@ -93,9 +94,9 @@ namespace dynamicgraph
} // end of namespace internal.
template <typename T>
void RosQueuedSubscribe::add (const std::string& signal, const std::string& topic)
void RosQueuedSubscribe::add (const std::string& type, const std::string& signal, const std::string& topic)
internal::Add<T> () (*this, signal, topic);
internal::Add<T> () (*this, type, signal, topic);
} // end of namespace dynamicgraph.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment