Rosanswers logo

Hello, I am new to ROS and trying to replace the Kinect gazebo plugin with a RealSense plugin. The plugin I want to use is this one:


However, there are no documentation of how to use the plugin. Are anyone familiar with this plugin, or similar plugins?

So far I have cloned the repository to my /catkin_ws/src and catkin_make, which successfully created the


I would appreciate some guidance on how to correctly configure this plugin.

I have uploaded all my files to github:


When i load the model, only my robot shows up, not the camera, and no topics are published.

I think it may have something to do with a catkin_make error, because I get the following output whenever i catkin_make:

[  0%] Built target tf2_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target rosgraph_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target rosgraph_msgs_generate_messages_cpp
[  0%] Built target roscpp_generate_messages_py
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target trajectory_msgs_generate_messages_nodejs
[  0%] Built target trajectory_msgs_generate_messages_cpp
[  0%] Built target gazebo_msgs_generate_messages_nodejs
[  0%] Built target trajectory_msgs_generate_messages_eus
[  0%] Built target trajectory_msgs_generate_messages_lisp
[  0%] Built target trajectory_msgs_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_eus
[  0%] Built target gazebo_msgs_generate_messages_cpp
[  0%] Built target gazebo_msgs_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_lisp
[  0%] Built target dynamic_reconfigure_generate_messages_py
[  0%] Built target dynamic_reconfigure_generate_messages_nodejs
[  0%] Built target dynamic_reconfigure_generate_messages_eus
[  0%] Built target dynamic_reconfigure_generate_messages_lisp
[  0%] Built target dynamic_reconfigure_gencfg
[  0%] Built target dynamic_reconfigure_generate_messages_cpp
[  0%] Built target tf_generate_messages_cpp
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target tf_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_py
[  0%] Built target tf2_msgs_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_lisp
[  0%] Built target tf_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_cpp
[  0%] Built target actionlib_msgs_generate_messages_nodejs
[  0%] Built target actionlib_generate_messages_eus
[  0%] Built target gazebo_ros_gencfg
[  0%] Built target tf_generate_messages_eus
[  0%] Built target sensor_msgs_generate_messages_py
[  0%] Built target actionlib_msgs_generate_messages_cpp
[  0%] Built target sensor_msgs_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_cpp
[  0%] Built target geometry_msgs_generate_messages_py
[  0%] Built target std_srvs_generate_messages_eus
[  0%] Built target sensor_msgs_generate_messages_nodejs
[  0%] Built target std_srvs_generate_messages_nodejs
[  0%] Built target actionlib_generate_messages_nodejs
[  0%] Built target actionlib_generate_messages_py
[  0%] Built target tf_generate_messages_py
[  0%] Built target actionlib_msgs_generate_messages_eus
[  0%] Built target actionlib_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_lisp
[  0%] Built target actionlib_msgs_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_cpp
[  0%] Built target actionlib_msgs_generate_messages_py
[  0%] Built target tf2_msgs_generate_messages_py
[100%] Built target realsense_gazebo_plugin

Thank you in advance!

Originally posted by didrif14 on ROS Answers with karma: 21 on 2020-04-03

Post score: 2

Original comments

Comment by rabbittt on 2020-04-05:
Hi all! I have a question, please help me. I'm new to using Gazebo and need the Intel Realsense Depth Camera(D-Series) plugins too, i'm working on ROS Kinetic and Gazebo version 7. So can I get any Intel Realsense plugin on my system? Thank you all guys!


3 Answers 3


Rosanswers logo

Not sure if this helps, but it looks like the full list of realsense_gazebo_plugin configurable parameters are listed in this file: https://github.com/pal-robotics/realsense_gazebo_plugin/blob/melodic-devel/src/RealSensePlugin.cpp

<depthUpdateRate> (numeric)
<colorUpdateRate> (numeric)
<infraredUpdateRate> (numeric)
<rangeMinDepth> (numeric)
<rangeMaxDepth> (numeric)
<depthTopicName> (string)
<depthCameraInfoTopicName> (string)
<colorTopicName> (string)
<colorCameraInfoTopicName> (string)
<infrared1TopicName> (string)
<infrared1CameraInfoTopicName> (string)
<infrared2TopicName> (string)
<infrared2CameraInfoTopicName> (string)
<colorOpticalframeName> (string)
<depthOpticalframeName> (string)
<infrared1OpticalframeName> (string)
<infrared2OpticalframeName> (string)
<pointCloud> (boolean)
<pointCloudTopicName> (string)
<pointCloudCutoff> (numeric)
<pointCloudCutoffMax> (numeric)
<prefix> (string)
<robotNamespace> (string)

Might have been a good idea for the author to include the full list of configurables along with data types and example usages and default values in the README file.

Originally posted by Kurt Leucht with karma: 486 on 2020-04-03

This answer was NOT ACCEPTED on the original site

Post score: 1

Original comments

Comment by didrif14 on 2020-04-03:
Thank you for the response. Yes, I tried to include those as parameters, but nothing really happened. I did however find the original repository, which this plugin is built upon, and I copied the plugin parameters from that. At this point I get a message saying:

Realsense Gazebo ROS plugin loading.
RealSensePlugin: The realsense_camera plugin is attach to model megatrond

But it also says comes with an error stating:

