Dear all,
I am trying to run several instances of V-REP in parallel and I currently face a problem with the ROS interface.
The problem is that when I open multiple V-REP instances they all start the ROS node called /vrep_ros_interface which triggers a shutdown request for that node.
Is there a way to rename /vrep_ros_interface when I open a new instance of V-REP?
Best Regards,
Mathias Thor
How to rename the ROS interface node name?
Re: How to rename the ROS interface node name?
Hi mthor13,
currently the node name is hardcoded, and passed to ros::init() during plugin initialization.
You can change v_repExtRosInterface/src/vrep_ros_interface.cpp line 511 such that the node name is read from an external source.
For example, read it from an environment variable:
then you can pass the node name on the command line with:
For the next release, we will support this in a more standardized way.
currently the node name is hardcoded, and passed to ros::init() during plugin initialization.
You can change v_repExtRosInterface/src/vrep_ros_interface.cpp line 511 such that the node name is read from an external source.
For example, read it from an environment variable:
Code: Select all
const char* node_name = std::getenv("VREP_ROSINTERFACE_NODE_NAME");
// if not given, use the default name:
if(!node_name) node_name = "vrep_ros_interface";
ros::init(argc, argv, node_name);
Code: Select all
VREP_ROSINTERFACE_NODE_NAME=node1 ./vrep
Re: How to rename the ROS interface node name?
With the latest version of V-REP (v_rep, include, common, and v_repClientApplication git repositories, or wait for 3.6.1.rev4 to be released) and RosInterface, you can set the node name by passing a -GRosInterface.nodeName=MyNodeName command-line option to V-REP.
Re: How to rename the ROS interface node name?
Hi fferri,
Thank you very much for your replay. And also thank you for implementing this in rev4!
Best Regards,
Mathias Thor
Thank you very much for your replay. And also thank you for implementing this in rev4!
Best Regards,
Mathias Thor
Re: How to rename the ROS interface node name?
I would like to point out for future references that it's now -GROSInterface.nodeName=myNodeName