Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You must call ros::init() before creating the first NodeHandle

Hi all,

I got some strange and annoying problems after installing Gazebo 1.9 from source to be able to compile the gazebo_ros_pkgs.

I followed the installation instructions as shown in Installing_gazebo_ros_Packages and Compiling_From_Source. At this time the link pointing to the compiling_from_source of version 1.6. wasn't crossed out.

After the installation I was able to compile the gazebo_ros_pkgs in my catkin folder. But I got problems starting my models in Gazebo due to some ROS problems, saying something like:

"Not loading plugin since ROS hasn't been properly initialized".

I wasn't able to fix that. But because I achieved to compile the plugin package I went back to Gazebo 1.8.6 and ROS 1.9.45. Therefore I completely uninstalled all the old Gazebo and ROS versions.

What happens now is - when I try to start my models in Gazebo, using some self made plugins, I got the following error message:

file = /tmp/buildd/ros-groovy-roscpp-1.9.44-0precise-20130325-1240/src/libros/node_handle.cpp
line=151

I got two plugins and both of them worked fine before I made the previously mentioned changes.

The strange thing is, this error message appears only with one of the plugins. And they both initialize ros in the same way.

    public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
    {
        // Start up ROS
        std::string name = "scitos_gazebo_platform_control";
        int argc = 0;
        ros::init(argc, NULL, name);


        // ROS Nodehandle
        this->my_rosnode = new ros::NodeHandle("~");
                    ...

When I try to comment the rosnode or to get an message to the console by only using std::cout the error message stay the same.

Thank you for your help.

Christoph

You must call ros::init() before creating the first NodeHandle

Hi all,

I got some strange and annoying problems after installing Gazebo 1.9 from source to be able to compile the gazebo_ros_pkgs.

I followed the installation instructions as shown in Installing_gazebo_ros_Packages and Compiling_From_Source. At this time the link pointing to the compiling_from_source of version 1.6. wasn't crossed out.

After the installation I was able to compile the gazebo_ros_pkgs in my catkin folder. But I got problems starting my models in Gazebo due to some ROS problems, saying something like:

"Not loading plugin since ROS hasn't been properly initialized".

I wasn't able to fix that. But because I achieved to compile the plugin package I went back to Gazebo 1.8.6 and ROS 1.9.45. Therefore I completely uninstalled all the old Gazebo and ROS versions.

What happens now is - when I try to start my models in Gazebo, using some self made plugins, I got the following error message:

file = /tmp/buildd/ros-groovy-roscpp-1.9.44-0precise-20130325-1240/src/libros/node_handle.cpp
line=151

I got two plugins and both of them worked fine before I made the previously mentioned changes.

The strange thing is, this error message appears only with one of the plugins. And they both initialize ros in the same way.

    public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
    {
        // Start up ROS
        std::string name = "scitos_gazebo_platform_control";
        int argc = 0;
        ros::init(argc, NULL, name);


        // ROS Nodehandle
        this->my_rosnode = new ros::NodeHandle("~");
                    ...

When I try to comment the rosnode or to get an message to the console by only using std::cout the error message stay the same.

Thank you for your help.

Christoph