ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to enable Gazebo gui/system plugin when using roslaunch and urdf?

asked 2020-09-13 17:26:33 -0500

Alt0216 gravatar image

I am running the turtlebot3 in gazebo environment using roslaunch. I want to use a custom gazebo gui plugin but on the gazebo tutorial it stated that gui plugin can't be referenced through a URDF file. Is there a way I can use the gui plugin?

Maybe I can try passing the argument -g <plugin.so> or -s <plugin.so> inside the launch file but I am not sure how to do that properly.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-09-15 05:32:20 -0500

Weasfas gravatar image

@Alt0216 For this to work you will need to copy the content of the empty_world.launch file from gazebo_ros package since you will need to ajust your extra args for the gazebo client.

In the line 51, the gazebo client is launched and it is where you need to add your extra arguments, so you can:

  <group if="$(arg gui)">
    <node name="gazebo_gui" pkg="gazebo_ros" type="gzclient" respawn="false" output="$(arg output)" args="$(arg command_arg3) --verbose -g yourlib.so"
    required="$(arg gui_required)"/>
  </group>

Furthermore, take into account that you can change this to be more clean like adding and extra launch param like:

<arg name="extra_gazebo_client_args" default="--verbose -g yourlib.so"/>

<group if="$(arg gui)">
 <node name="gazebo_gui" pkg="gazebo_ros" type="gzclient" respawn="false" output="$(arg output)" args="$(arg command_arg3) $(arg extra_gazebo_client_args)" required="$(arg gui_required)"/>
</group>

But this is depending on what you want. Also remember to add properly your plugin path to GAZEBO_PLUGIN_PATH enviroment variable.

Hope this solve your problem.

Regards.

edit flag offensive delete link more

Comments

adding extra args for the gazebo client on the launch file worked! This is very helpful, thanks.

Alt0216 gravatar image Alt0216  ( 2020-09-15 08:04:01 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-09-13 16:22:50 -0500

Seen: 1,028 times

Last updated: Sep 15 '20