Robotics StackExchange | Archived questions

Getting Intel Realsense d435 to work in Gazebo

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="http://ros.org/wiki/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"/>
  </xacro:sensor_d435>
</robot>

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

Asked by jakb2403 on 2021-07-07 10:55:43 UTC

Comments

Answers

https://github.com/pal-robotics/realsense_gazebo_plugin/issues/7

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

Asked by houhao on 2021-11-03 09:07:45 UTC

Comments

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

https://www.youtube.com/watch?v=hpUCG6K5muI

Asked by bhooshan_deshpande on 2022-01-28 16:47:51 UTC

Comments

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

Asked by jayess on 2022-01-30 15:46:27 UTC