Ignore namespace when creating MoveGroupInterface
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_),
arm_(moveit_constructor_options_)
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?
Thanks!
Asked by AndyZe on 2017-12-11 10:59:54 UTC
Comments
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;
andros::NodeHandle priv_nh("~");
andMyClass mc(nh, priv_nh);
When you provide string"/"
to the constructor, maybe it creates something else.Asked by Orhan on 2020-07-09 14:33:45 UTC