My world file (adapted from the tutorial) contains a plugin :
<model name="my_car">
<include>
<uri>model://car</uri>
</include>
<plugin name="car_control" filename="car_plugin/build/libcar_plugin.so">
<velocity>2</velocity>
</plugin>
</model>
What works
The plugin loads and displays the expected message when I do this :
$ export GAZEBO_MODEL_PATH="$CATKIN_WS/src/tas_group_2/car_gazebo/models"
$ export GAZEBO_PLUGIN_PATH="$CATKIN_WS/src/tas_group_2/car_gazebo/plugins"
$ gazebo worlds/car.world
What doesn't
However I can't get it to launch through roslaunch with :
$ roslaunch car_gazebo car.launch
and I get te following error :
[Err] [Plugin.hh:165] Failed to load plugin car_plugin/build/libcar_plugin.so: car_plugin/build/libcar_plugin.so: cannot open shared object file: No such file or directory
My files contain : package.xml (car_gazebo) :
<?xml version="1.0"?>
<package>
<name>car_gazebo</name>
...
<run_depend>gazebo_ros</run_depend>
<build_depend>gazebo_ros</build_depend>
<buildtool_depend>catkin</buildtool_depend>
<export>
<gazebo_ros gazebo_model_path="${prefix}/models"/>
<gazebo_ros gazebo_plugin_path="${prefix}/plugins"/>
</export>
</package>
car.launch :
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find car_gazebo)/worlds/car.world" />
<arg name="verbose" value="true" />
</include>
</launch>
My question
I thought the two methods where equivalent. Because I specified the environment variables in the <export>
tag.
<gazebo_ros gazebo_model_path="${prefix}/models"/>
allowed gazebo to find my model, while <gazebo_ros gazebo_plugin_path="${prefix}/plugins"/>
doesn't help find my plugin. How come?
Any idea how to get the plugin to work with the roslaunch command?
Cheers
Originally posted by kaldo on Gazebo Answers with karma: 13 on 2017-01-12
Post score: 0
Original comments
Comment by chapulina on 2017-01-12:
When you say Gazebo displays no error, do you mean you're running it with the --verbose
flag and no error messages come up? If the plugin is not loaded, you should get an error...
Comment by kaldo on 2017-01-12:
Thanks for the input! I have modified the launch file to run in verbose mode, and an error came up! I have edited the question.