Skip to content

Commit

Permalink
Patched AC and Fligtplans to be compatible with latest XML syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Open UAS authored and Developer committed May 30, 2017
1 parent c2e44e8 commit 66fd002
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 33 deletions.
8 changes: 8 additions & 0 deletions Makefile
Expand Up @@ -311,6 +311,14 @@ test_coverity: all
# test AggieAir conf
test_aggieair: all
CONF_XML=conf/airframes/AGGIEAIR/aggieair_conf.xml prove tests/aircrafts/

# test Open UAS conf
test_openuas: all
CONF_XML=conf/userconf/OPENUAS/openuas_conf.xml prove tests/aircrafts/

# test TU Delft conf
test_tudelft: all
CONF_XML=conf/userconf/TUDELFT/tudelft_flyable_conf.xml prove tests/aircrafts/

# compiles all aircrafts in conf_tests.xml
test_examples: all
Expand Down
10 changes: 9 additions & 1 deletion conf/airframes/OPENUAS/openuas_moksha.xml
Expand Up @@ -117,8 +117,16 @@ make -C $PAPARAZZI_HOME -f Makefile.ac AIRCRAFT=Moksha ap.compile
<!-- </module>-->
<!-- Navigation modules-->
<module name="nav" type="drop"/>
<module name="nav" type="survey_polygon"/>
<module name="nav" type="line"/>
<module name="nav" type="line_border"/>
<module name="nav" type="line_osam"/>
<module name="nav" type="survey_polygon"/>
<module name="nav" type="survey_poly_osam"/>
<module name="nav" type="smooth"/>
<module name="nav" type="vertical_raster"/>
<module name="nav" type="flower"/>
<module name="nav" type="bungee_takeoff"/>
<module name="nav" type="catapult"/>
<!-- to test, analyze performance etc.-->
<!-- module name="sys_mon"/> -->
<!--
Expand Down
23 changes: 22 additions & 1 deletion conf/airframes/OPENUAS/openuas_taxiiii.xml
Expand Up @@ -49,7 +49,12 @@
<modules>
<module name="gps" type="ubx_ucenter"/>
<module name="infrared_adc"/>
<module name="ahrs_infrared"/>
<module name="ahrs_infrared"/>

<module name="digital_cam">
<!-- <define name="DC_SHUTTER_GPIO" value="CAM_SWITCH_GPIO"/>--><!-- Not compiling ATM -->
<define name="DC_SHUTTER_GPIO" value="GPIOB,GPIO22"/>
</module>
<!--
<module name="sys_mon"/>
-->
Expand All @@ -70,6 +75,17 @@
<configure name="ADC_CHANNEL_GENERIC1" value="ADC_7"/>
</module>
-->
<module name="nav" type="line"/>
<module name="nav" type="line_border"/>
<module name="nav" type="line_osam"/>
<module name="nav" type="survey_polygon"/>
<module name="nav" type="survey_poly_osam"/>
<module name="nav" type="smooth"/>
<module name="nav" type="vertical_raster"/>
<module name="nav" type="flower"/>
<module name="nav" type="bungee_takeoff"/>
<module name="nav" type="catapult"/>

</modules>

<!-- Define here to which CONNECTOR NUMBER the servo is connected to, on the autopilot cicuit board -->
Expand Down Expand Up @@ -366,6 +382,11 @@ If not set before when you would enter home mode you had to flip a bit via the G
<define name="DEVICE_TYPE" value="PPRZ"/>
<define name="DEVICE_ADDRESS" value="...."/>
</section>

<section name="DIGITAL_CAMERA" prefix="DC_">
<define name="AUTOSHOOT_PERIOD" value="3" unit="sec"/>
<define name="AUTOSHOOT_DISTANCE_INTERVAL" value="70" unit="meter"/>
</section>

<!-- ******************************** SIMU ********************************* -->
<section name="SIMU">
Expand Down
6 changes: 3 additions & 3 deletions conf/flight_plans/OPENUAS/include_obc2014_mission.xml
Expand Up @@ -151,7 +151,7 @@ TST-3 = -26° 35' 23.2" * 151° 50' 45.9"
<!-- If datalink is lost for more than 10 seconds and we are in launched state -->

