Gazebo | Ignition | Community
Ask Your Question

Can't load plugin with roslaunch

asked 2017-01-12 08:56:50 -0600

kaldo gravatar image

updated 2017-01-13 02:25:58 -0600

My world file (adapted from the tutorial) contains a plugin :

<model name="my_car">
    <plugin name="car_control" filename="car_plugin/build/">

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/

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/ car_plugin/build/ cannot open shared object file: No such file or directory

My files contain : package.xml (car_gazebo) :

<?xml version="1.0"?>

        <gazebo_ros gazebo_model_path="${prefix}/models"/>
        <gazebo_ros gazebo_plugin_path="${prefix}/plugins"/>

car.launch :

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find car_gazebo)/worlds/" />
    <arg name="verbose" value="true" />

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?


edit retag flag offensive close merge delete


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...

chapulina gravatar imagechapulina ( 2017-01-12 11:17:47 -0600 )edit

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.

kaldo gravatar imagekaldo ( 2017-01-12 12:08:45 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-01-24 01:14:40 -0600

kaldo gravatar image

As a workaround, I set the GAZEBO_PLUGIN_PATH directly in my launch file, adding an <env> tag at the beginning :

  <!-- Set up env variable so plugin are found -->
  <env name="GAZEBO_PLUGIN_PATH" value="$(find car_gazebo)/plugins"/>
edit flag offensive delete link more

answered 2018-06-15 14:09:25 -0600

The correct tag is actually plugin_path, not gazebo_plugin_path (this seems inconsistent and should probably be changed). Try this instead:

<gazebo_ros plugin_path="${prefix}/plugins"/>
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-01-12 08:56:50 -0600

Seen: 3,301 times

Last updated: Jan 24 '17