ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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!