Skip to content
Snippets Groups Projects
Commit ca40117b authored by Thomas Moulard's avatar Thomas Moulard
Browse files

Make sure ros::init is called before creating the node handle.

parent fe409907
No related branches found
No related tags found
No related merge requests found
...@@ -14,18 +14,21 @@ namespace dynamicgraph ...@@ -14,18 +14,21 @@ namespace dynamicgraph
{ {
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(RosImport, "RosImport"); DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(RosImport, "RosImport");
RosImport::RosImport (const std::string& n) const char* rosInit()
: dynamicgraph::Entity(n),
nh_ (),
bindedSignal_ ()
{ {
int argc = 1; int argc = 1;
char* arg0 = strdup("ros_import"); char* arg0 = strdup("ros_import");
char* argv[] = {arg0, 0}; char* argv[] = {arg0, 0};
ros::init(argc, argv, "ros_import"); ros::init(argc, argv, "ros_import");
free (arg0); free (arg0);
return "dynamic_graph";
}
nh_ = ros::NodeHandle ("dynamic_graph"); RosImport::RosImport (const std::string& n)
: dynamicgraph::Entity(n),
nh_ (rosInit ()),
bindedSignal_ ()
{
} }
RosImport::~RosImport () RosImport::~RosImport ()
......
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