Intel Realsense D400 in Gazebo simulation
Im trying to use intel D400 with gazebo simulation on ROS Kinetic / Ubuntu 16.04. So far I have been using the OpenNI Kinect plugin (libgazebo_ros_openni_kinect.so).
I found there is a Realsense plugin for Gazebo (librealsense_gazebo_plugin.so). I am not sure how to replace the openni_kinect plugin with it in my URDF file, considering that the Realsense has two infrared cameras and an RGB camera.
I want to experiment with the Realsense in simulation before shifting to the real camera. I would like to work with depth images and point clouds for my application. First by using the depthimage_to_laserscan package and later the point clouds for obstacle avoidance. Thanks in advance.
Here is how I currently use the OpenNI Kinect plugin in URDF:
<link name="camera_link">
<visual>
<origin xyz="0.0 0.0 0.004" rpy="0 0 0"/>
<geometry>
<mesh filename="package://evarobotmodel_description/meshes/kinect.dae" scale="0.9 0.9 0.9"/>
</geometry>
</visual>
<collision>
<origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
<geometry>
<box size="0.0730 0.2760 0.0720"/>
</geometry>
</collision>
<inertial>
<mass value="0.170" />
<origin xyz="0 0 0" />
<inertia ixx="0.001152600" ixy="0.0" ixz="0.0"
iyy="0.000148934" iyz="0.0"
izz="0.001154654" />
</inertial>
</link>
<joint name="camera_rgb_joint" type="fixed">
<origin xyz="0.0 -0.02 0.0" rpy="0.0 0.0 0.0"/>
<parent link="camera_link"/>
<child link="camera_rgb_frame" />
</joint>
<gazebo reference="camera_link">
<material>Gazebo/FlatBlack</material>
</gazebo>
<link name="camera_rgb_frame"/>
<joint name="camera_rgb_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="-1.57079632679 0 -1.57079632679" />
<parent link="camera_rgb_frame" />
<child link="camera_rgb_optical_frame" />
</joint>
<link name="camera_rgb_optical_frame"/>
<joint name="camera_joint" type="fixed">
<origin xyz="0.17 0.0 0.1913" rpy="0.0 0.0 0.0"/>
<parent link="base_link"/>
<child link="camera_link"/>
</joint>
<joint name="camera_depth_joint" type="fixed">
<origin xyz="0 -0.045 0" rpy="0 0 0" />
<parent link="camera_link" />
<child link="camera_depth_frame" />
</joint>
<link name="camera_depth_frame"/>
<joint name="camera_depth_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="-1.57079632679 0 -1.57079632679" />
<parent link="camera_depth_frame" />
<child link="camera_depth_optical_frame" />
</joint>
<link name="camera_depth_optical_frame"/>
<!-- Asus mount -->
<joint name="mount_asus_xtion_pro_joint" type="fixed">
<origin xyz="0.1685 -0.0050 0.1563" rpy="1.57079632679 0 -1.57079632679"/>
<parent link="base_link"/>
<child link="mount_asus_xtion_pro_link"/>
</joint>
<link name="mount_asus_xtion_pro_link">
<!-- <visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<mesh filename="package://evarobotmodel_description/meshes/asus_base.dae"/>
</geometry>
<material name="Black"/>
</visual> -->
<collision>
<origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
<geometry>
<box size="0.2760 0.0330 0.0120"/>
</geometry>
</collision>
<inertial>
<mass value="0.170 ...
I cleaned your post, but I didn't understand everything. You should link the packages that you are using now, and where you are stuck with what you have tried. What about the second Google hit for "Realsense gazebo plugin"? Did you try it? Have you searched the questions on Gazebosim, like this one?
Thank you for the support , after many attempt I was able to make the simulation work with following the link :https://github.com/pal-robotics/realsense_gazebo_plugin/tree/kinetic-devel
after success I tested it with depthimage _to_laser but it didn't work "Could not convert depth image to laserscan: Cannot call rectifyPoint when distortion is unknown."
issue for the dpthimage_to_laser : https://github.com/SyrianSpock/realse...
for the problems I faced with realsense plugin I had to shift back to Kinect plugin.
if any solution please advice.
It would be great if you could post and accept what you wrote as an answer.