What do you mean by "I added the camera model". Do you mean you cloned and build it?
You will need to include the URDF in your hector drone and then call the macro in your hector drone urdf somewhere.
You can see an example of how it's done here.
Mind you, I'm going through the urdf from the macro and I'm not seeing the actual Gazebo parts. So I'm not sure that realsense_ros
actually has a simulation component.
EDIT based on your comment:
Ah, I see, I was looking at the default branch. In that case, if you look at the d435 urdf, you will see that it calls the Gazebo plugin file that you linked. In other words, you need to call _d435.urdf.xacro
and it will call _d435.gazebo.xacro
for you.
Which is also what that launch file you linked does. The line that calls the model. And if you check the model you will see that it calls sensor_d435, not gazebo_d435
.
EDIT 2:
So I took a look at that sensor_d435 macro and I noticed something.
All the links that you're missing (everything after camera_link
) is due to a (honestly kinda weird) setting. The parameter use_nominal_extrinsics
. There is an if statement that doesn't include the camera_depth_optical_frame
and all the others if set to false.
Guess what the default value is set to? False.
So you need to change your macro to:
<xacro:sensor_d435 name="camera" parent="base_link" use_nominal_extrinsics="true">
<origin xyz="0.1 0.0 -0.03" rpy="0 0 0"/>
</xacro:sensor_d435>
The weird thing is, they set it to true themselves in the launch file, so why they set it to false by default (or why it even exists to be honest) I do not understand.