Gazebo | Ignition | Community
Ask Your Question
0

Can't load plugin with roslaunch

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

kaldo gravatar image

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

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

edit retag flag offensive close merge delete

Comments

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 -0500 )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 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

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

kaldo gravatar image

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

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

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

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 3,155 times

Last updated: Jan 24 '17