<!-- below for the real SnR --> <!-- TODO: if datalinkloss but still closeby move to commhold? strange better airfiledhome loiter IMHO -->
<exception cond="And((datalink_time/2) > 9, launch > 0) && (!AircraftIsBooting())" deroute="CommsHoldLoiter"/> <!-- deroute="AirfieldHomeLoiter"/> -->
<exception cond="And((datalink_time/2) > 9, autopilot.launch > 0) && (!AircraftIsBooting())" deroute="CommsHoldLoiter"/> <!-- deroute="AirfieldHomeLoiter"/> -->

<!-- <exception cond="if Joefoundandretunvalformticket deroute="Waitforjudges"/>-->

Expand Down Expand Up @@ -267,8 +267,8 @@ TST-3 = -26° 35' 23.2" * 151° 50' 45.9"
<block key="t" name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png">
<!-- <set value="3000" var="ap_state->commands[COMMAND_CAMBER]"/> -->
<set value="0" var="autopilot.kill_throttle"/>
<set value="1" var="launch"/>
<set value="0" var="autopilot_flight_time"/>
<set value="1" var="autopilot.launch"/>
<set value="0" var="autopilot.flight_time"/>
<call_once fun="AirbrakesOff()"/>
<set value="nav_airspeed_nominal_setting" var="v_ctl_auto_airspeed_setpoint"/>
<attitude pitch="nav_takeoff_pitch_setting" roll="0" throttle="1.0" until="MoreThan(NavBlockTime(), 2)" vmode="throttle"/>
Expand Down
8 changes: 4 additions & 4 deletions conf/flight_plans/OPENUAS/openuas_nav_modules_test.xml
Expand Up @@ -37,21 +37,21 @@
<exceptions/>
<blocks>
<block name="Wait GPS">
<set value="1" var="autopilot.kill_throttle"/>
<set value="true" var="autopilot.kill_throttle"/>
<while cond="!GpsFixValid()"/>
</block>
<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 10)"/>
<call_once fun="NavSetGroundReferenceHere()"/>
</block>
<block name="Holding point">
<set value="1" var="autopilot.kill_throttle"/>
<set value="true" var="autopilot.kill_throttle"/>
<attitude roll="0" throttle="0" vmode="throttle"/>
</block>
<block group="home" key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
<set value="0" var="autopilot.kill_throttle"/>
<set value="0" var="autopilot_flight_time"/>
<set value="false" var="autopilot.kill_throttle"/>
<set value="0" var="autopilot.flight_time"/>
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
</block>
<block group="home" key="Control+a" name="Standby" strip_button="Standby" strip_icon="home.png">
Expand Down
6 changes: 2 additions & 4 deletions conf/flight_plans/OPENUAS/openuas_rotorcraft_simple.xml
Expand Up @@ -11,7 +11,6 @@ Your safe aircraft operation is *your* responsibility
<!-- Default flightplan alt set to 30m. This hight makes it fly over most of trees in this world by default. Security height 15m a tradeof between telemetry loss, airframe damage and avarage small building and hill height -->
<flight_plan alt="230" ground_alt="200" lat0="50.799999" lon0="7.566666" max_dist_from_home="100" name="Parrot Simple" security_height="15">
<header>

//Set Generic options
#include "autopilot.h"
//Enable AHRS Health test functions
Expand All @@ -21,7 +20,6 @@ Your safe aircraft operation is *your* responsibility
//Enable datalink tests
#include "subsystems/datalink/datalink.h"
#include "firmwares/rotorcraft/guidance/guidance_v.h"

</header>