[gazebo-3] process has died [pid 27784, exit code 139, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/megatrond/.ros/log/79dee886-75e5-11ea-91ce-049226d415d8/gazebo-3.log].
log file: /home/megatrond/.ros/log/79dee886-75e5-11ea-91ce-049226d415d8/gazebo-3*.log [controller_spawner-7] process has died [pid 27801, exit code 1, cmd /opt/ros/melodic/lib/controller_manager/spawner joint_state_controller vel_ctrl_frw vel_ctrl_flw vel_ctrl_rrw vel_ctrl_rlw --timeout 60

Which dosn't show when I remove the plugin

Comment by Kurt Leucht on 2020-04-03:
So just for fun, I cloned and built the original plugin for the RS200 camera. It built fine but seemed to not do anything when I dragged the realsense camera model into my Gazebo. Gazebo showed the visual for it, but no topics were ever published from it. When I tried to drag in a coke_can model afterwards, it never showed up. So I'm not sure the original plugin really works properly. It might be spinning and tying up the CPU or something.

Comment by Kurt Leucht on 2020-04-03:
I'm stuck on ROS kinetic and Gazebo 7.0, so that could be why it doesn't work for me.

Comment by didrif14 on 2020-04-05:
That's interesting. I have however encountered people who have gotten this plugin to work, so it may just be what you suggested concerning your system specifications. Anyways, thank you for giving it a shot!

Comment by rickstaa on 2020-12-01:
For future reference here is an example of how to use this plugin might people need it. A detailed explanation video created by @issaiass can be found here.


Rosanswers logo

Hey i found out. First download this package from https://github.com/pal-robotics/realsense_gazebo_plugin and put it into your catkinws src folder and then compile the catkin package.

This will generate a shared library called librealsense_gazebo_plugin.so for you which is used in the files you gonna download in the next steps. you need to download the two xacro files https://github.com/pal-robotics-forks/realsense/tree/upstream/realsense2_description/urdf _d435.gazebo.xacro and _d435.urdf.xacro put those two files in the package inside the urdf folder where you want your realsense to be simulated then in the file _d435.urdf.xacro change the line 13 from

<xacro:include filename="$(find realsense2_description)/urdf/_d435.gazebo.xacro "/>

to packagename with being the name of the package

<xacro:include filename="$(find packagename)/urdf/_d435.gazebo.xacro "/>

Then in the urdf file where you want to use the simulated realsense add the following code, while again replacing packagename with the name of the package you are using. and baselink which the link where you want the realsense camera to be joint on.

<xacro:include filename="$(find packagename)/urdf/_d435.urdf.xacro" />
<sensor_d435 parent="${prefix}base_link">

Afterwards when you launch file which uses this urdf model you will find the simulate realsense and you should see rostopics like /camera/color/image_ra

Originally posted by arminkazim with karma: 103 on 2020-04-04

This answer was NOT ACCEPTED on the original site

Post score: 2

Original comments

Comment by didrif14 on 2020-04-05:
Thank you, I really appreciate your effort! This seems to be a good approach. When I tried. my robot was spawned, however the camera was not visible in gazebo and the topics were not published. I created a virtual link where I want the D435 to be attached and parsed this into the sensor macro. I must be doing something wrong. I have uploaded all my files here: https://github.com/didrif14/megatrond Any chance you could take a quick look to see if I have messed up?

Comment by arminkazim on 2020-04-14:
have you checked that the .so file got compiled. You should find it in your catkin workspace in the devel folder inside the lib folder its name would be librealsense_gazebo_plugin.so also in line 13 add the following inside the </sensor_d435> maybe that helps

Comment by didrif14 on 2020-04-15:
Yes, the .so file is created. I think the problem is related to a catkin make error, alot of the messages stop at 0% build. This does not happen if I remove the realsense_gazebo_plugin package.

I have updated the post with the build output. Have you encountered this before?

What ROS and gazebo version are you using?

Comment by arminkazim on 2020-04-15:
i am using ros melodic and gazebo version 9. Then i tried out your repository. For me with your files the camera never showed and so no rostopics would become available, i nailed your problem down to <xacro:include filename="$(find megatrond_description)/urdf/_D435.urdf.xacro"> going somehow wrong. Then i replaced your two files _D435.urdf.xacro and _D435.gazebo.xacro with the original ones and only change the line 11 in https://github.com/pal-robotics-forks/realsense/blob/upstream/realsense2_description/urdf/_d435.gazebo.xacro and line 60 to and it worked. So i guess there is something wrong with those two files of you.

Comment by AndreSpa on 2020-05-01:
Hello. I have the same problem. Practically including the camera description, the gazebo simulation comes up correctly but the camera never spawn and so the topics are never available. If someone have solved this problem, i would appreciate any halp. Thanks!

Comment by khaled gabr on 2020-09-01:
i'm using same camera RealSense D435 the camera visible in gazebo and the topics were not published. if you solve problem let me know.


Rosanswers logo

I ported it using the realsense2_description from the intel repo and the realsense_gazebo_plugin package from pal robotics repo

check in my github:


Originally posted by issaiass with karma: 31 on 2020-11-03

This answer was NOT ACCEPTED on the original site

Post score: 3

Original comments

Comment by gribgrob_k on 2022-08-24:
Hi -- thanks for making this resource available! I'm having some problems after building, sourcing, and running as described in the readme. RViz shows 'no transform from [] to [base_link]' for all of the transforms, and as a result none of the sensing elements are visualized. Any tips? Thanks

EDIT: issue resolved -- I needed the ROS package 'robot_state_publisher'


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.