Ask Your Question

Getting Intel Realsense d435 to work in Gazebo

asked 2021-07-07 10:55:43 -0500

jakb2403 gravatar image

updated 2021-11-14 09:36:20 -0500

lucasw gravatar image

Hi, I'm new to ROS and I wanted to incorporate the d435 camera into my SLAM project. At the moment I'm trying to get the camera to show up in Gazebo and show the pointcloud in Rviz. I found this tutorial on Youtube and followed all the steps outlined. They are making use of the ros-realsense/realsense2_description package from here and the realsense_gazebo_plugin from here. He uses a _d435.gazebo.xacro file which I found here.

I got most of the way there, I can catkin_make my packages fine, but cannot launch the Gazebo and Rviz windows to visualise the camera. When I type $ roslaunch realsense2_description view_d435_model_rviz_gazebo.launch I get the following error message:

Invalid parameter "publish_pointcloud"
when instantiating macro: sensor_d435 (/home/john/catkin_ws/src/realsense-ros/realsense2_description/urdf/_d435.urdf.xacro)
in file: /home/john/catkin_ws/src/realsense-ros/realsense2_description/urdf/test_d435_camera.urdf.xacro
RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '/home/john/catkin_ws/src/realsense-ros/realsense2_description/urdf/test_d435_camera.urdf.xacro', 'use_nominal_extrinsics:=true', 'add_plug:=true']] returned with code [2]. 

Param xml is <param name="robot_description" command="$(find xacro)/xacro $(arg model) use_nominal_extrinsics:=true add_plug:=true"/>
The traceback for the exception was written to the log file

Here is my test_d435_camera.urdf.xacro file:

<?xml version="1.0"?>
<robot name="realsense2_camera" xmlns:xacro="">
  <xacro:include filename="$(find realsense2_description)/urdf/_d435.urdf.xacro" />

  <link name="base_link" />
  <xacro:sensor_d435 name="camera" topics_ns="camera" parent="base_link" publish_pointcloud="true">
    <origin xyz="0 0 0" rpy="0 0 0"/>

Is the error here in line 5 where I have publish_pointcloud="true"?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2022-01-28 15:47:51 -0500

bhooshan_deshpande gravatar image

Hi, please refer to this video and change files accordingly. I resolved my issue easily.

edit flag offensive delete link more



Can you please update your answer with the relevant information from the video? External links can and often do go down

jayess gravatar image jayess  ( 2022-01-30 14:46:27 -0500 )edit

answered 2021-11-03 09:07:45 -0500

houhao gravatar image

You might find the solution over there. And double check you have catkin make the gazebo plugin package.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-07-07 10:55:43 -0500

Seen: 1,251 times

Last updated: Jan 28