<waypoints>
Expand All @@ -38,7 +36,7 @@ Your safe aircraft operation is *your* responsibility
<!-- <exception cond="electrical.bat_low && !(nav_block == IndexOfBlock('Setting home location')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('Land')) && !(nav_block == IndexOfBlock('Emergency'))" deroute="Land"/>-->
<exception cond="electrical.bat_critical && !(nav_block == IndexOfBlock('Setting home location')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('Land')) && !(nav_block == IndexOfBlock('Emergency'))" deroute="Emergency"/>
<!-- No connection for some time in flight, then try to land -->
<exception cond="autopilot_in_flight && datalink_time > 55 && !(nav_block == IndexOfBlock('Setting home location')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('Land')) && !(nav_block == IndexOfBlock('Emergency'))" deroute="Land"/>
<exception cond="autopilot_in_flight() && datalink_time > 55 && !(nav_block == IndexOfBlock('Setting home location')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('Land')) && !(nav_block == IndexOfBlock('Emergency'))" deroute="Land"/>
<!-- If somehow the AC isVALUEVALUE higher than initial ground position plus 60m, just land -->
<!--tofix only in flight <exception cond="GetPosAlt() > (GetAltRef() + 60)" deroute="Land"/> -->
<!-- No link for 20 seconds and no GPS valid position fix, but the AC can still hover...however no option to give commands, emergency landing -->
Expand Down Expand Up @@ -90,7 +88,7 @@ Altough Switching the mode to auto2/NAV from any other mode will reset nav_headi
<call_once fun="NavResurrect()"/><!-- Ressurect again, since sometimes once is not enough and motors will not start spinning -->
<!-- TODO improve try takeof 5 times than give up an go to Holding point, something stuck in the prop, a finger maybe ;)-->
<!-- <exception cond="!autopilot_motors_on" deroute="Takeoff"/>-->
<set value="0" var="autopilot_flight_time"/>
<set value="0" var="autopilot.flight_time"/>
<!-- If take-off to first point takes to long to reach somehow because of some reason, abort flight -->
<!-- todo test various times -->
<exception cond="block_time > 560" deroute="Land"/>
Expand Down
21 changes: 11 additions & 10 deletions conf/flight_plans/OPENUAS/openuas_tuning_a_fresh_fixedwing.xml
Expand Up @@ -137,8 +137,8 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a

<!-- The header section allows one to include advanced navigation routines and header files that allow access to variables that may be useful for exceptions or advanced flightplan routines dependent on various internal autopilot variables -->
<header>
#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
#include "subsystems/datalink/datalink.h"
#include "state.h"
</header>
<!-- The waypoints section must contain 1 or more waypoints. For tuning, setup STDBY in a location in front of the pilot at least DEFAULT_CIRCLE_RADIUS metres away from the flight line if restricted to no overflights. Setup 1 and 2 in front of and to the left and right of the pilot, respectively. These are only used for testing ovals and eights after tuning. Again, waypoints should be at least a radius away from the flight line (probably 1.5xRadius) to prevent overflights. HOME can be set somewhere in the vicinity of STDBY or the pilot. CLIMB is for takeoff (mostly for sim, should manually takeoff for tuning)-->
<waypoints>
Expand Down Expand Up @@ -173,9 +173,10 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a
</block>
<!-- need this for simulation, manual takeoff for real testing -->
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png" group="home">
<exception cond="estimator_z > (ground_alt+25)" deroute="Standby"/>
<exception cond="GetPosAlt() > (ground_alt+25)" deroute="Standby"/>
<set value="0" var="autopilot.kill_throttle"/>
<set value="0" var="estimator_flight_time"/>
<set value="1" var="autopilot.launch"/>
<set value="0" var="autopilot.flight_time"/>
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
</block>
<block key="<Control>a" name="Standby" strip_button="Standby" strip_icon="home.png" group="home">
Expand Down Expand Up @@ -214,7 +215,7 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a
</while>
</block>
<block name="Descent Auto Throttle Tuning">
<while cond="estimator_z > (ground_alt + 25)">
<while cond="GetPosAlt() > (ground_alt + 25)">
<attitude roll="0.0" vmode="climb" climb="-V_CTL_ALTITUDE_MAX_CLIMB"/>
</while>
</block>
Expand Down Expand Up @@ -243,7 +244,7 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a
</while>
</block>
<block name="Descent Auto Pitch Tuning">
<while cond="estimator_z > (ground_alt + 25)">
<while cond="GetPosAlt() > (ground_alt + 25)">
<attitude roll="0.0" pitch="auto" throttle="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" vmode="climb" climb="-V_CTL_ALTITUDE_MAX_CLIMB"/>
</while>
</block>
Expand All @@ -262,7 +263,7 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a
nav_altitude = flight_altitude -> can be set in the flight params setting page
-->
<block name="Altitude Tuning">
<set var="flight_altitude" value="estimator_z"/>
<set var="flight_altitude" value="GetPosAlt()"/>
<while cond="TRUE">
<attitude roll="0.0" vmode="alt" alt="flight_altitude"/>
</while>
Expand All @@ -276,7 +277,7 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a
nav_throttle_setpoint = 9600*(V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE)
-->
<block name="Course Tuning">
<set var="nav_course" value="estimator_hspeed_dir"/>
<set var="nav_course" value="state.h_speed_dir_i"/>
<while cond="TRUE">
<heading course="nav_course" vmode="throttle" throttle="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" until="FALSE"/> <!--continues forever-->
</while>
Expand Down Expand Up @@ -333,8 +334,8 @@ perhaps a few global alt exceptions? But where do they deroute to assuming the a
<oval p1="1" p2="2" radius="nav_radius"/>
</block>
<block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png" group="base_pattern">
<call_once fun="nav_line_init()"/>
<call fun="nav_line(WP_1, WP_2, nav_radius)"/>
<call_once fun="nav_line_setup()"/>
<call fun="nav_line_run(WP_1, WP_2, nav_radius)"/>
</block>

