[gazebo] Simulate Bebop1 camera (#2225)

* First attempt at bebop fisheye camera

* Try setting raw camera output size during initialization, does not work

SetImageSize() is ignored and SetEnvTextureSize() causes an
exception. Currently the camera output is too large for real-time
operation.

* FIX apply MT9F002_OUTPUT_SCALER to gazebo front camera

* Add MT9F002 camera cropping to fdm_gazebo

* Apply MT9F002_TARGET_FPS to bebop front cam in gazebo

* Set up bottom camera for bebop model

* Minor fixes and cleanup

* Fix MT9F002 partially applied to all cameras

* Remove sensors_params_bebop, introduce NPS_SIMULATE_MT9F002

Reduces duplicate code for sensor parameters, and follows the
same pattern as NPS_SIMULATE_LASER_RANGE_ARRAY.
Also does not require the sensor params to be changed in every
bebop airframe.
This commit is contained in:
Tom van Dijk
2018-02-04 18:03:41 +01:00
committed by Kirk Scheper
parent cfabb51eed
commit ff8c58a190
5 changed files with 73 additions and 16 deletions
@@ -5,6 +5,5 @@
<define name="ACTUATOR_THRUSTS" value="1.55, 1.55, 1.55, 1.55" type="float[]"/>
<define name="ACTUATOR_TORQUES" value="0.155, 0.155, 0.155, 0.155" type="float[]"/>
<define name="BYPASS_AHRS" value="1"/>
<define name="SIMULATE_VIDEO" value="1"/>
</section>
</airframe>
@@ -8,5 +8,6 @@
<define name="ACTUATOR_MAX_ANGULAR_MOMENTUM" value="0.19, 0.19, 0.19, 0.19" type="float[]"/>
<define name="GAZEBO_AC_NAME" value="bebop" type="string"/>
<define name="BYPASS_AHRS" value="1"/>
<define name="SIMULATE_MT9F002" value="1"/>
</section>
</airframe>
+15 -10
View File
@@ -176,7 +176,7 @@
<!-- CAMERAS -->
<link name="front_camera">
<pose>0.15 0 0 0 0 0</pose>
<pose>0.15 0 0 -1.57 0.33 0</pose><!-- Bebop camera output is rotated 90 degrees and pitched slightly downwards -->
<inertial>
<mass>0.001</mass>
<inertia>
@@ -188,17 +188,22 @@
<ixz>0</ixz>
</inertia>
</inertial>
<sensor type="camera" name="front_camera">
<update_rate>30.0</update_rate>
<sensor type="wideanglecamera" name="front_camera">
<update_rate>15.0</update_rate><!-- adjust with MT9F002_TARGET_FPS -->
<camera name="front_camera">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>1280</width>
<height>720</height>
<width>4608</width><!-- with MT9F002_OUTPUT_SCALER = 1.00, will be scaled by NPS -->
<height>3288</height>
<format>R8G8B8</format>
</image>
<horizontal_fov>3.69</horizontal_fov>
<lens>
<type>equisolid_angle</type>
<scale_to_hfov>true</scale_to_hfov>
<env_texture_size>2048</env_texture_size><!-- with MT9F002_OUTPUT_SCALER = 1.00, will be scaled by NPS -->
</lens>
<clip>
<near>0.02</near>
<near>0.01</near>
<far>300</far>
</clip>
<noise>
@@ -219,7 +224,7 @@
</joint>
<link name="bottom_camera">
<pose>0 0 -.03 0 1.57 0</pose>
<pose>0 0 0 0 1.57 0</pose>
<inertial>
<mass>0.001</mass>
<inertia>
@@ -234,9 +239,9 @@
<sensor type="camera" name="bottom_camera">
<update_rate>30.0</update_rate>
<camera name="bottom_camera">
<horizontal_fov>1.3962634</horizontal_fov>
<horizontal_fov>0.7175</horizontal_fov>
<image>
<width>320</width>
<width>240</width>
<height>240</height>
<format>R8G8B8</format>
</image>