How to set GAZEBO_PLUGIN_PATH correctly and add the plugin into Gazebo_ros ?
Hi, I am using gazebo to simulate a sonar. Thus I will use hector_sonar_plugin
. While after I install the hector plugins from source and call it in my sdf, errors come.
At first, an error appear asking me to add libhector_sonar_plugin.so
to gazebo_ros package
.
I cannot understand it and thought it cannot find the plugin. Thus,I use
export GAZEBO_PLUGIN_PATH=`pwd`:$GAZEBO_PLUGIN_PATH
to add hector_plugin
folder into path, then more error come:
Error [Plugin.hh:156] Failed to load plugin libRayPlugin.so: libRayPlugin.so: cannot open shared object file: No such file or directory
[FATAL] [1464103865.820981859]: 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)
Could someone tell me how to set the GAZEBO_PLUGIN_PATH
correctly (or reset it correctly)? And if I want to use plug-Ins such as hector's, what should I do? (just copy .so to the model folder or ...?)
I am using Indigo full desktop, and thus version should be gazebo2
Thank you.
Can you show line of SDF file, where you include plugin ? Frequent problem is a relative path to the plugin.
Can you check out the current GAZEBO_PLUGIN_PATH? Run $echo $GAZEBO_PLUGIN_PATH to see whether the path is right.
I just use <plugin name="gazebo_ros_sonar_data" filename="libhector_gazebo_ros_sonar.so"> <gaussiannoise>0.005</gaussiannoise> <topicname>radiofence</topicname> <frameid>radiofence1</frameid> </plugin> </sensor> to call the plugin in my sensor sdf file.
After echo GAZEBO_PLUGIN_PATH in Terminal, I just get the result GAZEBO_PLUGIN_PATH
I have zero string result of echo $GAZEBO_PLUGIN_PATH, but I'm use ABSOLUTE path to the plugin *.so file and all work fine.
Could you tell me how to use the ABSOLUTE path? do changes in URDF file ?