Ignore namespace when creating MoveGroupInterface

asked 2017-12-11 09:59:54 -0600

AndyZe gravatar image

I have a namespaced node... I would like to keep the namespace because it points towards a particular set of ROS parameters. However, that namespace is wrecking the loading of MoveIt parameters. Here's the class constructor that gets hung up on nonexistent parameters, I think:

JogArmServer::JogArmServer(std::string move_group_name) :
  arm_(move_group_name)  // <-- The code hangs while loading parameters here

arm_ is a moveit::planning_interface::MoveGroupInterface.

I tried to get around it with options for the constructor:

JogArmServer::JogArmServer(std::string move_group_name) :
  nh_("/"), // Note: should have no namespace, I think.
  moveit_constructor_options_(move_group_name, "robot_description", nh_),

But, it looks like the nh_("/whatever_name") is not having any effect.

Am I using this optional nodeHandle right? Or is there another way to ignore the node's namespace while creating a MoveGroupInterface?


edit retag flag offensive close merge delete


I didn't check the source now, but I always declare and pass global node handle and private node handle like this: ros::NodeHandle nh; and ros::NodeHandle priv_nh("~"); and MyClass mc(nh, priv_nh); When you provide string "/" to the constructor, maybe it creates something else.

Orhan gravatar image Orhan  ( 2020-07-09 14:33:45 -0600 )edit