mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-02-05 18:51:00 +08:00
Restructure bebop camera settings and ISP (#2364)
This commit is contained in:
committed by
Gautier Hattenberger
parent
638f513701
commit
6d36c581cb
@@ -31,7 +31,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_colorfilter">
|
||||
<define name="COLORFILTER_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_blob_locator">
|
||||
<define name="BLOB_LOCATOR_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_blob_locator">
|
||||
<define name="BLOB_LOCATOR_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_rtp_stream">
|
||||
<define name="VIEWVIDEO_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_blob_locator">
|
||||
<define name="BLOB_LOCATOR_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<!--module name="video_thread">
|
||||
<!--module name="bebop_cam">
|
||||
<define name="VIDEO_THREAD_FPS" value="4"/>
|
||||
<define name="VIDEO_THREAD_CAMERA" value="bottom_camera"/>
|
||||
<define name="VIDEO_THREAD_SHOT_PATH" value="/data/ftp/internal_000/images"/>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_blob_locator">
|
||||
<define name="BLOB_LOCATOR_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -75,19 +75,11 @@
|
||||
<!--<configure name="FLASH_MODE" value="USB"/>--><!-- TODO: WIFI or USB-->
|
||||
<!-- WIP: Front Camera parameters -->
|
||||
<define name="H264_ROTATE" value="TRUE"/>
|
||||
<define name="MT9F002_INITIAL_OFFSET_X" value="416+2704-480"/> <!-- 480 / 960 / 1920 / 3840 (horion for theta = 0 -> 2704) -->
|
||||
<define name="MT9F002_INITIAL_OFFSET_Y" value="1680-1040"/> <!-- 420 / 840 / 1680 / 3360 -->
|
||||
<define name="MT9F002_SENSOR_WIDTH" value="2*480"/> <!-- 480 / 960 / 1920 / 3840 -->
|
||||
<define name="MT9F002_SENSOR_HEIGHT" value="2*1040"/> <!-- 420 / 840 / 1680 / 3360 -->
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="240"/> <!-- 480 / 960 / 1920 / 3840 -->
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="520"/> <!-- 420 / 840 / 1680 / 3360 -->
|
||||
<define name="MT9F002_TARGET_FPS" value="30"/>
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="4"/>
|
||||
<define name="MT9F002_GAIN_GREEN1" value="8.0"/>
|
||||
<define name="MT9F002_GAIN_GREEN2" value="8.0"/>
|
||||
<define name="MT9F002_GAIN_RED" value="8.0"/>
|
||||
<define name="MT9F002_GAIN_BLUE" value="8.0"/>
|
||||
<define name="MT9F002_OUTPUT_SCALER" value="0.25"/>
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="520" />
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="240" />
|
||||
<define name="MT9F002_OFFSET_X" value="0.072" />
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="4" />
|
||||
<define name="MT9F002_ZOOM" value="1.25"/>
|
||||
|
||||
<!-- <configure name="CPU_LED" value="1"/>--> <!-- Change to whatever you like -->
|
||||
|
||||
@@ -327,7 +319,7 @@
|
||||
|
||||
<module name="photogrammetry_calculator"/>
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_capture">
|
||||
<define name="VIDEO_CAPTURE_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -10,17 +10,6 @@
|
||||
<module name="udp"/>
|
||||
</target>
|
||||
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="640" />
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="640" />
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="30" />
|
||||
<define name="MT9F002_GAIN_GREEN1" value="4"/>
|
||||
<define name="MT9F002_GAIN_GREEN2" value="4"/>
|
||||
<define name="MT9F002_GAIN_RED" value="5"/>
|
||||
<define name="MT9F002_GAIN_BLUE" value="5"/>
|
||||
<define name="MT9F002_OUTPUT_SCALER" value="0.25"/>
|
||||
<define name="MT9F002_X_ODD_INC_VAL" value="1"/>
|
||||
<define name="MT9F002_Y_ODD_INC_VAL" value="1"/>
|
||||
|
||||
<define name="USE_SONAR" value="true"/>
|
||||
|
||||
<!-- Subsystem section -->
|
||||
@@ -41,7 +30,7 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_rtp_stream">
|
||||
<define name="VIEWVIDEO_CAMERA" value="bottom_camera"/>
|
||||
@@ -80,6 +69,14 @@
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="BEBOP_FRONT_CAMERA" prefix="MT9F002_">
|
||||
<define name="OUTPUT_HEIGHT" value="640" />
|
||||
<define name="OUTPUT_WIDTH" value="640" />
|
||||
<define name="OFFSET_X" value="0.15" />
|
||||
<define name="TARGET_EXPOSURE" value="30" />
|
||||
<define name="ZOOM" value="1.25"/>
|
||||
</section>
|
||||
|
||||
<section name="AIR_DATA" prefix="AIR_DATA_">
|
||||
<define name="CALC_AIRSPEED" value="FALSE"/>
|
||||
<define name="CALC_TAS_FACTOR" value="FALSE"/>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<!-- <define name="INS_INT_GPS_ID" value="ABI_DISABLE"/>
|
||||
</module> -->
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_opticflow">
|
||||
<define name="OPTICFLOW_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -27,19 +27,6 @@
|
||||
<define name="USE_SONAR" value="TRUE"/>
|
||||
<module name="ins" type="extended"/>
|
||||
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="640" />
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="640" />
|
||||
<define name="MT9F002_INITIAL_OFFSET_X" value="0.15" />
|
||||
<define name="MT9F002_INITIAL_OFFSET_Y" value="0.0" />
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="30" />
|
||||
<define name="MT9F002_GAIN_GREEN1" value="4"/>
|
||||
<define name="MT9F002_GAIN_GREEN2" value="4"/>
|
||||
<define name="MT9F002_GAIN_RED" value="5"/>
|
||||
<define name="MT9F002_GAIN_BLUE" value="5"/>
|
||||
<define name="MT9F002_OUTPUT_SCALER" value="0.25"/>
|
||||
<define name="MT9F002_X_ODD_INC_VAL" value="1"/>
|
||||
<define name="MT9F002_Y_ODD_INC_VAL" value="1"/>
|
||||
|
||||
<module name="geo_mag"/>
|
||||
<module name="air_data"/>
|
||||
<module name="send_imu_mag_current"/>
|
||||
@@ -47,7 +34,7 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module>
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_capture">
|
||||
<define name="VIDEO_CAPTURE_CAMERA" value="front_camera"/>
|
||||
@@ -61,23 +48,22 @@
|
||||
<!-- For tuning the color filter: -->
|
||||
<!--
|
||||
<module name="cv_colorfilter">
|
||||
<define name="COLORFILTER_CAMERA" value="front_camera"/>
|
||||
<define name="COLORFILTER_FPS" value="0"/>
|
||||
<define name="COLORFILTER_CAMERA" value="front_camera"/>
|
||||
<define name="COLORFILTER_FPS" value="0"/>
|
||||
</module>
|
||||
-->
|
||||
|
||||
<module name="ctrl_module_outerloop_demo"/>
|
||||
|
||||
<module name="cv_detect_gate">
|
||||
<define name="DETECT_GATE_CAMERA" value="front_camera"/>
|
||||
<define name="DETECT_GATE_FPS" value="0"/>
|
||||
<define name="DETECT_GATE_Y_MIN" value="31"/>
|
||||
<define name="DETECT_GATE_Y_MAX" value="130"/>
|
||||
<define name="DETECT_GATE_U_MIN" value="62"/>
|
||||
<define name="DETECT_GATE_U_MAX" value="138"/>
|
||||
<define name="DETECT_GATE_V_MIN" value="148"/>
|
||||
<define name="DETECT_GATE_V_MAX" value="221"/>
|
||||
|
||||
<define name="DETECT_GATE_CAMERA" value="front_camera"/>
|
||||
<define name="DETECT_GATE_FPS" value="0"/>
|
||||
<define name="DETECT_GATE_Y_MIN" value="31"/>
|
||||
<define name="DETECT_GATE_Y_MAX" value="130"/>
|
||||
<define name="DETECT_GATE_U_MIN" value="62"/>
|
||||
<define name="DETECT_GATE_U_MAX" value="138"/>
|
||||
<define name="DETECT_GATE_V_MIN" value="148"/>
|
||||
<define name="DETECT_GATE_V_MAX" value="221"/>
|
||||
</module>
|
||||
|
||||
<module name="video_rtp_stream">
|
||||
@@ -120,6 +106,14 @@
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="BEBOP_FRONT_CAMERA" prefix="MT9F002_">
|
||||
<define name="OUTPUT_HEIGHT" value="640" />
|
||||
<define name="OUTPUT_WIDTH" value="640" />
|
||||
<define name="OFFSET_X" value="0.15" />
|
||||
<define name="TARGET_EXPOSURE" value="30" />
|
||||
<define name="ZOOM" value="1.25"/>
|
||||
</section>
|
||||
|
||||
<section name="AIR_DATA" prefix="AIR_DATA_">
|
||||
<define name="CALC_AIRSPEED" value="FALSE"/>
|
||||
<define name="CALC_TAS_FACTOR" value="FALSE"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module>
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
<module name="pose_history"/>
|
||||
|
||||
<module name="cv_opticflow">
|
||||
|
||||
@@ -19,28 +19,13 @@
|
||||
<define name="USE_SONAR" value="0"/>
|
||||
<module name="ins" type="extended"/>
|
||||
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="640" />
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="640" />
|
||||
<define name="MT9F002_INITIAL_OFFSET_X" value="0.15" />
|
||||
<define name="MT9F002_INITIAL_OFFSET_Y" value="0.0" />
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="30" />
|
||||
<define name="MT9F002_GAIN_GREEN1" value="4"/>
|
||||
<define name="MT9F002_GAIN_GREEN2" value="4"/>
|
||||
<define name="MT9F002_GAIN_RED" value="5"/>
|
||||
<define name="MT9F002_GAIN_BLUE" value="5"/>
|
||||
<define name="MT9F002_OUTPUT_SCALER" value="0.25"/>
|
||||
<define name="MT9F002_X_ODD_INC_VAL" value="1"/>
|
||||
<define name="MT9F002_Y_ODD_INC_VAL" value="1"/>
|
||||
|
||||
|
||||
<module name="geo_mag"/>
|
||||
<module name="air_data"/>
|
||||
<module name="send_imu_mag_current"/>
|
||||
<module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module>
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_capture">
|
||||
<define name="VIDEO_CAPTURE_CAMERA" value="front_camera"/>
|
||||
@@ -54,6 +39,7 @@
|
||||
<!-- <define name="INS_INT_VEL_ID" value="ABI_DISABLE"/> -->
|
||||
<module name="cv_opticflow">
|
||||
<define name="OPTICFLOW_CAMERA" value="front_camera"/>
|
||||
<define name="OPTICFLOW_FPS" value="10"/>
|
||||
<define name="MAX_HORIZON" value="10"/>
|
||||
<define name="OPTICFLOW_DEROTATION" value="1"/>
|
||||
<define name="OPTICFLOW_DEROTATION_CORRECTION_FACTOR_X" value="0.8"/> <!--Obtained from a linefit-->
|
||||
@@ -66,7 +52,6 @@
|
||||
<module name="optical_flow_landing">
|
||||
<define name="OFL_PGAIN" value="0.05"/>
|
||||
<define name="OFL_IGAIN" value="0.0"/>
|
||||
|
||||
</module>
|
||||
|
||||
<module name="video_rtp_stream">
|
||||
@@ -109,6 +94,14 @@
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="BEBOP_FRONT_CAMERA" prefix="MT9F002_">
|
||||
<define name="OUTPUT_HEIGHT" value="640"/>
|
||||
<define name="OUTPUT_WIDTH" value="640"/>
|
||||
<define name="OFFSET_X" value="0.15"/>
|
||||
<define name="TARGET_EXPOSURE" value="30"/>
|
||||
<define name="ZOOM" value="1.25"/>
|
||||
</section>
|
||||
|
||||
<section name="AIR_DATA" prefix="AIR_DATA_">
|
||||
<define name="CALC_AIRSPEED" value="FALSE"/>
|
||||
<define name="CALC_TAS_FACTOR" value="FALSE"/>
|
||||
|
||||
@@ -19,20 +19,6 @@
|
||||
<define name="USE_SONAR" value="0"/>
|
||||
<module name="ins" type="extended"/>
|
||||
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="640" />
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="640" />
|
||||
<define name="MT9F002_INITIAL_OFFSET_X" value="0.15" />
|
||||
<define name="MT9F002_INITIAL_OFFSET_Y" value="0.0" />
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="30" />
|
||||
<define name="MT9F002_GAIN_GREEN1" value="4"/>
|
||||
<define name="MT9F002_GAIN_GREEN2" value="4"/>
|
||||
<define name="MT9F002_GAIN_RED" value="5"/>
|
||||
<define name="MT9F002_GAIN_BLUE" value="5"/>
|
||||
<define name="MT9F002_OUTPUT_SCALER" value="0.25"/>
|
||||
<define name="MT9F002_X_ODD_INC_VAL" value="1"/>
|
||||
<define name="MT9F002_Y_ODD_INC_VAL" value="1"/>
|
||||
|
||||
|
||||
<module name="geo_mag"/>
|
||||
<module name="air_data"/>
|
||||
<module name="send_imu_mag_current"/>
|
||||
@@ -40,7 +26,7 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module>
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_capture">
|
||||
<define name="VIDEO_CAPTURE_CAMERA" value="front_camera"/>
|
||||
@@ -97,6 +83,14 @@
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="BEBOP_FRONT_CAMERA" prefix="MT9F002_">
|
||||
<define name="OUTPUT_HEIGHT" value="640" />
|
||||
<define name="OUTPUT_WIDTH" value="640" />
|
||||
<define name="OFFSET_X" value="0.15" />
|
||||
<define name="TARGET_EXPOSURE" value="30" />
|
||||
<define name="ZOOM" value="1.25"/>
|
||||
</section>
|
||||
|
||||
<section name="AIR_DATA" prefix="AIR_DATA_">
|
||||
<define name="CALC_AIRSPEED" value="FALSE"/>
|
||||
<define name="CALC_TAS_FACTOR" value="FALSE"/>
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
<!DOCTYPE airframe SYSTEM "../airframe.dtd">
|
||||
|
||||
<airframe name="bebop2_vision">
|
||||
<description>Bebop2, Vision disabled
|
||||
</description>
|
||||
|
||||
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="bebop2"/>
|
||||
|
||||
<module name="telemetry" type="transparent_udp"/>
|
||||
<module name="radio_control" type="datalink"/>
|
||||
<module name="motor_mixing"/>
|
||||
<module name="actuators" type="bebop"/>
|
||||
<module name="imu" type="bebop"/>
|
||||
<module name="gps" type="ublox"/>
|
||||
<module name="stabilization" type="indi_simple"/>
|
||||
<module name="ahrs" type="int_cmpl_quat">
|
||||
<configure name="USE_MAGNETOMETER" value="TRUE"/>
|
||||
<define name="AHRS_USE_GPS_HEADING" value="FALSE"/>
|
||||
</module>
|
||||
<module name="ins" type="extended"/>
|
||||
|
||||
|
||||
<module name="geo_mag"/>
|
||||
<module name="air_data"/>
|
||||
<module name="send_imu_mag_current"/>
|
||||
<module name="gps" type="ubx_ucenter"/>
|
||||
<module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module>
|
||||
|
||||
<module name="video_thread"/>
|
||||
|
||||
<!--<module name="video_rtp_stream">-->
|
||||
<!--<define name="VIEWVIDEO_CAMERA" value="bottom_camera"/>-->
|
||||
<!--<define name="VIEWVIDEO_CAMERA2" value="front_camera"/>-->
|
||||
<!--<define name="VIEWVIDEO_DOWNSIZE_FACTOR" value="2"/>-->
|
||||
<!--<define name="VIEWVIDEO_QUALITY_FACTOR" value="40"/>-->
|
||||
<!--</module>-->
|
||||
|
||||
<!--<module name="bebop_ae_awb"/>-->
|
||||
|
||||
</firmware>
|
||||
|
||||
<commands>
|
||||
<axis name="PITCH" failsafe_value="0"/>
|
||||
<axis name="ROLL" failsafe_value="0"/>
|
||||
<axis name="YAW" failsafe_value="0"/>
|
||||
<axis name="THRUST" failsafe_value="6000"/>
|
||||
</commands>
|
||||
|
||||
<servos driver="Default">
|
||||
<servo name="TOP_LEFT" no="0" min="2500" neutral="2500" max="12000"/>
|
||||
<servo name="TOP_RIGHT" no="1" min="2500" neutral="2500" max="12000"/>
|
||||
<servo name="BOTTOM_RIGHT" no="2" min="2500" neutral="2500" max="12000"/>
|
||||
<servo name="BOTTOM_LEFT" no="3" min="2500" neutral="2500" max="12000"/>
|
||||
</servos>
|
||||
|
||||
<section name="MIXING" prefix="MOTOR_MIXING_">
|
||||
<define name="TRIM_ROLL" value="0"/>
|
||||
<define name="TRIM_PITCH" value="0"/>
|
||||
<define name="TRIM_YAW" value="0"/>
|
||||
<define name="REVERSE" value="TRUE"/>
|
||||
<define name="TYPE" value="QUAD_X"/>
|
||||
</section>
|
||||
|
||||
<command_laws>
|
||||
<call fun="motor_mixing_run(autopilot_get_motors_on(),FALSE,values)"/>
|
||||
<set servo="TOP_LEFT" value="motor_mixing.commands[MOTOR_FRONT_LEFT]"/>
|
||||
<set servo="TOP_RIGHT" value="motor_mixing.commands[MOTOR_FRONT_RIGHT]"/>
|
||||
<set servo="BOTTOM_RIGHT" value="motor_mixing.commands[MOTOR_BACK_RIGHT]"/>
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="AIR_DATA" prefix="AIR_DATA_">
|
||||
<define name="CALC_AIRSPEED" value="FALSE"/>
|
||||
<define name="CALC_TAS_FACTOR" value="FALSE"/>
|
||||
<define name="CALC_AMSL_BARO" value="TRUE"/>
|
||||
</section>
|
||||
|
||||
<!-- Magnetometer still needs to be calibrated -->
|
||||
<section name="IMU" prefix="IMU_">
|
||||
<define name="MAG_X_NEUTRAL" value="0"/>
|
||||
<define name="MAG_Y_NEUTRAL" value="0"/>
|
||||
<define name="MAG_Z_NEUTRAL" value="0"/>
|
||||
<define name="MAG_X_SENS" value="7.28514789391" integer="16"/>
|
||||
<define name="MAG_Y_SENS" value="7.33022132691" integer="16"/>
|
||||
<define name="MAG_Z_SENS" value="7.57102035692" integer="16"/>
|
||||
</section>
|
||||
|
||||
<!-- local magnetic field -->
|
||||
<!-- http://wiki.paparazziuav.org/wiki/Subsystem/ahrs#Local_Magnetic_Field -->
|
||||
<section name="AHRS" prefix="AHRS_">
|
||||
<!-- values used if no GPS fix, on 3D fix is update by geo_mag module -->
|
||||
<!-- Delft -->
|
||||
<define name="H_X" value="0.3892503"/>
|
||||
<define name="H_Y" value="0.0017972"/>
|
||||
<define name="H_Z" value="0.9211303"/>
|
||||
</section>
|
||||
|
||||
<section name="INS" prefix="INS_">
|
||||
<define name="SONAR_MAX_RANGE" value="2.2"/>
|
||||
<define name="SONAR_UPDATE_ON_AGL" value="TRUE"/>
|
||||
</section>
|
||||
|
||||
|
||||
<section name="RC_SETPOINT" prefix="STABILIZATION_ATTITUDE_">
|
||||
<!-- setpoint limits for attitude stabilization rc flight -->
|
||||
<define name="SP_MAX_PHI" value="45" unit="deg"/>
|
||||
<define name="SP_MAX_THETA" value="45" unit="deg"/>
|
||||
<define name="SP_MAX_R" value="300" unit="deg/s"/>
|
||||
<define name="DEADBAND_A" value="0"/>
|
||||
<define name="DEADBAND_E" value="0"/>
|
||||
<define name="DEADBAND_R" value="50"/>
|
||||
</section>
|
||||
|
||||
<section name="ATTITUDE_REFERENCE" prefix="STABILIZATION_ATTITUDE_">
|
||||
<!-- attitude reference generation model -->
|
||||
<define name="REF_OMEGA_P" value="450" unit="deg/s"/>
|
||||
<define name="REF_ZETA_P" value="0.9"/>
|
||||
<define name="REF_MAX_P" value="600." unit="deg/s"/>
|
||||
<define name="REF_MAX_PDOT" value="RadOfDeg(8000.)"/>
|
||||
|
||||
<define name="REF_OMEGA_Q" value="450" unit="deg/s"/>
|
||||
<define name="REF_ZETA_Q" value="0.9"/>
|
||||
<define name="REF_MAX_Q" value="600." unit="deg/s"/>
|
||||
<define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/>
|
||||
|
||||
<define name="REF_OMEGA_R" value="450" unit="deg/s"/>
|
||||
<define name="REF_ZETA_R" value="0.9"/>
|
||||
<define name="REF_MAX_R" value="600." unit="deg/s"/>
|
||||
<define name="REF_MAX_RDOT" value="RadOfDeg(8000.)"/>
|
||||
</section>
|
||||
|
||||
<section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
|
||||
<!-- control effectiveness -->
|
||||
<define name="G1_P" value="0.05"/>
|
||||
<define name="G1_Q" value="0.04"/>
|
||||
<define name="G1_R" value="0.0022"/>
|
||||
<define name="G2_R" value="0.20"/>
|
||||
|
||||
<!-- Here it is assumed that your removed the damping from your bebop2!
|
||||
The dampers do not really damp, but cause oscillation. By removing/
|
||||
fixing them, the bebop2 will fly much better-->
|
||||
<define name="FILTER_ROLL_RATE" value="FALSE"/>
|
||||
<define name="FILTER_PITCH_RATE" value="FALSE"/>
|
||||
<define name="FILTER_YAW_RATE" value="FALSE"/>
|
||||
|
||||
<!-- reference acceleration for attitude control -->
|
||||
<define name="REF_ERR_P" value="600.0"/>
|
||||
<define name="REF_ERR_Q" value="600.0"/>
|
||||
<define name="REF_ERR_R" value="600.0"/>
|
||||
<define name="REF_RATE_P" value="28.0"/>
|
||||
<define name="REF_RATE_Q" value="28.0"/>
|
||||
<define name="REF_RATE_R" value="28.0"/>
|
||||
|
||||
<!-- second order filter parameters -->
|
||||
<define name="FILT_CUTOFF" value="3.2"/>
|
||||
<define name="FILT_CUTOFF_R" value="3.2"/>
|
||||
|
||||
<!-- first order actuator dynamics -->
|
||||
<define name="ACT_DYN_P" value="0.06"/>
|
||||
<define name="ACT_DYN_Q" value="0.06"/>
|
||||
<define name="ACT_DYN_R" value="0.06"/>
|
||||
|
||||
<!-- Adaptive Learning Rate -->
|
||||
<define name="USE_ADAPTIVE" value="FALSE"/>
|
||||
<define name="ADAPTIVE_MU" value="0.0001"/>
|
||||
</section>
|
||||
|
||||
<section name="GUIDANCE_V" prefix="GUIDANCE_V_">
|
||||
<define name="HOVER_KP" value="350"/>
|
||||
<define name="HOVER_KD" value="85"/>
|
||||
<define name="HOVER_KI" value="20"/>
|
||||
<define name="NOMINAL_HOVER_THROTTLE" value="0.655"/>
|
||||
<define name="ADAPT_THROTTLE_ENABLED" value="TRUE"/>
|
||||
</section>
|
||||
|
||||
<section name="GUIDANCE_H" prefix="GUIDANCE_H_">
|
||||
<define name="REF_MAX_SPEED" value="2" unit="m/s"/>
|
||||
<define name="MAX_BANK" value="32" unit="deg"/>
|
||||
<define name="PGAIN" value="120"/>
|
||||
<define name="DGAIN" value="100"/>
|
||||
<define name="IGAIN" value="30"/>
|
||||
</section>
|
||||
|
||||
<section name="NAVIGATION" prefix="NAV_">
|
||||
<define name="CLIMB_VSPEED" value="4.5"/>
|
||||
<define name="DESCEND_VSPEED" value="-1.0"/>
|
||||
</section>
|
||||
|
||||
<section name="SIMULATOR" prefix="NPS_">
|
||||
<define name="ACTUATOR_NAMES" value="nw_motor, ne_motor, se_motor, sw_motor" type="string[]"/>
|
||||
<define name="JSBSIM_MODEL" value="simple_x_quad_ccw" type="string"/>
|
||||
<define name="SENSORS_PARAMS" value="nps_sensors_params_default.h" type="string"/>
|
||||
</section>
|
||||
|
||||
<section name="AUTOPILOT">
|
||||
<define name="MODE_STARTUP" value="AP_MODE_NAV"/>
|
||||
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
|
||||
<define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_Z_HOLD"/>
|
||||
<define name="MODE_AUTO2" value="AP_MODE_NAV"/>
|
||||
|
||||
<define name="NO_RC_THRUST_LIMIT" value="TRUE"/>
|
||||
</section>
|
||||
|
||||
<section name="BAT">
|
||||
<define name="MILLIAMP_AT_FULL_THROTTLE" value="8700"/>
|
||||
<define name="CATASTROPHIC_BAT_LEVEL" value="9.9" unit="V"/>
|
||||
<define name="CRITIC_BAT_LEVEL" value="11.0" unit="V"/>
|
||||
<define name="LOW_BAT_LEVEL" value="11.1" unit="V"/>
|
||||
<define name="MAX_BAT_LEVEL" value="12.4" unit="V"/>
|
||||
</section>
|
||||
</airframe>
|
||||
@@ -28,7 +28,7 @@
|
||||
<define name="GUIDANCE_INDI_RC_DEBUG" value="TRUE"/> </module> -->
|
||||
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
<module name="pose_history"/>
|
||||
<module name="cv_opticflow">
|
||||
<define name="OPTICFLOW_METHOD" value="0"/>
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
|
||||
<module name="video_thread">
|
||||
<module name="bebop_cam">
|
||||
</module>
|
||||
|
||||
<module name="pose_history"/>
|
||||
|
||||
<module name="cv_detect_contour">
|
||||
<define name="DETECT_CONTOUR_CAMERA" value="front_camera"/>
|
||||
<define name="DETECT_CONTOUR_CAMERA" value="front_camera"/>
|
||||
</module>
|
||||
<module name="cv_opticflow">
|
||||
<define name="OPTICFLOW_METHOD" value="1"/>
|
||||
|
||||
@@ -11,19 +11,6 @@
|
||||
<module name="fdm" type="gazebo"/>
|
||||
</target>
|
||||
|
||||
<!-- Front Camera parameters -->
|
||||
<define name="MT9F002_INITIAL_OFFSET_X" value="0.09" /> <!-- Offset from center position [-0.5..0.5]. Set to 0.09 to center horizon. -->
|
||||
<define name="MT9F002_INITIAL_OFFSET_Y" value="0." /> <!-- Offset from center position [-0.5..0.5] -->
|
||||
<define name="MT9F002_OUTPUT_WIDTH" value="240" /> <!-- Output dimensions -->
|
||||
<define name="MT9F002_OUTPUT_HEIGHT" value="520" /> <!-- Output dimensions -->
|
||||
<define name="MT9F002_TARGET_FPS" value="30" />
|
||||
<define name="MT9F002_TARGET_EXPOSURE" value="20" />
|
||||
<define name="MT9F002_GAIN_GREEN1" value="4.0" />
|
||||
<define name="MT9F002_GAIN_GREEN2" value="4.0" />
|
||||
<define name="MT9F002_GAIN_RED" value="5.0" />
|
||||
<define name="MT9F002_GAIN_BLUE" value="5.0" />
|
||||
<define name="MT9F002_OUTPUT_SCALER" value="0.25"/>
|
||||
|
||||
<!-- Subsystem section -->
|
||||
<module name="telemetry" type="transparent_udp"/>
|
||||
<module name="radio_control" type="datalink"/>
|
||||
@@ -50,7 +37,7 @@
|
||||
</module>
|
||||
|
||||
<!-- Video/Camera modules -->
|
||||
<module name="video_thread" />
|
||||
<module name="bebop_cam" />
|
||||
<!--module name="bebop_ae_awb">
|
||||
<define name="CV_AE_AWB_VERBOSE" value="0" />
|
||||
</module-->
|
||||
@@ -101,6 +88,14 @@
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="BEBOP_FRONT_CAMERA" prefix="MT9F002_">
|
||||
<define name="OUTPUT_HEIGHT" value="520" />
|
||||
<define name="OUTPUT_WIDTH" value="240" />
|
||||
<define name="OFFSET_X" value="0.09" />
|
||||
<define name="TARGET_EXPOSURE" value="20" />
|
||||
<define name="ZOOM" value="1.25"/>
|
||||
</section>
|
||||
|
||||
<!-- Cyberzoo bebop1 values -->
|
||||
<section name="COLORFILTER" prefix="ORANGE_AVOIDER_">
|
||||
<define name="LUM_MIN" value="20"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="video_capture">
|
||||
<define name="VIDEO_CAPTURE_CAMERA" value="front_camera"/>
|
||||
@@ -75,6 +75,14 @@
|
||||
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="BEBOP_FRONT_CAMERA" prefix="MT9F002_">
|
||||
<define name="OUTPUT_HEIGHT" value="640" />
|
||||
<define name="OUTPUT_WIDTH" value="640" />
|
||||
<define name="OFFSET_X" value="0.15" />
|
||||
<define name="TARGET_EXPOSURE" value="30" />
|
||||
<define name="ZOOM" value="1.25"/>
|
||||
</section>
|
||||
|
||||
<section name="AIR_DATA" prefix="AIR_DATA_">
|
||||
<define name="CALC_AIRSPEED" value="FALSE"/>
|
||||
<define name="CALC_TAS_FACTOR" value="FALSE"/>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<!--module name="logger_file">
|
||||
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
|
||||
</module-->
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_blob_locator">
|
||||
<define name="BLOB_LOCATOR_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<module name="air_data"/>
|
||||
<module name="send_imu_mag_current"/>
|
||||
<module name="pose_history"/>
|
||||
<module name="video_thread"/>
|
||||
<module name="bebop_cam"/>
|
||||
|
||||
<module name="cv_opticflow">
|
||||
<define name="OPTICFLOW_CAMERA" value="bottom_camera"/>
|
||||
|
||||
@@ -34,10 +34,6 @@ $(TARGET).CFLAGS += -DUSE_LINUX_SIGNAL -D_GNU_SOURCE
|
||||
# board specific init function
|
||||
$(TARGET).srcs += $(SRC_BOARD)/board.c
|
||||
|
||||
# Compile the video specific parts
|
||||
$(TARGET).CFLAGS += -DI2C_BUF_LEN=56 -DUSE_I2C0
|
||||
$(TARGET).srcs += $(SRC_BOARD)/mt9v117.c $(SRC_BOARD)/mt9f002.c modules/computer_vision/lib/isp/libisp.c modules/computer_vision/lib/isp/libisp_config.c
|
||||
|
||||
# Link static (Done for GLIBC)
|
||||
$(TARGET).CFLAGS += -DLINUX_LINK_STATIC
|
||||
$(TARGET).LDFLAGS += -static
|
||||
@@ -48,8 +44,8 @@ $(TARGET).LDFLAGS += -static
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
# default LED configuration
|
||||
RADIO_CONTROL_LED ?= none
|
||||
BARO_LED ?= none
|
||||
AHRS_ALIGNER_LED ?= 1
|
||||
GPS_LED ?= none
|
||||
SYS_TIME_LED ?= 0
|
||||
RADIO_CONTROL_LED ?= none
|
||||
BARO_LED ?= none
|
||||
AHRS_ALIGNER_LED ?= 1
|
||||
GPS_LED ?= none
|
||||
SYS_TIME_LED ?= 0
|
||||
|
||||
@@ -37,10 +37,6 @@ $(TARGET).CFLAGS += -DUSE_LINUX_SIGNAL -D_GNU_SOURCE
|
||||
# board specific init function
|
||||
$(TARGET).srcs += $(SRC_BOARD)/board.c
|
||||
|
||||
# Compile the video specific parts
|
||||
$(TARGET).CFLAGS += -DI2C_BUF_LEN=56 -DUSE_I2C0
|
||||
$(TARGET).srcs += $(SRC_BOARD)/mt9v117.c $(SRC_BOARD)/mt9f002.c modules/computer_vision/lib/isp/libisp.c modules/computer_vision/lib/isp/libisp_config.c
|
||||
|
||||
# Link static (Done for GLIBC)
|
||||
$(TARGET).CFLAGS += -DLINUX_LINK_STATIC
|
||||
$(TARGET).LDFLAGS += -static
|
||||
@@ -51,8 +47,8 @@ $(TARGET).LDFLAGS += -static
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
# default LED configuration
|
||||
RADIO_CONTROL_LED ?= none
|
||||
BARO_LED ?= none
|
||||
AHRS_ALIGNER_LED ?= 1
|
||||
GPS_LED ?= none
|
||||
SYS_TIME_LED ?= 0
|
||||
RADIO_CONTROL_LED ?= none
|
||||
BARO_LED ?= none
|
||||
AHRS_ALIGNER_LED ?= 1
|
||||
GPS_LED ?= none
|
||||
SYS_TIME_LED ?= 0
|
||||
|
||||
@@ -38,11 +38,6 @@ $(TARGET).CFLAGS += -DUSE_LINUX_SIGNAL -D_GNU_SOURCE
|
||||
# board specific init function
|
||||
$(TARGET).srcs += $(SRC_BOARD)/board.c
|
||||
|
||||
# Compile the video specific parts
|
||||
VIDEO_SRC = boards/bebop
|
||||
$(TARGET).CFLAGS += -DI2C_BUF_LEN=56 -DUSE_I2C0
|
||||
$(TARGET).srcs += $(VIDEO_SRC)/mt9v117.c $(VIDEO_SRC)/mt9f002.c modules/computer_vision/lib/isp/libisp.c modules/computer_vision/lib/isp/libisp_config.c
|
||||
|
||||
# Link static (Done for GLIBC)
|
||||
$(TARGET).CFLAGS += -DLINUX_LINK_STATIC
|
||||
$(TARGET).LDFLAGS += -static
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
<module name="bebop_ae_awb" dir="computer_vision">
|
||||
<doc>
|
||||
<description>Auto Exposure and Auto White Balancing for the Bebop 1 and 2</description>
|
||||
<description>Auto Exposure and Auto White Balancing for the front camera on the Parrot Bebop 1 and 2 and the Disco</description>
|
||||
<section name="bebop_ae_awb">
|
||||
<define name="BEBOP_AE_AWB_NICE" value="5" description="Nice setting for async thread"/>
|
||||
<define name="BEBOP_AUTO_EXPOSURE" value="true" description="perform auto exposure (Default: true)"/>
|
||||
<define name="BEBOP_AE_AWB_CAMERA" value="front_camera|bottom_camera" description="which camera to run the AWB and AE"/>
|
||||
<define name="BEBOP_AE_AWB_VERBOSE" value="TRUE|FALSE" description="Whether or not to print debug information to the terminal"/>
|
||||
<define name="BEBOP_AE_EXPOSURE_GAIN" value="0.75" description="Gain to apply to autoexposure change"/>
|
||||
<define name="BEBOP_AE_MIDDLE_INDEX" value="110" description="Bin index to be considered as the center of the brightness bins"/>
|
||||
|
||||
73
conf/modules/bebop_cam.xml
Normal file
73
conf/modules/bebop_cam.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<!DOCTYPE module SYSTEM "module.dtd">
|
||||
|
||||
<module name="bebop_cam" dir="../boards/bebop">
|
||||
<doc>
|
||||
<description>
|
||||
Compile and control the settings of the Bebop front and bottom cameras.
|
||||
</description>
|
||||
<section name="Front camera" prefix="MT9F002_">
|
||||
<define name="RESOLUTION" value="0" description="Preset image resolutions, 0 = VGA, 1 = 720p, 2 = 720p 4:3 aspect ratio, 3 = 1080p, 4 = 1080p 4:3 aspect ratio, 5 = 2048*2048, this is the max dimention allowable with isp"/>
|
||||
<define name="OUTPUT_WIDTH" value="640" description="Image horizontal resolution used if MT9F002_RESOLUTION not defined"/>
|
||||
<define name="OUTPUT_HEIGHT" value="640" description="Image vertical resolution used if MT9F002_RESOLUTION not defined"/>
|
||||
<define name="OFFSET_X" value="0" description="Signed fractional offset from centre of image of original sensor [-0.5,0.5]"/>
|
||||
<define name="OFFSET_Y" value="0" description="Signed fractional offset from centre of image of original sensor [-0.5,0.5]"/>
|
||||
<define name="ZOOM" value="1" description="Zoom factor of image"/>
|
||||
<define name="TARGET_EXPOSURE" value="30" description="Exposure of the front camera of the bebop. Experimental values: Outside: 15; Inside well lit: 30; Inside poorly lit: 60"/>
|
||||
<define name="TARGET_FPS" value="30" description="Desired frame rate"/>
|
||||
<define name="GAIN_GREEN1" value="2" description="Green gain"/>
|
||||
<define name="GAIN_GREEN2" value="2" description="Green gain"/>
|
||||
<define name="GAIN_RED" value="1.4" description="Red gain"/>
|
||||
<define name="GAIN_BLUE" value="2.7" description="Blue gain"/>
|
||||
<define name="FOCAL_X" value="0.48686" description="Focal length in the x-direction in pixels"/>
|
||||
<define name="OFFSET_X" value="0.48908" description="Focal length in the y-direction in pixels"/>
|
||||
<define name="CENTER_X" value="0.51015" description="Center image coordinate in the x-direction"/>
|
||||
<define name="CENTER_Y" value="0.51015" description="Center image coordinate in the y-direction"/>
|
||||
<define name="DHANE_K" value="1.25" description="(Un)Distortion parameter for a fish-eye lens"/>
|
||||
</section>
|
||||
|
||||
<section name="Bottom camera" prefix="MT9V117_">
|
||||
<define name="TARGET_FPS" value="30" description="Desired frame rate"/>
|
||||
<define name="FOCAL_X" value="0.48686" description="Focal length in the x-direction in pixels"/>
|
||||
<define name="OFFSET_X" value="0.48908" description="Focal length in the y-direction in pixels"/>
|
||||
<define name="CENTER_X" value="0.51015" description="Center image coordinate in the x-direction"/>
|
||||
<define name="CENTER_Y" value="0.51015" description="Center image coordinate in the y-direction"/>
|
||||
<define name="DHANE_K" value="1.25" description="(Un)Distortion parameter for a fish-eye lens"/>
|
||||
</section>
|
||||
</doc>
|
||||
|
||||
<settings>
|
||||
<dl_settings NAME="Bebop camera control">
|
||||
<dl_settings name="Front camera">
|
||||
<dl_setting var="mt9f002.set_zoom" min="1." step="0.05" max="2.5" shortname="zoom" param="MT9F002_ZOOM"/>
|
||||
<dl_setting var="mt9f002.set_offset_x" min="-0.5" step="0.05" max="0.5" shortname="offset_x" param="MT9F002_OFFSET_X"/>
|
||||
<dl_setting var="mt9f002.set_offset_y" min="-0.5" step="0.05" max="0.5" shortname="offset_y" param="MT9F002_OFFSET_Y"/>
|
||||
<dl_setting var="mt9f002_send_resolution" min="1" step="1" max="1" values="SEND" shortname="update_resolution" module="boards/bebop/mt9f002" handler="setting_update_resolution"/>
|
||||
<dl_setting var="mt9f002.gain_green1" min="1" step="0.1" max="60" shortname="green_1" param="MT9F002_GAIN_GREEN1"/>
|
||||
<dl_setting var="mt9f002.gain_green2" min="1" step="0.1" max="60" shortname="green_2" param="MT9F002_GAIN_GREEN2"/>
|
||||
<dl_setting var="mt9f002.gain_blue" min="1" step="0.1" max="60" shortname="blue" param="MT9F002_GAIN_BLUE"/>
|
||||
<dl_setting var="mt9f002.gain_red" min="1" step="0.1" max="60" shortname="red" param="MT9F002_GAIN_RED"/>
|
||||
<dl_setting var="mt9f002_send_color" min="1" step="1" max="1" values="SEND" shortname="update_color" module="boards/bebop/mt9f002" handler="setting_update_color"/>
|
||||
<dl_setting var="mt9f002.target_exposure " min="0.1" step="0.1" max="80" shortname="exposure" param="MT9F002_TARGET_EXPOSURE"/>
|
||||
<dl_setting var="mt9f002_send_exposure" min="1" step="1" max="1" values="SEND" shortname="update_exposure" module="boards/bebop/mt9f002" handler="setting_update_exposure"/>
|
||||
</dl_settings>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
|
||||
<autoload name="video_thread"/>
|
||||
|
||||
<header>
|
||||
<file name="mt9v117.h"/>
|
||||
<file name="mt9f002.h"/>
|
||||
</header>
|
||||
|
||||
<init fun="mt9v117_init(&mt9v117)"/>
|
||||
<init fun="mt9f002_init(&mt9f002)"/>
|
||||
<makefile target="ap">
|
||||
<file name="mt9v117.c"/>
|
||||
<file name="mt9f002.c"/>
|
||||
<file name="libisp.c" dir="boards/bebop/isp"/>
|
||||
|
||||
<define name="I2C_BUF_LEN" value="56"/>
|
||||
<define name="USE_I2C0"/>
|
||||
</makefile>
|
||||
</module>
|
||||
@@ -117,7 +117,6 @@
|
||||
<file name="image.c" dir="modules/computer_vision/lib/vision"/>
|
||||
<file name="jpeg.c" dir="modules/computer_vision/lib/encoding"/>
|
||||
<file name="rtp.c" dir="modules/computer_vision/lib/encoding"/>
|
||||
<file name="v4l2.c" dir="modules/computer_vision/lib/v4l"/>
|
||||
|
||||
<!-- The optical flow module (calculator) -->
|
||||
<file name="opticflow_module.c"/>
|
||||
|
||||
@@ -17,9 +17,8 @@
|
||||
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_settings name="video">
|
||||
<dl_setting var="video_capture_take_shot" min="0" step="1" max="1" shortname="take_shot"
|
||||
module="computer_vision/video_capture">
|
||||
<dl_settings name="video_capture">
|
||||
<dl_setting var="video_capture_take_shot" min="0" step="1" max="1" shortname="capture_frame" module="computer_vision/video_capture">
|
||||
<strip_button name="Video Save Image" icon="digital-camera.png" value="1" group="cv"/>
|
||||
</dl_setting>
|
||||
</dl_settings>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<include name="modules/computer_vision"/>
|
||||
<file name="image.c" dir="modules/computer_vision/lib/vision"/>
|
||||
<file name="v4l2.c" dir="modules/computer_vision/lib/v4l"/>
|
||||
<file name="virt2phys.c" dir="modules/computer_vision/lib/v4l"/>
|
||||
<file name="jpeg.c" dir="modules/computer_vision/lib/encoding"/>
|
||||
|
||||
<!-- Random flags -->
|
||||
|
||||
@@ -462,17 +462,6 @@
|
||||
settings_modules="modules/gps_ubx_ucenter.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#baa3d698b729"
|
||||
/>
|
||||
<aircraft
|
||||
name="bebop2_vision"
|
||||
ac_id="27"
|
||||
airframe="airframes/tudelft/bebop2_vision.xml"
|
||||
radio="radios/dummy.xml"
|
||||
telemetry="telemetry/default_rotorcraft.xml"
|
||||
flight_plan="flight_plans/tudelft/delft_basic.xml"
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/gps_ubx_ucenter.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffbf17bf17"
|
||||
/>
|
||||
<aircraft
|
||||
name="bebop2_vision_front"
|
||||
ac_id="217"
|
||||
@@ -481,7 +470,7 @@
|
||||
telemetry="telemetry/default_rotorcraft.xml"
|
||||
flight_plan="flight_plans/rotorcraft_guido_optitrack.xml"
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/video_rtp_stream.xml modules/optical_flow_landing.xml modules/cv_opticflow.xml modules/video_capture.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
settings_modules="modules/video_rtp_stream.xml modules/optical_flow_landing.xml modules/cv_opticflow.xml modules/video_capture.xml modules/bebop_cam.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffbf17bf17"
|
||||
/>
|
||||
<aircraft
|
||||
|
||||
@@ -60,9 +60,6 @@
|
||||
extern struct video_config_t bottom_camera;
|
||||
extern struct video_config_t front_camera;
|
||||
|
||||
/* ISP */
|
||||
struct mt9f002_t mt9f002;
|
||||
|
||||
/* by default activate onboard baro */
|
||||
#ifndef USE_BARO_BOARD
|
||||
#define USE_BARO_BOARD 1
|
||||
|
||||
@@ -29,47 +29,9 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "mcu_periph/i2c.h"
|
||||
#include "mt9v117.h"
|
||||
#include "mt9f002.h"
|
||||
#include "mcu.h"
|
||||
#include "boards/bebop.h"
|
||||
|
||||
/* Initialize MT9F002 chipset (Front camera) */
|
||||
struct mt9f002_t mt9f002 = {
|
||||
// Precomputed values to go from InputCLK of (26/2)MHz to 96MH
|
||||
.interface = MT9F002_PARALLEL,
|
||||
.input_clk_freq = (26 / 2),
|
||||
.vt_pix_clk_div = 7,
|
||||
.vt_sys_clk_div = 1,
|
||||
.pre_pll_clk_div = 1,
|
||||
.pll_multiplier = 59,
|
||||
.op_pix_clk_div = 8,
|
||||
.op_sys_clk_div = 1,
|
||||
.shift_vt_pix_clk_div = 1,
|
||||
.rowSpeed_2_0 = 1,
|
||||
.row_speed_10_8 = 1,
|
||||
|
||||
// Initial values
|
||||
.target_fps = MT9F002_TARGET_FPS,
|
||||
.target_exposure = MT9F002_TARGET_EXPOSURE,
|
||||
.gain_green1 = MT9F002_GAIN_GREEN1,
|
||||
.gain_blue = MT9F002_GAIN_BLUE,
|
||||
.gain_red = MT9F002_GAIN_RED,
|
||||
.gain_green2 = MT9F002_GAIN_GREEN2,
|
||||
.output_width = MT9F002_OUTPUT_WIDTH,
|
||||
.output_height = MT9F002_OUTPUT_HEIGHT,
|
||||
.output_scaler = MT9F002_OUTPUT_SCALER,
|
||||
.offset_x = MT9F002_INITIAL_OFFSET_X,
|
||||
.offset_y = MT9F002_INITIAL_OFFSET_Y,
|
||||
|
||||
.x_odd_inc = MT9F002_X_ODD_INC_VAL,
|
||||
.y_odd_inc = MT9F002_Y_ODD_INC_VAL,
|
||||
|
||||
// I2C connection port
|
||||
.i2c_periph = &i2c0
|
||||
};
|
||||
|
||||
static int kill_gracefull(char *process_name)
|
||||
{
|
||||
/* "pidof" always in /bin on Bebop firmware tested 1.98, 2.0.57, no need for "which" */
|
||||
@@ -128,14 +90,4 @@ void board_init(void)
|
||||
|
||||
void board_init2(void)
|
||||
{
|
||||
/* Initialize MT9V117 chipset (Bottom camera) */
|
||||
struct mt9v117_t mt9v117 = {
|
||||
// Initial values
|
||||
|
||||
// I2C connection port
|
||||
.i2c_periph = &i2c0
|
||||
};
|
||||
mt9v117_init(&mt9v117);
|
||||
|
||||
mt9f002_init(&mt9f002);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,15 @@
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "libisp.h"
|
||||
#include "libisp_config.h"
|
||||
|
||||
#define PRINT(string,...) fprintf(stderr, "[libisp->%s()] " string,__FUNCTION__ , ##__VA_ARGS__)
|
||||
|
||||
#if MT9F002_VERBOSE
|
||||
#define VERBOSE_PRINT PRINT
|
||||
#else
|
||||
#define VERBOSE_PRINT(...)
|
||||
#endif
|
||||
|
||||
#define AVI_BASE 0x400000
|
||||
#define AVI_SIZE 0x100000
|
||||
@@ -22,6 +31,9 @@ struct avi_isp_offsets {
|
||||
uint32_t chain_yuv;
|
||||
};
|
||||
|
||||
#define AVI_ISP_STAT_YUV_MAX_WAIT 3
|
||||
uint8_t curWait = 0;
|
||||
|
||||
/* IOCTL implemented in AVI drivers */
|
||||
#define AVI_ISP_IOGET_OFFSETS _IOR('F', 0x33, struct avi_isp_offsets)
|
||||
|
||||
@@ -34,6 +46,8 @@ static struct libisp_context isp_ctx = {
|
||||
.devmem = -1
|
||||
};
|
||||
|
||||
uint16_t requestWindow[6] = {0};
|
||||
|
||||
static const unsigned isp_bases[] = {
|
||||
AVI_ISP_CHAIN_BAYER_INTER,
|
||||
AVI_ISP_VLFORMAT_32TO40,
|
||||
@@ -76,7 +90,7 @@ static const unsigned isp_bases[] = {
|
||||
static int avi_isp_get_offsets_fd(int fd, struct avi_isp_offsets *off)
|
||||
{
|
||||
if (ioctl(fd, AVI_ISP_IOGET_OFFSETS, off) < 0) {
|
||||
printf("sizeof: %d, %X\n", sizeof(struct avi_isp_offsets), AVI_ISP_IOGET_OFFSETS);
|
||||
VERBOSE_PRINT("sizeof: %d, %X\n", sizeof(struct avi_isp_offsets), AVI_ISP_IOGET_OFFSETS);
|
||||
perror("ioctl(AVI_ISP_IOGET_OFFSETS) failed");
|
||||
return -1;
|
||||
}
|
||||
@@ -197,18 +211,88 @@ int configure_isp(struct v4l2_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isp_request_statistics_yuv_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end,
|
||||
uint16_t x_odd_inc, uint16_t y_odd_inc)
|
||||
{
|
||||
requestWindow[0] = x_start;
|
||||
requestWindow[1] = x_end;
|
||||
requestWindow[2] = y_start;
|
||||
requestWindow[3] = y_end;
|
||||
requestWindow[4] = x_odd_inc;
|
||||
requestWindow[5] = y_odd_inc;
|
||||
|
||||
VERBOSE_PRINT("[YUV-STAT] Requesting window: [%d %d],[%d %d], [%d %d]\n",
|
||||
requestWindow[0], requestWindow[1], requestWindow[2], requestWindow[3], requestWindow[4], requestWindow[5]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int isp_set_statistics_yuv_window(void)
|
||||
{
|
||||
VERBOSE_PRINT("[YUV-STAT] Setting window: [%d %d],[%d %d]\n",
|
||||
requestWindow[0], requestWindow[1], requestWindow[2], requestWindow[3]);
|
||||
|
||||
isp_config.statistics_yuv.window_pos_x.window_x_start = requestWindow[0];
|
||||
isp_config.statistics_yuv.window_pos_x.window_x_end = requestWindow[1];
|
||||
isp_config.statistics_yuv.window_pos_y.window_y_start = requestWindow[2];
|
||||
isp_config.statistics_yuv.window_pos_y.window_y_end = requestWindow[3];
|
||||
isp_config.statistics_yuv.increments_log2.x_log2_inc = requestWindow[4];
|
||||
isp_config.statistics_yuv.increments_log2.y_log2_inc = requestWindow[5];
|
||||
|
||||
VERBOSE_PRINT("[YUV-STAT] Current settings: [%d %d] [%d %d] [%d %d] [%d %d] [%d] [%d %d] [%d]\n",
|
||||
isp_config.statistics_yuv.window_pos_x.window_x_start,
|
||||
isp_config.statistics_yuv.window_pos_x.window_x_end,
|
||||
isp_config.statistics_yuv.window_pos_y.window_y_start,
|
||||
isp_config.statistics_yuv.window_pos_y.window_y_end,
|
||||
isp_config.statistics_yuv.circle_pos_x_center.x_center,
|
||||
isp_config.statistics_yuv.circle_pos_x_squared.x_squared,
|
||||
isp_config.statistics_yuv.circle_pos_y_center.y_center,
|
||||
isp_config.statistics_yuv.circle_pos_y_squared.y_squared,
|
||||
isp_config.statistics_yuv.circle_radius_squared.radius_squared,
|
||||
isp_config.statistics_yuv.increments_log2.x_log2_inc,
|
||||
isp_config.statistics_yuv.increments_log2.y_log2_inc,
|
||||
isp_config.statistics_yuv.awb_threshold.awb_threshold
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Get YUV statistics */
|
||||
int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats)
|
||||
{
|
||||
uint16_t i;
|
||||
|
||||
if (isp_ctx.devmem < 0) {
|
||||
fprintf(stderr, "[YUV-STAT] Error isp_ctx.devmem < 0\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct avi_isp_statistics_yuv_regs stats_yuv;
|
||||
avi_isp_statistics_yuv_get_registers(&isp_ctx, &stats_yuv);
|
||||
|
||||
if (!stats_yuv.measure_status.done) {
|
||||
VERBOSE_PRINT("[YUV-STAT] Waiting for YUV stats\n");
|
||||
curWait++;
|
||||
if (curWait <= AVI_ISP_STAT_YUV_MAX_WAIT) {
|
||||
isp_config.statistics_yuv.measure_req.clear = 0; // Clear current results
|
||||
} else {
|
||||
isp_config.statistics_yuv.measure_req.clear = 1; // Clear current results
|
||||
isp_set_statistics_yuv_window();
|
||||
curWait = 0;
|
||||
}
|
||||
avi_isp_statistics_yuv_set_registers(&isp_ctx, &isp_config.statistics_yuv);
|
||||
return -1;
|
||||
} else if (stats_yuv.measure_status.error) {
|
||||
fprintf(stderr, "[YUV-STAT] Error requesting YUV stats\n");
|
||||
isp_config.statistics_yuv.measure_req.clear = 1; // Clear current results?
|
||||
curWait = 0;
|
||||
isp_set_statistics_yuv_window();
|
||||
avi_isp_statistics_yuv_set_registers(&isp_ctx, &isp_config.statistics_yuv);
|
||||
return -1;
|
||||
} else {
|
||||
isp_config.statistics_yuv.measure_req.clear = 1; // Clear current results?
|
||||
}
|
||||
curWait = 0;
|
||||
yuv_stats->awb_sum_Y = stats_yuv.awb_sum_y.awb_sum_y;
|
||||
yuv_stats->awb_sum_U = stats_yuv.awb_sum_u.awb_sum_u;
|
||||
yuv_stats->awb_sum_V = stats_yuv.awb_sum_v.awb_sum_v;
|
||||
@@ -222,6 +306,7 @@ int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats)
|
||||
for (i = 0; i < 256; ++i) {
|
||||
yuv_stats->ae_histogram_Y[i] = histogram.ae_histogram_y[i].histogram_y;
|
||||
}
|
||||
isp_set_statistics_yuv_window();
|
||||
|
||||
avi_isp_statistics_yuv_set_registers(&isp_ctx, &isp_config.statistics_yuv);
|
||||
return 0;
|
||||
@@ -4,9 +4,6 @@
|
||||
#include "reg_avi.h"
|
||||
#include "modules/computer_vision/lib/v4l/v4l2.h"
|
||||
|
||||
#define BAYERSTATS_STATX 64
|
||||
#define BAYERSTATS_STATY 48
|
||||
|
||||
#define AVI_DEFINE_NODE(EXPANDER) \
|
||||
EXPANDER(chain_bayer_inter) \
|
||||
EXPANDER(vlformat_32to40) \
|
||||
@@ -100,10 +97,10 @@ struct isp_yuv_stats_t {
|
||||
uint32_t ae_histogram_Y[256];
|
||||
};
|
||||
|
||||
extern struct libisp_config isp_config;
|
||||
|
||||
int configure_isp(struct v4l2_device *dev);
|
||||
int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats);
|
||||
extern int configure_isp(struct v4l2_device *dev);
|
||||
extern int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats);
|
||||
extern int isp_request_statistics_yuv_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end,
|
||||
uint16_t x_odd_inc, uint16_t y_odd_inc);
|
||||
|
||||
/* Registers access */
|
||||
#define EXPAND_AS_PROTOTYPE(_node) \
|
||||
560
sw/airborne/boards/bebop/isp/libisp_config.h
Normal file
560
sw/airborne/boards/bebop/isp/libisp_config.h
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user