0
$\begingroup$

Rosanswers logo

When trying to launch an empty world in gazebo using the command

roslaunch gazebo_worlds empty_world.launch 

I encounter the error

Invalid node name [gazeboo/�]: node names cannot contain /

Is there a known fix for this issue?


The full error is:

terminate called after throwing an instance of 'ros::InvalidNodeNameException' what(): Invalid node name [gazeboo/�]: node names cannot contain / Msg Waiting for master Aborted (core dumped) Error [Connection.cc:477] Connection[0] Closed during Read terminate called after throwing an instance of 'boost::system::system_error' what(): Connection reset by peer [gazebo-2] process has died [pid 18337, exit code 134, cmd /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/gazebo /opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/worlds/empty.world __name:=gazebo __log:=/home/dhruv/.ros/log/6ed9ee8a-dde5-11e2-a0c6-0026c789069a/gazebo-2.log]. log file: /home/dhruv/.ros/log/6ed9ee8a-dde5-11e2-a0c6-0026c789069a/gazebo-2*.log Aborted (core dumped) [gazebo_gui-3] process has died [pid 18346, exit code 134, cmd /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/gui __name:=gazebo_gui __log:=/home/dhruv/.ros/log/6ed9ee8a-dde5-11e2-a0c6-0026c789069a/gazebo_gui-3.log]. log file: /home/dhruv/.ros/log/6ed9ee8a-dde5-11e2-a0c6-0026c789069a/gazebo_gui-3*.log


Launch file:



Originally posted by sunzun on ROS Answers with karma: 41 on 2013-06-25

Post score: 4


Original comments

Comment by prasanna.kumar on 2013-06-25:
Did you try changing the node name ? Try re-naming the node name from its current value to something else, just 'gazebo' for instance. And also please update the question with your launch file.

Comment by sunzun on 2013-06-26:
I believe the issue is in the ROS api for the gazebo. I haven't made any modifications to the standard groovy install for gazebo (I'm just attempting to run the launch file that ships with the package). I've posted the launch file.

Comment by sunzun on 2013-06-26:
I would go through the source code myself, but it's thousands of lines of code, and a simply searching for "gazeboo" leads me to believe the issue is not as simple as a typo. Of course, I could be wrong, but I couldn't find where the issue was myself.

Comment by RC on 2013-06-26:
I have the same problem, I hope to find the way to solve this.

Comment by fberger on 2014-04-25:
Did anyone resolve this issue?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Okay, so there's apparently an issue with parsing the input argc/argv arguments when initializing the node in the file

/opt/ros/groovy/stacks/simulator_gazebo/gazebo/src/gazebo_ros_api_plugin.src

I fixed this by explicitly defining the node name in the function

void GazeboRosApiPlugin::Load(int argc, char** argv)

by replacing

ros::init(argc,argv,"gazebo",ros::init_options::NoSigintHanlder);

with

std::mapstd::string,std::string remappings; remappings["gazebo"] = "gazebo"; ros::init(remappings,"gazebo",ros::init_options::NoSigintHanlder);

Probably not the most elegant solution, nor does it actually address the root cause of this issue, but it fixes the problem.


Originally posted by sunzun with karma: 41 on 2013-07-09

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by octavian on 2013-08-22:
I had the same issue and tried your suggestion above. Do you perform a 'rosmake -a' afterwards in order to compile?

Comment by fberger on 2014-04-25:
Sunzun, are there any steps to do after editing the file? Also, are you editing gazebo_ros_api_plugin.src or gazebo_ros_api_plugin.cpp? Your instructions so far haven't gotten it to work for me...

$\endgroup$
0
$\begingroup$

Rosanswers logo

I thought I'd explain Sunzun's solution with a bit more detail.

First edit: /opt/ros/groovy/stacks/simulator_gazebo/gazebo/src/gazebo_ros_api_plugin.cpp

By replacing:

// setup ros related
if (!ros::isInitialized()) {
   ros::init(argc,argv,"gazebo",ros::init_options::NoSigintHandler);
 else 
    ROS_ERROR("Something other than this gazebo_ros_api plugin started ros::init(...), command line arguments may not be parsed properly.");

with:

// setup ros related
if (!ros::isInitialized()) {
    std::map<std::string,std::string> remappings; 
     remappings["gazebo"] = "gazebo"; 
     ros::init(remappings,"gazebo",ros::init_options::NoSigintHandler);
  } else {
    ROS_ERROR("Something other than this gazebo_ros_api plugin started ros::init(...), command line arguments may not be parsed properly.");
  }

It is important to add the brackets around the if and else statement since we now have multiple instructions within the if statement clause.

Now, in order to re-compile the package with the changes, this is perhaps a little bit of a hack but you need to first delete the ROS_NOBUILD file from within /opt/ros/groovy/stacks/simulator_gazebo/gazebo This will tell rosmake to recompile this package.

If you attempt to run rosmake simulator_gazebo, you will get a permission denied error, so now you need to temporarily change the ownership of the simulator_gazebo package.

sudo chown -R %YOUR_USER_NAME%: simulator_gazebo

Now you should be able to run:

rosmake simulator_gazebo

And it should re-compile your changes to the file!

Now, run:

 roslaunch gazebo_worlds empty_world.launch

and Enjoy!


Originally posted by fberger with karma: 11 on 2014-04-26

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.