</blocks>
Expand Down
12 changes: 6 additions & 6 deletions conf/userconf/OPENUAS/openuas_conf.xml
Expand Up @@ -7,7 +7,7 @@
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml settings/superbitrf.xml settings/nps.xml"
settings_modules="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 modules/air_data.xml modules/geo_mag.xml modules/gps_ubx_ucenter.xml"
settings_modules="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 modules/radio_control_superbitrf_rc.xml modules/air_data.xml modules/geo_mag.xml modules/gps_ubx_ucenter.xml"
gui_color="#fffffe72b9fd"
/>
<aircraft
Expand Down Expand Up @@ -38,9 +38,9 @@
airframe="airframes/OPENUAS/openuas_moksha.xml"
radio="radios/OPENUAS/openuas_mx22_cppm.xml"
telemetry="telemetry/default_fixedwing_imu_9k6.xml"
flight_plan="flight_plans/versatile_airspeed.xml"
flight_plan="flight_plans/OPENUAS/openuas_tuning_a_fresh_fixedwing.xml"
settings="settings/fixedwing_basic.xml"
settings_modules="modules/nav_basic_fw.xml modules/gps.xml modules/guidance_energy.xml modules/stabilization_attitude_fw.xml"
settings_modules="modules/nav_catapult.xml modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/nav_basic_fw.xml modules/gps.xml modules/guidance_energy.xml modules/stabilization_attitude_fw.xml"
gui_color="#ffffeb519c78"
/>
<aircraft
Expand All @@ -49,7 +49,7 @@
airframe="airframes/OPENUAS/openuas_psi.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
flight_plan="flight_plans/OPENUAS/openuas_rotorcraft_simple.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/air_data.xml modules/gps_ubx_ucenter.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="#fffffe72b9fd"
Expand All @@ -71,9 +71,9 @@
airframe="airframes/OPENUAS/openuas_taxiiii.xml"
radio="radios/OPENUAS/openuas_mx22.xml"
telemetry="telemetry/default_fixedwing_imu_9k6.xml"
flight_plan="flight_plans/basic.xml"
flight_plan="flight_plans/OPENUAS/openuas_nav_modules_test.xml"
settings="settings/fixedwing_basic.xml"
settings_modules="modules/infrared_adc.xml modules/gps_ubx_ucenter.xml modules/nav_basic_fw.xml modules/gps.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml"
settings_modules="modules/nav_catapult.xml modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/digital_cam.xml modules/infrared_adc.xml modules/gps_ubx_ucenter.xml modules/nav_basic_fw.xml modules/gps.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml"
gui_color="#ffffeb519c78"
/>
<aircraft
Expand Down
68 changes: 68 additions & 0 deletions conf/userconf/TUDELFT/tudelft_flyable_conf.xml
@@ -0,0 +1,68 @@
<conf>
<aircraft
name="DelftaCopter"
ac_id="6"
airframe="airframes/TUDELFT/tudelft_outback.xml"
radio="radios/dummy.xml"
telemetry="telemetry/TUDELFT/tudelft_outback.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/gps_ubx_ucenter.xml modules/logger_sd_spi_direct.xml modules/temp_adc.xml modules/air_data.xml modules/geo_mag.xml modules/opa_controller.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_rate.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="#ffffdffac31f"
/>
<aircraft
name="Disco"
ac_id="16"
airframe="airframes/ENAC/fixed-wing/disco.xml"
radio="radios/T14SG_SBUS.xml"
telemetry="telemetry/default_fixedwing.xml"
flight_plan="flight_plans/basic.xml"
settings="settings/fixedwing_basic.xml"
settings_modules="modules/nav_basic_fw.xml modules/guidance_full_pid_fw.xml modules/stabilization_adaptive_fw.xml modules/air_data.xml modules/airspeed_ms45xx_i2c.xml modules/gps_ubx_ucenter.xml modules/gps.xml modules/ahrs_float_dcm.xml modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="MentorEnergy"
ac_id="1"
airframe="airframes/examples/MentorEnergy.xml"
radio="radios/R6107SP_7ch.xml"
telemetry="telemetry/default_fixedwing_imu.xml"
flight_plan="flight_plans/versatile_airspeed.xml"
settings="settings/fixedwing_basic.xml settings/estimation/ac_char.xml"
settings_modules="modules/digital_cam.xml modules/light.xml modules/gps_ubx_ucenter.xml modules/geo_mag.xml modules/air_data.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_energy.xml modules/stabilization_attitude_fw.xml modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml"
gui_color="white"
/>
<aircraft
name="SkyWalker"
ac_id="2"
airframe="airframes/TUDELFT/tudelft_yapa_xsens.xml"
radio="radios/R6107SP_7ch.xml"
telemetry="telemetry/default_fixedwing_imu_9k6.xml"
flight_plan="flight_plans/versatile.xml"
settings="settings/fixedwing_basic.xml settings/estimation/ins_neutrals.xml settings/control/tune_agr_climb.xml"
settings_modules="modules/digital_cam.xml modules/light.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml"
gui_color="#b748fe64fe64"
/>
<aircraft
name="Splash"
ac_id="67"
airframe="airframes/TUDELFT/tudelft_splash.xml"
radio="radios/spektrum.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/TUDELFT/tudelft_delft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/spektrum_soft_bind.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_ubx_ucenter.xml modules/gps.xml modules/imu_common.xml"
gui_color="#fff0cccaccca"
/>
<aircraft
name="quadshot"
ac_id="7"
airframe="airframes/examples/quadshot_asp21_spektrum.xml"
radio="radios/cockpitSX.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/TUDELFT/tudelft_delft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/ahrs_int_cmpl_quat.xml modules/guidance_hybrid.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml modules/gps_ubx_ucenter.xml"
gui_color="blue"
/>
</conf>
2 changes: 1 addition & 1 deletion sw/airborne/link_mcu_can.c
Expand Up @@ -213,7 +213,7 @@ static void send_fbw_status(struct transport_tx *trans, struct link_device *dev)

void link_mcu_init(void)
{
ppz_can_init(link_mcu_on_can_msg);
ppz_can_init((can_rx_callback_t)link_mcu_on_can_msg);

#ifdef AP
#if PERIODIC_TELEMETRY
Expand Down

0 comments on commit 66fd002

Please sign in to comment.