ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
760 stars 772 forks source link

A ROS node for Gazebo has not been initialized, unable to load plugin. Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package) #1517

Open Burhanudin02 opened 10 months ago

Burhanudin02 commented 10 months ago

i was tried to run gazebo world using "gazebo --verbose /path/to/my/world" and the error "A ROS node for Gazebo has not been initialized, unable to load plugin. Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package" appear. I have installed the 'gazebo_ros_pkgs' in my catkin workspace and build it using 'catkin_make'. I also set the 'GAZEBO_PLUGIN_PATH' to '~/catkin_ws/devel/lib' which is where the .so files located. What should I do? Ask me if you need more information

ubuntu@MSI-GF63-Thin-10SC_ ~ 23_11_2023 07_06_34

Burhanudin02 commented 10 months ago

This error appear because ROS node for gazebo has not been initialized. Try to open your .world file using a launch file, for example you can see the empty_world.launch at '/gazebo_ros_pkgs/gazebo_ros/launch/'. For further use follow the format of the launch files at this example repo https://github.com/Intelligent-Quads/iq_sim and make some changes to refer my .world file. And if you have any issue with ardupilot sitl (in this case i following this tutorial https://github.com/Intelligent-Quads/iq_tutorials/blob/master/docs/installing_gazebo_arduplugin.md for ardupilot plugin instalation) you can do:

cd ~/ardupilot/Tools/autotest/ export PATH=$PATH:~/.local/bin ln -s $(pwd)/sim_vehicle.py ~/.local/bin/sim_vehicle cd ~/.local/bin chmod +x sim_vehicle

then you can call your sitl (in this case for drone simulation) sim_vehicle -v ArduCopter -f gazebo-iris --console