restore deleted module and clean other config files (#2697)

This commit is contained in:
Gautier Hattenberger
2021-04-18 16:06:12 +02:00
committed by GitHub
parent addc8d051c
commit fdd82745cb
5 changed files with 532 additions and 66 deletions
-66
View File
@@ -21,17 +21,6 @@
settings_modules="modules/video_rtp_stream.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_float_mlkf.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="demo_cc3d"
ac_id="2"
airframe="airframes/untested/demo_cc3d.xml"
radio="radios/cockpitSX.xml"
telemetry="telemetry/demo.xml"
flight_plan="flight_plans/dummy.xml"
settings="settings/test_actuators_pwm.xml"
settings_modules="modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="flixr_lisamx"
ac_id="42"
@@ -43,61 +32,6 @@
settings_modules="modules/air_data.xml modules/geo_mag.xml modules/gps_ubx_ucenter.xml modules/ahrs_int_cmpl_quat.xml modules/ahrs_float_mlkf.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="px4"
ac_id="36"
airframe="airframes/untested/quadrotor_px4fmu.xml"
radio="radios/cockpitSX.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/gps_ubx_ucenter.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="quad_cc3d"
ac_id="3"
airframe="airframes/untested/quad_cc3d.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/dummy.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml"
gui_color="blue"
/>
<aircraft
name="quad_flip32"
ac_id="32"
airframe="airframes/untested/quad_flip32.xml"
radio="radios/TGY9x_jeti.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/gps_ubx_ucenter.xml modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml modules/gps.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml"
gui_color="blue"
/>
<aircraft
name="quad_revo_nano"
ac_id="4"
airframe="airframes/untested/quad_revo_nano.xml"
radio="radios/TGY9x_jeti.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/air_data.xml modules/gps_ubx_ucenter.xml modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml modules/gps.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml"
gui_color="blue"
/>
<aircraft
name="test_bbb"
ac_id="1"
airframe="airframes/untested/beagle_bone_black.xml"
radio="radios/dummy.xml"
telemetry="telemetry/dummy.xml"
flight_plan="flight_plans/dummy.xml"
settings="[settings/test_settings.xml] settings/dummy.xml"
settings_modules="modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="zmr250_elle0"
ac_id="40"
@@ -0,0 +1,217 @@
<!DOCTYPE airframe SYSTEM "../airframe.dtd">
<!-- this is a quadrotor frame in X-configuration equiped with
* Autopilot: Navstik http://wiki.paparazziuav.org/wiki/Navstik
* IMU: Navstik http://wiki.paparazziuav.org/wiki/Navstik
* Actuators: Asctec V2 http://wiki.paparazziuav.org/wiki/Subsystem/actuators#Asctec_v2
* GPS: Ublox http://wiki.paparazziuav.org/wiki/Subsystem/gps
* RC: one Spektrum sat http://wiki.paparazziuav.org/wiki/Subsystem/radio_control#Spektrum
-->
<airframe name="Quadrotor Navstik">
<firmware name="rotorcraft">
<target name="ap" board="navstik_1.0">
<configure name="ACTUATORS_ASCTEC_V2_I2C_DEV" value="i2c3"/>
<define name="ACTUATORS_START_DELAY" value="1"/>
</target>
<target name="nps" board="pc">
<module name="fdm" type="jsbsim"/>
</target>
<module name="radio_control" type="spektrum">
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<define name="RADIO_MODE" value="RADIO_AUX1"/>
</module>
<module name="motor_mixing"/>
<module name="actuators" type="asctec_v2"/>
<module name="telemetry" type="xbee_api"/>
<module name="imu" type="navstik"/>
<module name="gps" type="ublox"/>
<module name="stabilization" type="indi_simple"/>
<module name="ahrs" type="int_cmpl_quat"/>
<module name="ins" type="hff"/>
<module name="gps" type="ubx_ucenter"/>
<!--module name="airspeed_ms45xx_i2c">
<configure name="MS45XX_I2C_DEV" value="i2c3"/>
</module>
<module name="direct_memory_logger"/-->
</firmware>
<firmware name="test_progs">
<configure name="MODEM_PORT" value="UART1"/>
<target name="test_sys_time_timer" board="navstik_1.0"/>
<target name="test_telemetry" board="navstik_1.0"/>
<target name="test_actuators_pwm_sin" board="navstik_1.0"/>
</firmware>
<servos driver="Asctec_v2">
<servo name="FRONT" no="0" min="0" neutral="3" max="200"/>
<servo name="BACK" no="1" min="0" neutral="3" max="200"/>
<servo name="LEFT" no="2" min="0" neutral="3" max="200"/>
<servo name="RIGHT" no="3" min="0" neutral="3" max="200"/>
</servos>
<commands>
<axis name="ROLL" failsafe_value="0"/>
<axis name="PITCH" failsafe_value="0"/>
<axis name="YAW" failsafe_value="0"/>
<axis name="THRUST" failsafe_value="0"/>
</commands>
<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="NB_MOTOR" value="4"/>
<define name="SCALE" value="256"/>
<!-- order (and rotation direction) : NE (CW), SE (CCW), SW (CW), NW (CCW) -->
<define name="ROLL_COEF" value="{ -256, -256, 256, 256 }"/>
<define name="PITCH_COEF" value="{ 256, -256, -256, 256 }"/>
<define name="YAW_COEF" value="{ -256, 256, -256, 256 }"/>
<define name="THRUST_COEF" value="{ 256, 256, 256, 256 }"/>
</section>
<command_laws>
<call fun="motor_mixing_run(autopilot_get_motors_on(),FALSE,values)"/>
<set servo="FRONT" value="motor_mixing.commands[0]"/>
<set servo="BACK" value="motor_mixing.commands[1]"/>
<set servo="LEFT" value="motor_mixing.commands[2]"/>
<set servo="RIGHT" value="motor_mixing.commands[3]"/>
</command_laws>
<section name="IMU" prefix="IMU_">
<define name="ACCEL_X_NEUTRAL" value="11"/>
<define name="ACCEL_Y_NEUTRAL" value="11"/>
<define name="ACCEL_Z_NEUTRAL" value="-25"/>
<!-- replace this with your own calibration -->
<define name="MAG_X_NEUTRAL" value="-179"/>
<define name="MAG_Y_NEUTRAL" value="-21"/>
<define name="MAG_Z_NEUTRAL" value="79"/>
<define name="MAG_X_SENS" value="4.17334785618" integer="16"/>
<define name="MAG_Y_SENS" value="3.98885954135" integer="16"/>
<define name="MAG_Z_SENS" value="4.40442339014" integer="16"/>
<define name="BODY_TO_IMU_PHI" value="0." unit="deg"/>
<define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
<define name="BODY_TO_IMU_PSI" value="0." unit="deg"/>
</section>
<section name="AHRS" prefix="AHRS_">
<define name="H_X" value="0.3770441"/>
<define name="H_Y" value="0.0193986"/>
<define name="H_Z" value="0.9259921"/>
</section>
<section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
<!-- control effectiveness -->
<define name="G1_P" value="0.150"/>
<define name="G1_Q" value="0.150"/>
<define name="G1_R" value="0.005119"/>
<define name="G2_R" value="0.2166"/>
<!-- reference acceleration for attitude control -->
<define name="REF_ERR_P" value="900.0"/>
<define name="REF_ERR_Q" value="900.0"/>
<define name="REF_ERR_R" value="500.0"/>
<define name="REF_RATE_P" value="38.0"/>
<define name="REF_RATE_Q" value="38.0"/>
<define name="REF_RATE_R" value="25.0"/>
<!-- second order filter parameters -->
<define name="FILT_CUTOFF" value="8.0"/>
<define name="FILT_CUTOFF_R" value="8.0"/>
<!-- first order actuator dynamics -->
<define name="ACT_DYN_P" value="0.2"/>
<define name="ACT_DYN_Q" value="0.2"/>
<define name="ACT_DYN_R" value="0.2"/>
<!-- Adaptive Learning Rate -->
<define name="USE_ADAPTIVE" value="FALSE"/>
<define name="ADAPTIVE_MU" value="0.0001"/>
</section>
<section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_">
<!-- setpoints -->
<define name="SP_MAX_PHI" value="45." unit="deg"/>
<define name="SP_MAX_THETA" value="45." unit="deg"/>
<define name="SP_MAX_R" value="90." unit="deg/s"/>
<define name="DEADBAND_R" value="250"/>
<!-- reference -->
<define name="REF_OMEGA_P" value="800" unit="deg/s"/>
<define name="REF_ZETA_P" value="0.85"/>
<define name="REF_MAX_P" value="300." unit="deg/s"/>
<define name="REF_MAX_PDOT" value="RadOfDeg(7000.)"/>
<define name="REF_OMEGA_Q" value="800" unit="deg/s"/>
<define name="REF_ZETA_Q" value="0.85"/>
<define name="REF_MAX_Q" value="300." unit="deg/s"/>
<define name="REF_MAX_QDOT" value="RadOfDeg(7000.)"/>
<define name="REF_OMEGA_R" value="500" unit="deg/s"/>
<define name="REF_ZETA_R" value="0.85"/>
<define name="REF_MAX_R" value="180." unit="deg/s"/>
<define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/>
<!-- feedback -->
<define name="PHI_PGAIN" value="900"/>
<define name="PHI_DGAIN" value="200"/>
<define name="PHI_IGAIN" value="200"/>
<define name="THETA_PGAIN" value="900"/>
<define name="THETA_DGAIN" value="200"/>
<define name="THETA_IGAIN" value="200"/>
<define name="PSI_PGAIN" value="900"/>
<define name="PSI_DGAIN" value="200"/>
<define name="PSI_IGAIN" value="10"/>
<!-- feedforward -->
<define name="PHI_DDGAIN" value="75"/>
<define name="THETA_DDGAIN" value="75"/>
<define name="PSI_DDGAIN" value="75"/>
</section>
<section name="GUIDANCE_V" prefix="GUIDANCE_V_">
<define name="MIN_ERR_Z" value="POS_BFP_OF_REAL(-10.)"/>
<define name="MAX_ERR_Z" value="POS_BFP_OF_REAL( 10.)"/>
<define name="MIN_ERR_ZD" value="SPEED_BFP_OF_REAL(-10.)"/>
<define name="MAX_ERR_ZD" value="SPEED_BFP_OF_REAL( 10.)"/>
<define name="MAX_SUM_ERR" value="2000000"/>
<define name="HOVER_KP" value="150"/>
<define name="HOVER_KD" value="80"/>
<define name="HOVER_KI" value="20"/>
<define name="NOMINAL_HOVER_THROTTLE" value="0.5"/>
<define name="ADAPT_THROTTLE_ENABLED" value="TRUE"/>
</section>
<section name="GUIDANCE_H" prefix="GUIDANCE_H_">
<define name="MAX_BANK" value="20" unit="deg"/>
<define name="USE_SPEED_REF" value="TRUE"/>
<define name="PGAIN" value="50"/>
<define name="DGAIN" value="100"/>
<define name="AGAIN" value="70"/>
<define name="IGAIN" value="20"/>
</section>
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="ne_motor, se_motor, sw_motor, nw_motor" type="string[]"/>
<define name="JSBSIM_MODEL" value="simple_x_quad" type="string"/>
<define name="SENSORS_PARAMS" value="nps_sensors_params_default.h" type="string"/>
</section>
<section name="AUTOPILOT">
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
<define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_DIRECT"/>
<define name="MODE_AUTO2" value="AP_MODE_ATTITUDE_DIRECT"/>
</section>
<section name="BAT">
<define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
<define name="CRITIC_BAT_LEVEL" value="9.6" unit="V"/>
<define name="LOW_BAT_LEVEL" value="10.1" unit="V"/>
<define name="MAX_BAT_LEVEL" value="12.4" unit="V"/>
</section>
</airframe>
@@ -0,0 +1,41 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="photogrammetry_calculator" dir="cartography">
<doc>
<description>Photogrammetry navigation functions</description>
</doc>
<settings>
<dl_settings name="control">
<dl_settings name="photocalc">
<dl_setting max="90" min="-90" step="1" module="cartography/photogrammetry_calculator" var="photogrammetry_sweep_angle" shortname="Angle" param="PHOTOGRAMMETRY_SWEEP_ANGLE" unit="rad" alt_unit="deg"/>
<dl_setting max="95" min="0" step="1" VAR="photogrammetry_sidelap" module="cartography/photogrammetry_calculator" shortname="SideLap %" param="PHOTOGRAMMETRY_SIDELAP" handler="UpdateSideLap" />
<dl_setting max="95" min="0" step="1" var="photogrammetry_overlap" module="cartography/photogrammetry_calculator" shortname="OverLap %" param="PHOTOGRAMMETRY_OVERLAP" handler="UpdateOverLap" />
<dl_setting max="200" min="1" step="1" var="photogrammetry_resolution" module="cartography/photogrammetry_calculator" shortname="Pixel mm" param="PHOTOGRAMMETRY_RESOLUTION" handler="UpdateResolution" />
<dl_setting max="500" min="1" step="1" var="photogrammetry_height_min" shortname="h_min" />
<dl_setting max="500" min="1" step="1" var="photogrammetry_height_max" shortname="h_max" />
<dl_setting max="500" min="1" step="1" var="photogrammetry_radius_min" shortname="r_min" />
<dl_setting max="500" min="1" step="1" var="photogrammetry_height" module="cartography/photogrammetry_calculator" shortname="computed height" handler="UpdateHeight" />
<dl_setting max="1000" min="1" step="1" var="photogrammetry_sidestep" module="cartography/photogrammetry_calculator" shortname="computed sidestep" handler="UpdateSideStep" />
<dl_setting max="1000" min="1" step="1" var="photogrammetry_triggerstep" module="cartography/photogrammetry_calculator" shortname="computed trigger" handler="UpdateTriggerStep" />
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="photogrammetry_calculator.h"/>
</header>
<init fun="init_photogrammetry_calculator()"/>
<!--
<periodic fun="periodic_1Hz_demo()" freq="1." start="start_demo()" stop="stop_demo()" autorun="TRUE"/>
-->
<makefile>
<define name="photogrammetry_calculator_LED" value="2"/>
<file name="photogrammetry_calculator.c"/>
</makefile>
</module>
@@ -0,0 +1,122 @@
/*
* Copyright (C) 2009 Christophe De Wagter
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#include "photogrammetry_calculator.h"
#include "generated/airframe.h"
#include "generated/flight_plan.h"
/** Default sweep angle in radians from north */
#ifndef PHOTOGRAMMETRY_SWEEP_ANGLE
#define PHOTOGRAMMETRY_SWEEP_ANGLE 0
#endif
/** overlap 1-99 percent */
#ifndef PHOTOGRAMMETRY_OVERLAP
#define PHOTOGRAMMETRY_OVERLAP 50
#endif
/** sidelap 1-99 percent */
#ifndef PHOTOGRAMMETRY_SIDELAP
#define PHOTOGRAMMETRY_SIDELAP 50
#endif
/** mm pixel projection size */
#ifndef PHOTOGRAMMETRY_RESOLUTION
#define PHOTOGRAMMETRY_RESOLUTION 50
#endif
// Flightplan Paramters
float photogrammetry_sweep_angle = 0; // in rad
int photogrammetry_sidestep = 0;
int photogrammetry_triggerstep = 0;
int photogrammetry_height = 0;
// Photogrammetry Goals
int photogrammetry_sidelap; // Percent 0 - 100
int photogrammetry_overlap; // Percent 0 - 100
int photogrammetry_resolution; // Millimeter per pixel
// Safety Aspects
int photogrammetry_height_min;
int photogrammetry_height_max;
int photogrammetry_radius_min;
void init_photogrammetry_calculator(void)
{
photogrammetry_sweep_angle = PHOTOGRAMMETRY_SWEEP_ANGLE;
photogrammetry_sidelap = PHOTOGRAMMETRY_SIDELAP;
photogrammetry_overlap = PHOTOGRAMMETRY_OVERLAP;
photogrammetry_resolution = PHOTOGRAMMETRY_RESOLUTION;
photogrammetry_height_min = PHOTOGRAMMETRY_HEIGHT_MIN;
photogrammetry_height_max = PHOTOGRAMMETRY_HEIGHT_MAX;
photogrammetry_radius_min = PHOTOGRAMMETRY_RADIUS_MIN;
photogrammetry_calculator_update_camera2flightplan();
}
void photogrammetry_calculator_update_camera2flightplan(void)
{
// Photogrammetry Goals
float photogrammetry_sidelap_f = ((float) photogrammetry_sidelap) / 100.0f;
float photogrammetry_overlap_f = ((float) photogrammetry_overlap) / 100.0f;
// Linear Projection Camera Model
float viewing_ratio_height = ((float) PHOTOGRAMMETRY_SENSOR_HEIGHT) / ((float)PHOTOGRAMMETRY_FOCAL_LENGTH);
float viewing_ratio_width = ((float) PHOTOGRAMMETRY_SENSOR_WIDTH) / ((float)PHOTOGRAMMETRY_FOCAL_LENGTH);
float pixel_projection_width = viewing_ratio_width / ((float)PHOTOGRAMMETRY_PIXELS_WIDTH);
// Flightplan Variables
photogrammetry_height = ((float) photogrammetry_resolution) / pixel_projection_width / 1000.0f;
if (photogrammetry_height > photogrammetry_height_max) {
photogrammetry_height = photogrammetry_height_max;
} else if (photogrammetry_height < photogrammetry_height_min) {
photogrammetry_height = photogrammetry_height_min;
}
photogrammetry_sidestep = viewing_ratio_width * photogrammetry_height * (1.0f - photogrammetry_sidelap_f);
photogrammetry_triggerstep = viewing_ratio_height * photogrammetry_height * (1.0f - photogrammetry_overlap_f);
}
void photogrammetry_calculator_update_flightplan2camera(void)
{
// Linear Projection Camera Model
float viewing_ratio_height = ((float) PHOTOGRAMMETRY_SENSOR_HEIGHT) / ((float)PHOTOGRAMMETRY_FOCAL_LENGTH);
float viewing_ratio_width = ((float) PHOTOGRAMMETRY_SENSOR_WIDTH) / ((float)PHOTOGRAMMETRY_FOCAL_LENGTH);
float pixel_projection_width = viewing_ratio_width / ((float)PHOTOGRAMMETRY_PIXELS_WIDTH);
// Resolution <-> Height
photogrammetry_resolution = photogrammetry_height * 1000.0f * pixel_projection_width;
// Overlap <-> track width
photogrammetry_sidelap = 100.0f - photogrammetry_sidestep / viewing_ratio_width / photogrammetry_height * 100.0f;
photogrammetry_overlap = 100.0f - photogrammetry_triggerstep / viewing_ratio_height / photogrammetry_height * 100.0f;
}
@@ -0,0 +1,152 @@
/*
* Copyright (C) 2009 Christophe De Wagter
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
/** @file modules/cartography/photogrammetry_calculator.h
Add to airframe file:
@verbatim
<section name="Photogrammetry" prefix="PHOTOGRAMMETRY_">
<!-- Camera Parameters -->
<define name="FOCAL_LENGTH" value="35" unit="mm"/>
<define name="SENSOR_WIDTH" value="24" unit="mm"/> <!-- In direction of the plane's wings -->
<define name="SENSOR_HEIGHT" value="13.5" unit="mm"/> <!-- In direction of the plane's nose -->
<define name="PIXELS_WIDTH" value="1024" unit=""/>
<!-- Flight Safety Parameters -->
<define name="HEIGHT_MIN" value="35" unit="m"/>
<define name="HEIGHT_MAX" value="500" unit="m"/>
<define name="RADIUS_MIN" value="70" unit="m"/>
</section>
<modules>
<load name="photogrammetry_calculator.xml" />
</modules>
@endverbatim
Add to flightplan or airframe file:
@verbatim
<!-- Photogrammetry Parameters: define these in the flightplan-->
<define name="OVERLAP" value="0.5" unit="PROCENT"/>
<define name="SIDELAP" value="0.5" unit="PROCENT"/>
<define name="RESOLUTION" value="50" unit="mm pixel projection"/>
@endverbatim
Add to flightplan
@verbatim
<header>
#define PHOTOGRAMMETRY_SWEEP_ANGLE RadOfDeg(53) // angle in radians from the North
#define PHOTOGRAMMETRY_OVERLAP 50 // 1-99 Procent
#define PHOTOGRAMMETRY_SIDELAP 50 // 1-99 Procent
#define PHOTOGRAMMETRY_RESOLUTION 80 // mm pixel projection size
</header>
<block group="survey" name="Initialize Poly Survey 56789" strip_button="Survey5678" strip_icon="survey.png">
<call fun="PhotogrammetryCalculatorPolygonSurvey(WP_5, 5)"/>
<call fun="PolygonSurvey()"/>
</block>
<block group="survey" name="Initialize ADV Poly 1234 Survey" strip_button="SurveyADV" strip_icon="survey.png">
<call fun="PhotogrammetryCalculatorPolygonSurveyADV(WP_1, 4)"/>
<call fun="poly_survey_adv()"/>
</block>
@endverbatim
*/
#ifndef PHOTOGRAMMETRY_CALCULATOR_H
#define PHOTOGRAMMETRY_CALCULATOR_H
#include "std.h"
#include "paparazzi.h"
#include "modules/nav/nav_survey_poly_osam.h"
#include "modules/nav/nav_survey_polygon.h"
// Flightplan Variables
extern float photogrammetry_sweep_angle;
extern int photogrammetry_sidestep;
extern int photogrammetry_triggerstep;
extern int photogrammetry_height;
extern int photogrammetry_height_min;
extern int photogrammetry_height_max;
extern int photogrammetry_radius_min;
// Photogrammetry Goals
extern int photogrammetry_sidelap;
extern int photogrammetry_overlap;
extern int photogrammetry_resolution;
void init_photogrammetry_calculator(void);
void photogrammetry_calculator_update_camera2flightplan(void);
void photogrammetry_calculator_update_flightplan2camera(void);
// Update Flightplan on Camera Change
#define photogrammetry_calculator_UpdateSideLap(X) { \
photogrammetry_sidelap = X; \
photogrammetry_calculator_update_camera2flightplan(); \
}
#define photogrammetry_calculator_UpdateOverLap(X) { \
photogrammetry_overlap = X; \
photogrammetry_calculator_update_camera2flightplan(); \
}
#define photogrammetry_calculator_UpdateResolution(X) { \
photogrammetry_resolution = X; \
photogrammetry_calculator_update_camera2flightplan(); \
}
// Update Camera on Flightplan Change
#define photogrammetry_calculator_UpdateHeight(X) { \
photogrammetry_height = X; \
photogrammetry_calculator_update_flightplan2camera(); \
}
#define photogrammetry_calculator_UpdateSideStep(X) { \
photogrammetry_sidestep = X; \
photogrammetry_calculator_update_flightplan2camera(); \
}
#define photogrammetry_calculator_UpdateTriggerStep(X) { \
photogrammetry_triggerstep = X; \
photogrammetry_calculator_update_flightplan2camera(); \
}
// Flightplan Routine Wrappers
#define PhotogrammetryCalculatorPolygonSurveyOsam(_WP, _COUNT) { \
WaypointAlt(_WP) = photogrammetry_height + GROUND_ALT; \
int _ang = 90 - DegOfRad(photogrammetry_sweep_angle); \
while (_ang > 90) _ang -= 180; while (_ang < -90) _ang += 180; \
nav_survey_poly_osam_setup((_WP), (_COUNT), 2*photogrammetry_sidestep, _ang); \
}
#define PhotogrammetryCalculatorPolygonSurvey(_WP, _COUNT) { \
nav_survey_polygon_setup((_WP), (_COUNT), DegOfRad(photogrammetry_sweep_angle), \
photogrammetry_sidestep, photogrammetry_triggerstep, \
photogrammetry_radius_min, photogrammetry_height + GROUND_ALT); \
}
#endif