Adding a Camera to RotorS - ethz-asl/rotors_simulator GitHub Wiki
Adding a Camera to RotorS
Camera Coordinate Frames
${camera}_link -> Camera body frame defined w.r.t parent
${camera}_optical_link -> Camera optical frame rpy="${-pi/2} 0 ${-pi/2}" w.r.t ${camera}_link.
Calibration files usually use the transformation between IMU and the _optical_link. Use a static tf publisher or the joint state publisher in Gazebo to get to know this transformation.
Using the Camera Macro
Defined in component_snippets.xacro
<!--Mount a Camera-->
<xacro:camera_macro
namespace="${namespace}"
parent_link="${namespace}/base_link"
camera_suffix="nadir"
frame_rate="20.0"
horizontal_fov="2"
image_width="752"
image_height="480"
image_format="L8"
min_distance="0.02"
max_distance="50"
noise_mean="0.0"
noise_stddev="0.007"
enable_visual="true">
<box size="0.05 0.05 0.02" />
<origin xyz="0 0 ${-arm_length/4}" rpy="0 ${pi/2} 0" />
</xacro:camera_macro>