| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,304 @@ | ||
| <?xml version="1.0"?> | ||
| <!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd"> | ||
| <flight_plan alt="148" ground_alt="118" lat0="50.9097" lon0="6.22823" max_dist_from_home="610" name="IMAV2023" security_height="10"> | ||
|
|
||
| <header> | ||
| #define FP_NONE 0 | ||
| #define FP_ENDURANCE 1 | ||
| #define FP_MAPPING 2 | ||
| #define FP_DYNAMIC 3 | ||
| #define FP_HICKERS 4 | ||
|
|
||
| #ifdef NAV_C | ||
| #ifndef TAG_TRACKING_COORD_TO_M | ||
| #define TAG_TRACKING_COORD_TO_M (1.f / 1000.f) | ||
| #ifdef SITL | ||
| #define jevois_stream(_x) {} | ||
| #endif | ||
| #endif | ||
|
|
||
| #if DIGITAL_CAM | ||
| #define LINE_START_FUNCTION dc_Survey(fp_shot_distance); | ||
| #define LINE_STOP_FUNCTION dc_autoshoot = DC_AUTOSHOOT_STOP; | ||
| #endif | ||
|
|
||
| static void fp_tag_cb(uint8_t sender_id UNUSED, | ||
| uint8_t type, char * id UNUSED, | ||
| uint8_t nb UNUSED, int16_t * coord, uint16_t * dim UNUSED, | ||
| struct FloatQuat quat UNUSED, char * extra UNUSED) | ||
| { | ||
| if (type == JEVOIS_MSG_D3) { | ||
| tag_distance = coord[2] * TAG_TRACKING_COORD_TO_M; | ||
| tag_valid = true; | ||
| } | ||
| } | ||
|
|
||
| static inline bool delay_test_rc(bool test, int delay) { | ||
| static int nb = 0; | ||
| if (test) { | ||
| nb++; | ||
| if (nb == delay) { | ||
| nb = 0; | ||
| return true; | ||
| } | ||
| return false; | ||
| } else { | ||
| nb = 0; | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| #endif | ||
| </header> | ||
| <waypoints> | ||
| <waypoint lat="50.9099" lon="6.22682" name="HOME"/> | ||
| <waypoint lat="50.9097" lon="6.22773" name="STDBY"/> | ||
| <waypoint lat="50.9097" lon="6.22823" name="LANDPAD"/> | ||
| <waypoint lat="50.908377" lon="6.222250" name="TAG"/> | ||
| <waypoint lat="50.909228" lon="6.226700" name="HICKERS"/> | ||
| <waypoint lat="50.9110" lon="6.22635" name="S1"/> | ||
| <waypoint lat="50.9071" lon="6.22589" name="S2"/> | ||
| <waypoint lat="50.9072" lon="6.22426" name="S3"/> | ||
| <waypoint lat="50.9111" lon="6.22465" name="S4"/> | ||
| <waypoint lat="50.910595" lon="6.227356" name="START_DYN"/> | ||
| <waypoint lat="50.9113" lon="6.22717" name="D1"/> | ||
| <waypoint lat="50.9120" lon="6.22760" name="D2"/> | ||
| <waypoint lat="50.9120" lon="6.22883" name="D3"/> | ||
| <waypoint lat="50.9116" lon="6.22870" name="D4"/> | ||
| <waypoint lat="50.9103" lon="6.22656" name="ENDURANCE"/> | ||
|
|
||
| <waypoint lat="50.906886" lon="6.223927" name="_FLY1"/> | ||
| <waypoint lat="50.910946" lon="6.223798" name="_FLY2"/> | ||
| <waypoint lat="50.913247" lon="6.226908" name="_FLY3"/> | ||
| <waypoint lat="50.912701" lon="6.229972" name="_FLY4"/> | ||
| <waypoint lat="50.912425" lon="6.230648" name="_FLY5"/> | ||
| <waypoint lat="50.911652" lon="6.231214" name="_FLY6"/> | ||
| <waypoint lat="50.911392" lon="6.229977" name="_FLY7"/> | ||
| <waypoint lat="50.910842" lon="6.229131" name="_FLY8"/> | ||
| <waypoint lat="50.909282" lon="6.228386" name="_FLY9"/> | ||
| <waypoint lat="50.908253" lon="6.226671" name="_FLY10"/> | ||
| <waypoint lat="50.907502" lon="6.226436" name="_FLY11"/> | ||
| <waypoint lat="50.907083" lon="6.226495" name="_FLY12"/> | ||
| <waypoint lat="50.906788" lon="6.226718" name="_FLY13"/> | ||
| <waypoint lat="50.906549" lon="6.226418" name="_FLY14"/> | ||
|
|
||
| <waypoint lat="50.906376" lon="6.223196" name="_KILL1"/> | ||
| <waypoint lat="50.910998" lon="6.223086" name="_KILL2"/> | ||
| <waypoint lat="50.913740" lon="6.226769" name="_KILL3"/> | ||
| <waypoint lat="50.913135" lon="6.230278" name="_KILL4"/> | ||
| <waypoint lat="50.912821" lon="6.231021" name="_KILL5"/> | ||
| <waypoint lat="50.912073" lon="6.231793" name="_KILL6"/> | ||
| <waypoint lat="50.911361" lon="6.231674" name="_KILL7"/> | ||
| <waypoint lat="50.911074" lon="6.230432" name="_KILL8"/> | ||
| <waypoint lat="50.910664" lon="6.229780" name="_KILL9"/> | ||
| <waypoint lat="50.907942" lon="6.227214" name="_KILL10"/> | ||
| <waypoint lat="50.907432" lon="6.227156" name="_KILL11"/> | ||
| <waypoint lat="50.906610" lon="6.227501" name="_KILL12"/> | ||
| <waypoint lat="50.905917" lon="6.226675" name="_KILL13"/> | ||
| <waypoint lat="50.906223" lon="6.225644" name="_KILL14"/> | ||
|
|
||
| <waypoint lat="50.9109" lon="6.22871" name="_HERE"/> | ||
| </waypoints> | ||
| <sectors> | ||
| <sector color="green" name="Survey"> | ||
| <corner name="S1"/> | ||
| <corner name="S2"/> | ||
| <corner name="S3"/> | ||
| <corner name="S4"/> | ||
| </sector> | ||
| <sector color="orange" name="Flight_Area"> | ||
| <corner name="_FLY1"/> | ||
| <corner name="_FLY2"/> | ||
| <corner name="_FLY3"/> | ||
| <corner name="_FLY4"/> | ||
| <corner name="_FLY5"/> | ||
| <corner name="_FLY6"/> | ||
| <corner name="_FLY7"/> | ||
| <corner name="_FLY8"/> | ||
| <corner name="_FLY9"/> | ||
| <corner name="_FLY10"/> | ||
| <corner name="_FLY11"/> | ||
| <corner name="_FLY12"/> | ||
| <corner name="_FLY13"/> | ||
| <corner name="_FLY14"/> | ||
| </sector> | ||
| <sector color="red" name="Kill"> | ||
| <corner name="_KILL1"/> | ||
| <corner name="_KILL2"/> | ||
| <corner name="_KILL3"/> | ||
| <corner name="_KILL4"/> | ||
| <corner name="_KILL5"/> | ||
| <corner name="_KILL6"/> | ||
| <corner name="_KILL7"/> | ||
| <corner name="_KILL8"/> | ||
| <corner name="_KILL9"/> | ||
| <corner name="_KILL10"/> | ||
| <corner name="_KILL11"/> | ||
| <corner name="_KILL12"/> | ||
| <corner name="_KILL13"/> | ||
| <corner name="_KILL14"/> | ||
| </sector> | ||
| </sectors> | ||
| <variables> | ||
| <variable init="0" type="int" var="mission_nb"/> | ||
| <variable init="20." var="goto_height" min="0.5" max="15." step="0.1"/> | ||
| <variable init="7." var="goto_speed" min="0.5" max="10." step="0.1"/> | ||
| <variable init="5." var="takeoff_height" min="0.5" max="15." step="0.1"/> | ||
| <variable init="4." var="land_speed" min="0.5" max="10." step="0.1"/> | ||
| <variable init="40." var="mapping_height" min="0.5" max="15." step="0.1"/> | ||
| <variable init="40." var="mapping_sweep" min="5." max="20." step="0.1"/> | ||
| <variable init="7." var="mapping_speed" min="0.5" max="10." step="0.1"/> | ||
| <variable init="-1." var="mapping_radius" min="-1." max="100." step="1.0"/> | ||
| <variable init="10." var="endurance_speed" min="0.5" max="20." step="0.1"/> | ||
| <variable init="100." var="endurance_radius" min="20" max="150." step="1.0"/> | ||
| <variable init="500" type="int" var="endurance_time" min="1" max="1200" step="1"/> | ||
| <variable init="30." var="hickers_radius" min="-60." max="60." step="1.0"/> | ||
| <variable init="42." var="tag_distance"/> | ||
| <variable init="false" type="bool" var="tag_valid"/> | ||
| <abi_binding name="JEVOIS_MSG" handler="fp_tag_cb"/> | ||
| </variables> | ||
| <modules> | ||
| <module name="nav" type="takeoff_and_landing"/> | ||
| <module name="nav" type="survey_hybrid"> | ||
| <define name="SURVEY_HYBRID_MAX_SWEEP_BACK" value="1"/> | ||
| <define name="SURVEY_HYBRID_APPROACHING_TIME" value="0"/> | ||
| <define name="SURVEY_HYBRID_ENTRY_DISTANCE" value="survey_private.sweep_distance"/> | ||
| </module> | ||
| <module name="tag_tracking"> | ||
| <define name="TAG_TRACKING_WP" value="WP_LANDPAD"/> | ||
| <define name="TAG_TRACKING_SIM_WP" value="WP_TAG"/> | ||
| </module> | ||
| <module name="dynamic_inspection_imav2023"/> | ||
| </modules> | ||
| <exceptions> | ||
| <exception cond="(!InsideFlight_Area(GetPosX(), GetPosY()) @OR GetPosAlt() @GT GetAltRef() + 100) @AND (nav_block @GT IndexOfBlock('Standby')) @AND (nav_block @LT IndexOfBlock('Kill landed'))" deroute="Standby"/> | ||
| <exception cond="(!InsideKill(GetPosX(), GetPosY()) @OR GetPosAlt() @GT GetAltRef() + 120) @AND (nav_block == IndexOfBlock('Standby'))" deroute="Kill landed"/> | ||
| <exception cond="(nav_block @GT IndexOfBlock('Standby') @AND nav_block @LT IndexOfBlock('Kill landed')) @AND (GpsIsLost() @AND delay_test_rc(RadioControlIsLost(),20) @AND (datalink_time @GT 20))" deroute="Kill landed"/> | ||
| <exception cond="(nav_block @GT IndexOfBlock('Standby') @AND nav_block @LT IndexOfBlock('Kill landed')) @AND (delay_test_rc(RadioControlIsLost(),20) @AND (datalink_time @GT 15))" deroute="Land here"/> | ||
| </exceptions> | ||
| <blocks> | ||
| <block name="Wait GPS"> | ||
| <call_once fun="NavKillThrottle()"/> | ||
| <call_once fun="jevois_stream(false)"/> | ||
| <while cond="!GpsFixValid()"/> | ||
| </block> | ||
| <block name="Geo init"> | ||
| <while cond="LessThan(NavBlockTime(), 10)"/> | ||
| </block> | ||
| <block name="Holding point" strip_button="H. Point" group="home"> | ||
| <call_once fun="NavKillThrottle()"/> | ||
| <attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/> | ||
| </block> | ||
| <block name="Start Engine"> | ||
| <call_once fun="NavResurrect()"/> | ||
| <attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/> | ||
| </block> | ||
| <block name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png" group="home"> | ||
| <exception cond="GetPosHeight() @GT takeoff_height @AND mission_nb == FP_NONE" deroute="Standby"/> | ||
| <exception cond="GetPosHeight() @GT takeoff_height @AND mission_nb == FP_ENDURANCE" deroute="Run Endurance"/> | ||
| <exception cond="GetPosHeight() @GT takeoff_height @AND mission_nb == FP_MAPPING" deroute="Goto Mapping"/> | ||
| <exception cond="GetPosHeight() @GT takeoff_height @AND mission_nb == FP_DYNAMIC" deroute="Goto Dynamic"/> | ||
| <exception cond="GetPosHeight() @GT takeoff_height @AND mission_nb == FP_HICKERS" deroute="Goto Hickers"/> | ||
| <call_once fun="ins_reset_vertical_pos()"/> | ||
| <call_once fun="NavResurrect()"/> | ||
| <attitude pitch="0" roll="0" throttle="0.1" until="stage_time @GT 2" vmode="throttle"/> | ||
| <call_once fun="NavSetWaypointHere(WP_LANDPAD)"/> | ||
| <stay climb="nav.climb_vspeed" vmode="climb" wp="LANDPAD"/> | ||
| </block> | ||
| <block name="Standby" strip_button="Standby" strip_icon="home.png" group="home"> | ||
| <set var="mission_nb" value="FP_NONE"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(land_speed)"/> | ||
| <stay wp="STDBY"/> | ||
| </block> | ||
|
|
||
| <block group="mission" name="Start Endurance" strip_button="Endurance"> | ||
| <set var="mission_nb" value="FP_ENDURANCE"/> | ||
| <deroute block="Takeoff"/> | ||
| </block> | ||
| <block group="mission" name="Start Mapping" strip_button="Mapping"> | ||
| <set var="mission_nb" value="FP_MAPPING"/> | ||
| <deroute block="Takeoff"/> | ||
| </block> | ||
| <block group="mission" name="Start Dynamic" strip_button="Dynamic"> | ||
| <set var="mission_nb" value="FP_DYNAMIC"/> | ||
| <deroute block="Takeoff"/> | ||
| </block> | ||
| <block group="mission" name="Start Area" strip_button="Hickers"> | ||
| <set var="mission_nb" value="FP_HICKERS"/> | ||
| <deroute block="Takeoff"/> | ||
| </block> | ||
|
|
||
| <block name="Run Endurance"> | ||
| <!-- exception cond="electrical.bat_low" deroute="Landing"/--> | ||
| <set var="mission_nb" value="FP_NONE"/> | ||
| <call_once fun="jevois_stream(false)"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(endurance_speed)"/> | ||
| <circle wp="ENDURANCE" radius="endurance_radius" until="stage_time @GT endurance_time"/> | ||
| <deroute block="Landing"/> | ||
| </block> | ||
|
|
||
| <block name="Goto Mapping"> | ||
| <set var="mission_nb" value="FP_NONE"/> | ||
| <call_once fun="NavSetWaypointHere(WP__HERE)"/> | ||
| <call_once fun="jevois_stream(false)"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(mapping_speed)"/> | ||
| <stay wp="_HERE" until="stage_time @GT 3" height="mapping_height"/> | ||
| <go wp="S1" from="_HERE" hmode="route" height="mapping_height"/> | ||
| <call_once fun="nav_survey_hybrid_setup_towards(WP_S1, WP_S2, 4, mapping_sweep, mapping_radius, mapping_height)"/> | ||
| <deroute block="Run Mapping"/> | ||
| </block> | ||
| <block name="Run Mapping"> | ||
| <call_once fun="guidance_h_SetMaxSpeed(mapping_speed)"/> | ||
| <call fun="nav_survey_hybrid_run()"/> | ||
| <deroute block="Landing"/> | ||
| </block> | ||
|
|
||
| <block name="Goto Dynamic"> | ||
| <set var="mission_nb" value="FP_NONE"/> | ||
| <call_once fun="NavSetWaypointHere(WP__HERE)"/> | ||
| <call_once fun="jevois_stream(false)"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(endurance_speed)"/> | ||
| <stay wp="_HERE" until="stage_time @GT 3" height="goto_height"/> | ||
| <go from="_HERE" hmode="route" wp="START_DYN" height="goto_height"/> | ||
| <call_once fun="dynamic_inspection_setup(WP_START_DYN, 4, endurance_speed)"/> | ||
| <deroute block="Run Dynamic"/> | ||
| </block> | ||
| <block name="Run Dynamic"> | ||
| <!--path wpts="START_DYN,D1,D2,D3,D4,START_DYN"/--> | ||
| <call fun="dynamic_inspection_run()"/> | ||
| <deroute block="Landing"/> | ||
| </block> | ||
|
|
||
| <block name="Goto Hickers"> | ||
| <set var="mission_nb" value="FP_NONE"/> | ||
| <call_once fun="NavSetWaypointHere(WP__HERE)"/> | ||
| <call_once fun="jevois_stream(false)"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(goto_speed)"/> | ||
| <circle wp="HICKERS" radius="hickers_radius" height="goto_height" until="NavCircleCount() @GT 1.0" pre_call="nav_set_heading_towards_waypoint(WP_HICKERS)"/> | ||
| <deroute block="Landing"/> | ||
| </block> | ||
|
|
||
| <block name="Land here" strip_button="Land here" strip_icon="land-right.png" group="land"> | ||
| <call_once fun="NavSetWaypointHere(WP_LANDPAD)"/> | ||
| </block> | ||
| <block name="Landing" strip_button="Land on pad" group="land"> | ||
| <call_once fun="jevois_stream(false)"/> | ||
| <call_once fun="NavSetWaypointHere(WP__HERE)"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(goto_speed)"/> | ||
| <go wp="LANDPAD" from="_HERE" hmode="route" height="goto_height"/> | ||
| </block> | ||
| <block name="Flare"> | ||
| <exception cond="!nav_is_in_flight()" deroute="Kill landed"/> | ||
| <call_once fun="guidance_h_SetMaxSpeed(land_speed)"/> | ||
| <call_once fun="jevois_stream(true)"/> | ||
| <stay climb="2*nav.descend_vspeed" vmode="climb" wp="LANDPAD" until="GetPosHeight() @LT 10"/> | ||
| <stay climb="nav.descend_vspeed" vmode="climb" wp="LANDPAD"/> | ||
| </block> | ||
| <block name="Kill landed"> | ||
| <call_once fun="NavKillThrottle()"/> | ||
| <attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/> | ||
| </block> | ||
|
|
||
| </blocks> | ||
|
|
||
| </flight_plan> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| <?xml version="1.0"?> | ||
| <!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"> | ||
| <flight_plan alt="215" ground_alt="185" lat0="43.46223" lon0="1.27289" max_dist_from_home="400" name="Muret test wind quad" security_height="1" wp_frame="ltp"> | ||
| <header> | ||
| #if DIGITAL_CAM | ||
| #define LINE_START_FUNCTION dc_Survey(20); | ||
| #define LINE_STOP_FUNCTION dc_autoshoot = DC_AUTOSHOOT_STOP; | ||
| #endif | ||
| </header> | ||
| <waypoints> | ||
| <waypoint name="HOME" x="-8.1" y="9.8"/> | ||
| <waypoint name="CLIMB" x="-28.0" y="29.0"/> | ||
| <waypoint name="STDBY" x="40.209" y="42.714"/> | ||
| <waypoint name="p1" x="67.492" y="32.136"/> | ||
| <waypoint name="p2" x="-35.356" y="78.947"/> | ||
| <waypoint name="p3" x="-16.718" y="133.25"/> | ||
| <waypoint name="p4" x="90.03" y="73.004"/> | ||
| <waypoint name="TD" x="31.809" y="46.501"/> | ||
| <waypoint name="_FLY1" x="-120.135" y="264.94"/> | ||
| <waypoint name="_FLY2" x="299.403" y="176.814"/> | ||
| <waypoint name="_FLY3" x="236.684" y="-88.655"/> | ||
| <waypoint name="_FLY4" x="-210.99" y="29.788"/> | ||
| <waypoint name="_KILL1" x="-130.009" y="292.981"/> | ||
| <waypoint name="_KILL2" x="324.67" y="196.132"/> | ||
| <waypoint name="_KILL3" x="256.662" y="-119.374"/> | ||
| <waypoint name="_KILL4" x="-251.128" y="10.603"/> | ||
| </waypoints> | ||
| <sectors> | ||
| <sector color="lime" name="Flight_Area"> | ||
| <corner name="_FLY1"/> | ||
| <corner name="_FLY2"/> | ||
| <corner name="_FLY3"/> | ||
| <corner name="_FLY4"/> | ||
| </sector> | ||
| <sector color="red" name="Kill"> | ||
| <corner name="_KILL1"/> | ||
| <corner name="_KILL2"/> | ||
| <corner name="_KILL3"/> | ||
| <corner name="_KILL4"/> | ||
| </sector> | ||
| </sectors> | ||
| <modules> | ||
| <module name="nav" type="takeoff_and_landing"/> | ||
| </modules> | ||
| <exceptions> | ||
| <!--exception cond="Or(!InsideFlight_Area(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 50) @AND (nav_block >= IndexOfBlock('Takeoff')) @AND !(nav_block == IndexOfBlock('Kill landed'))" deroute="Standby"/--> | ||
| </exceptions> | ||
| <blocks> | ||
| <block name="Wait GPS"> | ||
| <call_once fun="NavKillThrottle()"/> | ||
| <while cond="!GpsFixValid()"/> | ||
| </block> | ||
| <block name="Geo init"> | ||
| <while cond="LessThan(NavBlockTime(), 10)"/> | ||
| <call_once fun="NavSetAltitudeReferenceHere()"/> | ||
| </block> | ||
| <block name="Holding point"> | ||
| <call_once fun="NavKillThrottle()"/> | ||
| <attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/> | ||
| </block> | ||
| <block name="Start Engine"> | ||
| <call_once fun="NavResurrect()"/> | ||
| <attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/> | ||
| </block> | ||
| <block name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png"> | ||
| <exception cond="GetPosHeight() @GT 10.0" deroute="Standby"/> | ||
| <call_once fun="NavSetWaypointHere(WP_CLIMB)"/> | ||
| <call_once fun="NavResurrect()"/> | ||
| <attitude pitch="0" roll="0" throttle="0" until="stage_time @GT 1" vmode="throttle"/> | ||
| <stay climb="nav.climb_vspeed" vmode="climb" wp="CLIMB"/> | ||
| </block> | ||
| <block name="Takeoff (module)" strip_button="Takeoff (module)" group="module"> | ||
| <call fun="nav_takeoff_from_here()"/> | ||
| <deroute block="Standby"/> | ||
| </block> | ||
| <!--block name="Standby" pre_call="if(!InsideKill(GetPosX(), GetPosY())) NavKillThrottle();" strip_button="Standby" strip_icon="home.png"--> | ||
| <block name="Standby" strip_button="Standby" strip_icon="home.png"> | ||
| <stay wp="STDBY"/> | ||
| </block> | ||
| <block name="stay_p1"> | ||
| <stay wp="p1"/> | ||
| </block> | ||
| <block name="line_p1_p2"> | ||
| <stay wp="p1" until="stage_time @GT 5"/> | ||
| <go wp="p2" from="p1" hmode="route"/> | ||
| <stay wp="p2"/> | ||
| </block> | ||
| <block name="square"> | ||
| <go wp="p1"/> | ||
| <path wpts="p1,p2,p3,p4,p1"/> | ||
| <deroute block="stay_p1"/> | ||
| </block> | ||
| <block name="circle"> | ||
| <circle radius="nav.radius" wp="STDBY"/> | ||
| </block> | ||
| <block name="oval"> | ||
| <oval p1="p2" p2="p1" radius="nav.radius"/> | ||
| </block> | ||
| <block name="Carto Oval" strip_button="Carto Oval"> | ||
| <oval p1="p2" p2="p1" radius="nav.radius" until="NavOvalCount @GEQ 2"/> | ||
| <oval p1="p3" p2="p4" radius="nav.radius" until="NavOvalCount @GEQ 2"/> | ||
| <deroute block="Standby"/> | ||
| </block> | ||
| <block name="Land (module)" strip_button="Land (module)" group="module"> | ||
| <call fun="nav_land_at_wp(WP_TD, WP_TD, 0.)"/> | ||
| <deroute block="Kill landed"/> | ||
| </block> | ||
| <block name="land here" strip_button="Land Here" strip_icon="land-right.png"> | ||
| <call_once fun="NavSetWaypointHere(WP_TD)"/> | ||
| </block> | ||
| <block name="land"> | ||
| <go wp="TD"/> | ||
| </block> | ||
| <block name="flare"> | ||
| <exception cond="!nav_is_in_flight()" deroute="Kill landed"/> | ||
| <stay climb="nav.descend_vspeed" vmode="climb" wp="TD"/> | ||
| </block> | ||
| <block name="Kill landed"> | ||
| <attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/> | ||
| </block> | ||
| </blocks> | ||
| </flight_plan> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <!DOCTYPE airframe SYSTEM "../airframes/airframe.dtd"> | ||
|
|
||
| <airframe> | ||
| <description> | ||
| Germany / Aachen | ||
| 50.9097° N, 6.22823° W | ||
| Date Declination (+ E|-W) Inclination (+D|-U) Horizontal Intensity North Comp (+N|-S) East Comp (+E|-W) Vertical Comp (+D|-U) Total Field | ||
| 2023-08-17 -1.3339° 65.7508° 19,995.7 nT 19,990.2 nT -465.5 nT 44,390.4 nT 48,686.0 nT | ||
| </description> | ||
| <section name="MAG_MODEL" prefix="INS_"> | ||
| <define name="H_X" value="0.410594"/> | ||
| <define name="H_Y" value="-0.00956127"/> | ||
| <define name="H_Z" value="0.911769"/> | ||
| </section> | ||
| </airframe> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <!DOCTYPE module SYSTEM "module.dtd"> | ||
| <module name="dynamic_inspection_imav2023" dir="nav" task="control"> | ||
| <doc> | ||
| <description> | ||
| Compute and fly sequence of waypoints to maximize the score at IMAV2023, task 3 | ||
| </description> | ||
| </doc> | ||
| <dep> | ||
| <depends>math</depends> | ||
| </dep> | ||
| <header> | ||
| <file name="dynamic_inspection_imav2023.h"/> | ||
| </header> | ||
| <init fun="dynamic_inspection_init()"/> | ||
| <makefile> | ||
| <file name="dynamic_inspection_imav2023.c"/> | ||
| <test firmware="rotorcraft"/> | ||
| </makefile> | ||
| </module> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <!DOCTYPE module SYSTEM "module.dtd"> | ||
| <module name="eff_scheduling_falcon" dir="ctrl"> | ||
| <doc> | ||
| <description> | ||
| Interpolation of control effectivenss matrix of the Falcon hybride plane | ||
| </description> | ||
| </doc> | ||
|
|
||
| <header> | ||
| <file name="eff_scheduling_falcon.h"/> | ||
| </header> | ||
| <init fun="ctrl_eff_scheduling_init()"/> | ||
| <periodic fun="ctrl_eff_scheduling_periodic()" freq="20.0"/> | ||
| <periodic fun="ctrl_eff_scheduling_report()" freq="0.5" autorun="FALSE"/> <!-- TRUE FALSE--> | ||
| <makefile target="ap|nps" firmware="rotorcraft" > | ||
| <file name="eff_scheduling_falcon.c"/> | ||
| </makefile> | ||
| </module> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| <aerodynamics> | ||
|
|
||
| <axis name="YAW"> | ||
| <function name="elevon_yaw" frame="BODY" unit="FT*LBS"> | ||
| <sum> | ||
| <product> | ||
| <property>fcs/ele_left_lag</property> | ||
| <value> -0.35 </value> | ||
| </product> | ||
| <product> | ||
| <property>fcs/ele_right_lag</property> | ||
| <value> -.35 </value> | ||
| </product> | ||
| </sum> | ||
| </function> | ||
| </axis> | ||
|
|
||
| <axis name="PITCH"> | ||
| <function name="elevon_pitch" frame="BODY" unit="FT*LBS"> | ||
| <sum> | ||
| <product> | ||
| <property>fcs/ele_left_lag</property> | ||
| <value> -0.0417 </value> | ||
| </product> | ||
| <product> | ||
| <property>fcs/ele_right_lag</property> | ||
| <value> .0417 </value> | ||
| </product> | ||
| </sum> | ||
| </function> | ||
| </axis> | ||
|
|
||
| <axis name="LIFT"> | ||
|
|
||
| <function name="aero/force/Lift_alpha"> | ||
| <description>Lift due to alpha</description> | ||
| <product> | ||
| <property>aero/qbar-psf</property> | ||
| <property>metrics/Sw-sqft</property> | ||
| <table> | ||
| <independentVar lookup="row">aero/alpha-deg</independentVar> | ||
| <tableData> | ||
| -180 0.14 | ||
| -140 -0.80 | ||
| -110 -0.63 | ||
| -102 -0.74 | ||
| -98 -0.64 | ||
| -90 0.0 | ||
| -85 0.15 | ||
| -80 0.25 | ||
| -75 0.42 | ||
| 0 0.0 | ||
| 45 0.8 | ||
| 90 0.0 | ||
| 135 -0.8 | ||
| 180 0.0 | ||
| </tableData> | ||
| </table> | ||
| </product> | ||
| </function> | ||
|
|
||
| </axis> | ||
|
|
||
| <axis name="DRAG"> | ||
|
|
||
| <function name="aero/force/Drag_basic"> | ||
| <description>Drag</description> | ||
| <product> | ||
| <property>aero/qbar-psf</property> | ||
| <property>metrics/Sw-sqft</property> | ||
| <table> | ||
| <independentVar lookup="row">aero/alpha-deg</independentVar> | ||
| <tableData> | ||
| -180 1.7 | ||
| -160 1.62 | ||
| -100 0.4 | ||
| -90 0.15 | ||
| -85 0.17 | ||
| -75 0.22 | ||
| -70 0.33 | ||
| -65 0.6128 | ||
| -20 1.36 | ||
| -4 1.45 | ||
| 15 1.35 | ||
| 30 1.12 | ||
| </tableData> | ||
| </table> | ||
| <value>2.0</value> <!-- FIXME why this factor 2 ? --> | ||
| </product> | ||
| </function> | ||
|
|
||
| </axis> | ||
|
|
||
| <axis name="SIDE"> | ||
|
|
||
| <function name="aero/force/Side_beta"> | ||
| <description>Side force due to beta</description> | ||
| <product> | ||
| <property>aero/qbar-psf</property> | ||
| <property>metrics/Sw-sqft</property> | ||
| <property>aero/beta-rad</property> | ||
| <!--value>-4</value--> | ||
| <value>0.02</value> | ||
| </product> | ||
| </function> | ||
|
|
||
| </axis> | ||
|
|
||
| </aerodynamics> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,394 @@ | ||
| <?xml version="1.0"?> | ||
| <?xml-stylesheet type="text/xsl" href="http://jsbsim.sourceforge.net/JSBSim.xsl"?> | ||
| <fdm_config name="QUAD COMPLETE EXT" version="2.0" release="BETA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> | ||
|
|
||
| <fileheader> | ||
| <author>ENAC</author> | ||
| <filecreationdate>09-06-2022</filecreationdate> | ||
| <version>Version 0.92 - beta</version> | ||
| <description>Falcon</description> | ||
| </fileheader> | ||
|
|
||
| <metrics> | ||
| <wingarea unit="M2"> 0.075 </wingarea> | ||
| <wingspan unit="M"> 0.9 </wingspan> | ||
| <chord unit="M"> 0.12 </chord> | ||
| <htailarea unit="M2"> 0 </htailarea> | ||
| <htailarm unit="M"> 0 </htailarm> | ||
| <vtailarea unit="M2"> 0 </vtailarea> | ||
| <vtailarm unit="M"> 0 </vtailarm> | ||
| <wing_incidence unit="DEG"> 90 </wing_incidence> | ||
| <location name="AERORP" unit="M"> | ||
| <x> 0 </x> | ||
| <y> 0 </y> | ||
| <z> 0 </z> | ||
| </location> | ||
| <location name="EYEPOINT" unit="M"> | ||
| <x> 0 </x> | ||
| <y> 0 </y> | ||
| <z> 0 </z> | ||
| </location> | ||
| <location name="VRP" unit="M"> | ||
| <x> 0 </x> | ||
| <y> 0 </y> | ||
| <z> 0 </z> | ||
| </location> | ||
| </metrics> | ||
|
|
||
| <mass_balance> | ||
| <ixx unit="KG*M2"> 0.005 </ixx> | ||
| <iyy unit="KG*M2"> 0.005 </iyy> | ||
| <izz unit="KG*M2"> 0.015 </izz> | ||
| <ixy unit="KG*M2"> 0. </ixy> | ||
| <ixz unit="KG*M2"> 0. </ixz> | ||
| <iyz unit="KG*M2"> 0. </iyz> | ||
| <emptywt unit="KG"> 0.72 </emptywt> | ||
| <location name="CG" unit="M"> | ||
| <x> 0 </x> | ||
| <y> 0 </y> | ||
| <z> 0 </z> | ||
| </location> | ||
| </mass_balance> | ||
|
|
||
| <ground_reactions> | ||
| <contact type="STRUCTURE" name="CONTACT_FRONT"> | ||
| <location unit="M"> | ||
| <x> -0.12 </x> | ||
| <y> 0.0 </y> | ||
| <z>-0.1 </z> | ||
| </location> | ||
| <static_friction> 0.8 </static_friction> | ||
| <dynamic_friction> 0.5 </dynamic_friction> | ||
| <spring_coeff unit="N/M"> 500 </spring_coeff> | ||
| <damping_coeff unit="N/M/SEC"> 100 </damping_coeff> | ||
| <damping_coeff_rebound type="SQUARE" unit="N/M2/SEC2"> 1000 </damping_coeff_rebound> | ||
| <max_steer unit="DEG"> 0.0 </max_steer> | ||
| <brake_group> NONE </brake_group> | ||
| <retractable>0</retractable> | ||
| </contact> | ||
|
|
||
| <contact type="STRUCTURE" name="CONTACT_BACK"> | ||
| <location unit="M"> | ||
| <x> 0.12</x> | ||
| <y> 0.0</y> | ||
| <z> -0.1</z> | ||
| </location> | ||
| <static_friction> 0.8 </static_friction> | ||
| <dynamic_friction> 0.5 </dynamic_friction> | ||
| <spring_coeff unit="N/M"> 500 </spring_coeff> | ||
| <damping_coeff unit="N/M/SEC"> 100 </damping_coeff> | ||
| <damping_coeff_rebound type="SQUARE" unit="N/M2/SEC2"> 1000 </damping_coeff_rebound> | ||
| <max_steer unit="DEG"> 0.0 </max_steer> | ||
| <brake_group> NONE </brake_group> | ||
| <retractable>0</retractable> | ||
| </contact> | ||
|
|
||
| <contact type="STRUCTURE" name="CONTACT_RIGHT"> | ||
| <location unit="M"> | ||
| <x> 0.0 </x> | ||
| <y> 0.12</y> | ||
| <z> -0.1 </z> | ||
| </location> | ||
| <static_friction> 0.8 </static_friction> | ||
| <dynamic_friction> 0.5 </dynamic_friction> | ||
| <spring_coeff unit="N/M"> 500 </spring_coeff> | ||
| <damping_coeff unit="N/M/SEC"> 100 </damping_coeff> | ||
| <damping_coeff_rebound type="SQUARE" unit="N/M2/SEC2"> 1000 </damping_coeff_rebound> | ||
| <max_steer unit="DEG"> 0.0 </max_steer> | ||
| <brake_group> NONE </brake_group> | ||
| <retractable>0</retractable> | ||
| </contact> | ||
|
|
||
| <contact type="STRUCTURE" name="CONTACT_LEFT"> | ||
| <location unit="M"> | ||
| <x> 0.0 </x> | ||
| <y>-0.12</y> | ||
| <z> -0.1 </z> | ||
| </location> | ||
| <static_friction> 0.8 </static_friction> | ||
| <dynamic_friction> 0.5 </dynamic_friction> | ||
| <spring_coeff unit="N/M"> 500 </spring_coeff> | ||
| <damping_coeff unit="N/M/SEC"> 100 </damping_coeff> | ||
| <damping_coeff_rebound type="SQUARE" unit="N/M2/SEC2"> 1000 </damping_coeff_rebound> | ||
| <max_steer unit="DEG"> 0.0 </max_steer> | ||
| <brake_group> NONE </brake_group> | ||
| <retractable>0</retractable> | ||
| </contact> | ||
| </ground_reactions> | ||
|
|
||
| <flight_control name="actuator_dynamics"> | ||
| <property value="30.">fcs/motor_lag</property> | ||
| <property value="54.">fcs/elevon_lag</property> | ||
|
|
||
| <channel name="filtering"> | ||
|
|
||
| <!--First order filter represents actuator dynamics--> | ||
| <lag_filter name="UR_lag"> | ||
| <input> fcs/UR </input> | ||
| <clipto> | ||
| <min>0</min> | ||
| <max>1</max> | ||
| </clipto> | ||
| <c1> fcs/motor_lag </c1> | ||
| <output> fcs/UR_lag</output> | ||
| </lag_filter> | ||
| <lag_filter name="BR_lag"> | ||
| <input> fcs/BR </input> | ||
| <clipto> | ||
| <min>0</min> | ||
| <max>1</max> | ||
| </clipto> | ||
| <c1> fcs/motor_lag </c1> | ||
| <output> fcs/BR_lag</output> | ||
| </lag_filter> | ||
| <lag_filter name="BL_lag"> | ||
| <input> fcs/BL </input> | ||
| <clipto> | ||
| <min>0</min> | ||
| <max>1</max> | ||
| </clipto> | ||
| <c1> fcs/motor_lag </c1> | ||
| <output> fcs/BL_lag</output> | ||
| </lag_filter> | ||
| <lag_filter name="UL_lag"> | ||
| <input> fcs/UL </input> | ||
| <clipto> | ||
| <min>0</min> | ||
| <max>1</max> | ||
| </clipto> | ||
| <c1> fcs/motor_lag </c1> | ||
| <output> fcs/UL_lag</output> | ||
| </lag_filter> | ||
|
|
||
| <lag_filter name="ele_left_lag"> | ||
| <input> fcs/ele_left </input> | ||
| <c1> fcs/elevon_lag </c1> | ||
| <output> fcs/ele_left_lag</output> | ||
| </lag_filter> | ||
| <lag_filter name="ele_right_lag"> | ||
| <input> fcs/ele_right </input> | ||
| <c1> fcs/elevon_lag </c1> | ||
| <output> fcs/ele_right_lag</output> | ||
| </lag_filter> | ||
| </channel> | ||
| </flight_control> | ||
|
|
||
| <external_reactions> | ||
|
|
||
| <property>fcs/UR</property> | ||
| <property>fcs/BR</property> | ||
| <property>fcs/BL</property> | ||
| <property>fcs/UL</property> | ||
| <property>fcs/UR_lag</property> | ||
| <property>fcs/BR_lag</property> | ||
| <property>fcs/BL_lag</property> | ||
| <property>fcs/UL_lag</property> | ||
| <property>fcs/ele_left</property> | ||
| <property>fcs/ele_left_lag</property> | ||
| <property>fcs/ele_right</property> | ||
| <property>fcs/ele_right_lag</property> | ||
|
|
||
| <property value="6.">fcs/motor_max_thrust</property> <!-- FIXME should be 4. from flight data --> | ||
| <property value="0.00001">fcs/motor_max_torque</property> | ||
|
|
||
| <!-- First the lift forces produced by each propeller --> | ||
|
|
||
| <force name="UR" frame="BODY" unit="LBS"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/UR_lag</property> | ||
| <property>fcs/motor_max_thrust</property> | ||
| <value>0.224808943</value> <!-- N to LBS --> | ||
| <table> | ||
| <independentVar lookup="row">aero/qbar-psf</independentVar> | ||
| <tableData> <!-- 1 psf = 47.88 Pa , 18m/s : 200Pa, 5m/s :15Pa 3m/s:5.5Pa--> | ||
| 0. 1. | ||
| 0.1148 1. | ||
| 4.17 0.7 <!-- 18m/s --> | ||
| </tableData> | ||
| </table> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>0.105</x> | ||
| <y>0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>0.342</x> | ||
| <y>0</y> | ||
| <z>-0.94</z> | ||
| </direction> | ||
| </force> | ||
| <force name="BR" frame="BODY" unit="LBS"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/BR_lag</property> | ||
| <property>fcs/motor_max_thrust</property> | ||
| <value>0.224808943</value> <!-- N to LBS --> | ||
| <table> | ||
| <independentVar lookup="row">aero/qbar-psf</independentVar> | ||
| <tableData> <!-- 1 psf = 47.88 Pa , 18m/s : 200Pa, 5m/s :15Pa 3m/s:5.5Pa--> | ||
| 0. 1. | ||
| 0.1148 1. | ||
| 4.17 0.7 <!-- 18m/s --> | ||
| </tableData> | ||
| </table> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>-0.105</x> | ||
| <y>0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>-0.342</x> | ||
| <y>0</y> | ||
| <z>-0.94</z> | ||
| </direction> | ||
| </force> | ||
| <force name="BL" frame="BODY" unit="LBS"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/BL_lag</property> | ||
| <property>fcs/motor_max_thrust</property> | ||
| <value>0.224808943</value> <!-- N to LBS --> | ||
| <table> | ||
| <independentVar lookup="row">aero/qbar-psf</independentVar> | ||
| <tableData> <!-- 1 psf = 47.88 Pa , 18m/s : 200Pa, 5m/s :15Pa 3m/s:5.5Pa--> | ||
| 0. 1. | ||
| 0.1148 1. | ||
| 4.17 0.7 <!-- 18m/s --> | ||
| </tableData> | ||
| </table> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>-0.105</x> | ||
| <y>-0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>-0.342</x> | ||
| <y>0</y> | ||
| <z>-0.94</z> | ||
| </direction> | ||
| </force> | ||
| <force name="UL" frame="BODY" unit="LBS"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/UL_lag</property> | ||
| <property>fcs/motor_max_thrust</property> | ||
| <value>0.224808943</value> <!-- N to LBS --> | ||
| <table> | ||
| <independentVar lookup="row">aero/qbar-psf</independentVar> | ||
| <tableData> <!-- 1 psf = 47.88 Pa , 18m/s : 200Pa, 5m/s :15Pa 3m/s:5.5Pa--> | ||
| 0. 1. | ||
| 0.1148 1. | ||
| 4.17 0.7 <!-- 18m/s --> | ||
| </tableData> | ||
| </table> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>0.105</x> | ||
| <y>-0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>0.342</x> | ||
| <y>0</y> | ||
| <z>-0.94</z> | ||
| </direction> | ||
| </force> | ||
|
|
||
| <!-- Then the Moment Couples --> | ||
|
|
||
| <moment name="UR_couple" frame="BODY"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/UR_lag</property> | ||
| <property>fcs/motor_max_torque</property> | ||
| <value> 0.738 </value> <!-- N.m to FT.LBS --> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>0.105</x> | ||
| <y>0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>0</x> | ||
| <y>0</y> | ||
| <z>-1</z> | ||
| </direction> | ||
| </moment> | ||
|
|
||
| <moment name="BR_couple" frame="BODY"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/BR_lag</property> | ||
| <property>fcs/motor_max_torque</property> | ||
| <value> 0.738 </value> <!-- N.m to FT.LBS --> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>-0.105</x> | ||
| <y>0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>0</x> | ||
| <y>0</y> | ||
| <z>1</z> | ||
| </direction> | ||
| </moment> | ||
|
|
||
| <moment name="BL_couple" frame="BODY"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/BL_lag</property> | ||
| <property>fcs/motor_max_torque</property> | ||
| <value> 0.738 </value> <!-- N.m to FT.LBS --> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>-0.105</x> | ||
| <y>-0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>0</x> | ||
| <y>0</y> | ||
| <z>-1</z> | ||
| </direction> | ||
| </moment> | ||
|
|
||
| <moment name="UL_couple" frame="BODY"> | ||
| <function> | ||
| <product> | ||
| <property>fcs/UL_lag</property> | ||
| <property>fcs/motor_max_torque</property> | ||
| <value> 0.738 </value> <!-- N.m to FT.LBS --> | ||
| </product> | ||
| </function> | ||
| <location unit="M"> | ||
| <x>0.105</x> | ||
| <y>-0.12</y> | ||
| <z>0</z> | ||
| </location> | ||
| <direction> | ||
| <x>0</x> | ||
| <y>0</y> | ||
| <z>1</z> | ||
| </direction> | ||
| </moment> | ||
|
|
||
| </external_reactions> | ||
|
|
||
| <propulsion/> | ||
|
|
||
| <flight_control name="FGFCS"/> | ||
| <aerodynamics file="Systems/aerodynamics_falcon.xml"/> | ||
|
|
||
| </fdm_config> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,220 @@ | ||
| <?xml version="1.0" ?> | ||
|
|
||
| <robot name="FalconTailSitterV2"> | ||
|
|
||
| <material name="white"> | ||
| <color rgba="1. 1. 1. 1.0"/> | ||
| </material> | ||
|
|
||
| <material name="black"> | ||
| <color rgba="0. 0. 0. 1.0"/> | ||
| </material> | ||
|
|
||
| <material name="blue0"> | ||
| <color rgba="15./255. 141./255. 238./255. 1.0"/> | ||
| </material> | ||
|
|
||
| <material name="darkgrey"> | ||
| <color rgba="0.4 0.4 0.4 1.0"/> | ||
| </material> | ||
|
|
||
| <material name="blue1"> | ||
| <color rgba="0.06 0.46 0.9 0.6"/> | ||
| </material> | ||
|
|
||
| <material name="orange_redish"> | ||
| <color rgba="1 0.25 0 0.4"/> | ||
| </material> | ||
|
|
||
| <configuration type="tailsitter"/> | ||
|
|
||
| <properties arm="0.0635" kf="2.0e-8" km="2.74e-10" thrust2weight="2" max_speed_kmh="30" gnd_eff_coeff="11.36859" prop_radius="3.31348e-2" drag_coeff_xy="9.1785e-7" drag_coeff_z="10.311e-7" dw_coeff_1="2267.18" dw_coeff_2=".16" dw_coeff_3="-.11"/> | ||
|
|
||
| <control> | ||
| <indi actuator_nr="4" output_nr="4" /> | ||
| <indi_1 roll=" 50.0 50.0 -50.0 -50.0" /> | ||
| <indi_2 pitch="-50.0 50.0 50.0 -50.0" /> | ||
| <indi_3 yaw=" -7.0 7.0 -7.0 7.0" /> | ||
| <indi_4 thrust=" 1.7 1.7 1.7 1.7" /> | ||
|
|
||
| <indi_guidance_gains> | ||
| <pos kp="1.0" kd="2.2"/> | ||
| </indi_guidance_gains> | ||
|
|
||
| <indi_att_gains> | ||
| <att p="7." q="7." r="5." /> | ||
| <rate p="18." q="18." r="10." /> | ||
| </indi_att_gains> | ||
|
|
||
| <pwm> | ||
| <pwm2rpm scale="20000. 20000. 20000. 20000." const="0. 0. 0. 0." /> | ||
| <limit min="0 0 0 0" max="1 1 1 1" /> | ||
| </pwm> | ||
| </control> | ||
|
|
||
|
|
||
| <link name="base_link"> | ||
|
|
||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="0 0 0"/> | ||
| <mass value="0.75"/> | ||
| <inertia ixx="6.2e-4" ixy="0.0" ixz="0.0" iyy="6.2e-4" iyz="0.0" izz="1.1e-3"/> | ||
| </inertial> | ||
|
|
||
| <visual> | ||
| <origin rpy="0 1.65 3.1415" xyz="-0.02 0 0.135"/> | ||
| <geometry> | ||
| <mesh filename="./tailsitter_falcon_geom/body.obj" scale="1. 1. 1."/> | ||
| </geometry> | ||
| <material name="darkgrey"/> | ||
| </visual> | ||
|
|
||
| <collision> | ||
| <origin rpy="0 0 0" xyz="0 0 0"/> | ||
| <geometry> | ||
| <cylinder radius="0.15" length=".1"/> | ||
| </geometry> | ||
| </collision> | ||
|
|
||
| </link> | ||
|
|
||
| <link name="prop0_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="0.11 0.11 0"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| <visual> | ||
| <origin rpy="0 0 0" xyz="0.11 0.11 0.01"/> | ||
| <geometry> | ||
| <cylinder radius="0.0635" length=".001"/> | ||
| </geometry> | ||
| <material name="orange_redish"/> | ||
| </visual> | ||
| </link> | ||
| <joint name="prop0_joint" type="fixed"> | ||
| <parent link="base_link"/> | ||
| <child link="prop0_link"/> | ||
| </joint> | ||
|
|
||
| <link name="prop1_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="-0.11 0.11 0"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| <visual> | ||
| <origin rpy="0 0 0" xyz="-0.11 0.11 0.02"/> | ||
| <geometry> | ||
| <cylinder radius="0.0635" length=".001"/> | ||
| </geometry> | ||
| <material name="blue1"/> | ||
| </visual> | ||
| </link> | ||
| <joint name="prop1_joint" type="fixed"> | ||
| <parent link="base_link"/> | ||
| <child link="prop1_link"/> | ||
| </joint> | ||
|
|
||
| <link name="prop2_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="-0.11 -0.11 0.03"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| <visual> | ||
| <origin rpy="0 0 0" xyz="-0.11 -0.11 0.01"/> | ||
| <geometry> | ||
| <cylinder radius="0.0635" length=".001"/> | ||
| </geometry> | ||
| <material name="blue1"/> | ||
| </visual> | ||
| </link> | ||
| <joint name="prop2_joint" type="fixed"> | ||
| <parent link="base_link"/> | ||
| <child link="prop2_link"/> | ||
| </joint> | ||
|
|
||
| <link name="prop3_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="0.11 -0.11 0.04"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| <visual> | ||
| <origin rpy="0 0 0" xyz="0.11 -0.11 0.01"/> | ||
| <geometry> | ||
| <cylinder radius="0.0635" length=".001"/> | ||
| </geometry> | ||
| <material name="orange_redish"/> | ||
| </visual> | ||
| </link> | ||
| <joint name="prop3_joint" type="fixed"> | ||
| <parent link="base_link"/> | ||
| <child link="prop3_link"/> | ||
| </joint> | ||
|
|
||
| <link name="Rflap_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="0 0 0"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| <visual> | ||
| <origin rpy="0 1.65 3.1415" xyz="-0.02 0 0.205"/> | ||
| <geometry> | ||
| <mesh filename="./tailsitter_falcon_geom/Rflap.obj" scale="1. 1. 1."/> | ||
| </geometry> | ||
| <material name="orange_red"> | ||
| <color rgba="1 0.25 0 0.9"/> | ||
| </material> | ||
| </visual> | ||
| </link> | ||
| <joint name="Rflap_joint" type="revolute"> | ||
| <axis xyz="0 1 0"/> | ||
| <origin rpy="0 0 0" xyz="0. 0. -0.07"/> | ||
| <parent link="base_link"/> | ||
| <child link="Rflap_link"/> | ||
| <limit effort="1" velocity="0.5"/> | ||
| <joint_properties damping="0.0" friction="0.0"/> | ||
| </joint> | ||
|
|
||
| <link name="Lflap_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="0 0 0"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| <visual> | ||
| <origin rpy="0 1.65 3.1415" xyz="-0.02 0 0.205"/> | ||
| <geometry> | ||
| <mesh filename="./tailsitter_falcon_geom/Lflap.obj" scale="1. 1. 1."/> | ||
| </geometry> | ||
| <material name="orange_red"> | ||
| <color rgba="1 0.25 0 0.9"/> | ||
| </material> | ||
| </visual> | ||
| </link> | ||
| <joint name="Lflap_joint" type="revolute"> | ||
| <axis xyz="0 1 0"/> | ||
| <origin rpy="0 0 0" xyz="0. 0. -0.07"/> | ||
| <parent link="base_link"/> | ||
| <child link="Lflap_link"/> | ||
| <limit effort="1" velocity="0.5"/> | ||
| <joint_properties damping="0.0" friction="0.0"/> | ||
| </joint> | ||
|
|
||
| <link name="center_of_mass_link"> | ||
| <inertial> | ||
| <origin rpy="0 0 0" xyz="0 0 0"/> | ||
| <mass value="0"/> | ||
| <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/> | ||
| </inertial> | ||
| </link> | ||
| <joint name="center_of_mass_joint" type="fixed"> | ||
| <parent link="base_link"/> | ||
| <child link="center_of_mass_link"/> | ||
| </joint> | ||
|
|
||
| </robot> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| newmtl 0.498039_0.498039_0.498039_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.498 0.498 0.498 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| newmtl 0.498039_0.498039_0.498039_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.498 0.498 0.498 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| newmtl 0.231373_0.380392_0.705882_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.2314 0.3804 0.7059 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.498039_0.498039_0.498039_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.498 0.498 0.498 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.615686_0.811765_0.929412_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.6157 0.8118 0.9294 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.647059_0.647059_0.647059_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.6471 0.6471 0.6471 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.768627_0.886275_0.952941_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.7686 0.8863 0.9529 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.917647_0.917647_0.917647_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.9176 0.9176 0.9176 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.972549_0.529412_0.003922_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.9725 0.5294 0.003922 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 | ||
| newmtl 0.980392_0.713725_0.003922_0.000000_0.000000 | ||
| Ka 0.0000 0.0000 0.0000 | ||
| Kd 0.9804 0.7137 0.003922 | ||
| Ks 0.0000 0.0000 0.0000 | ||
| Tf 0.0000 0.0000 0.0000 | ||
| d 1 | ||
| Ns 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,231 @@ | ||
| <?xml version="1.0"?> | ||
| <!DOCTYPE telemetry SYSTEM "telemetry.dtd"> | ||
| <telemetry> | ||
|
|
||
|
|
||
| <process name="Main"> | ||
|
|
||
| <mode name="default" key_press="d"> | ||
| <message name="AUTOPILOT_VERSION" period="11.1"/> | ||
| <message name="DL_VALUE" period="1.1"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ROTORCRAFT_FP" period="0.25"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="1.6"/> | ||
| <message name="WP_MOVED" period="1.3"/> | ||
| <message name="ROTORCRAFT_CAM" period="1."/> | ||
| <message name="GPS_INT" period=".25"/> | ||
| <message name="INS" period=".25"/> | ||
| <message name="I2C_ERRORS" period="4.1"/> | ||
| <message name="UART_ERRORS" period="3.1"/> | ||
| <message name="SUPERBITRF" period="3"/> | ||
| <message name="ENERGY" period="2.5"/> | ||
| <message name="DATALINK_REPORT" period="5.1"/> | ||
| <message name="STATE_FILTER_STATUS" period="3.2"/> | ||
| <message name="AIR_DATA" period="1.3"/> | ||
| <message name="SURVEY" period="2.5"/> | ||
| <message name="OPTIC_FLOW_EST" period="0.05"/> | ||
| <message name="VECTORNAV_INFO" period="0.5"/> | ||
| <message name="OPTICAL_FLOW_HOVER" period="0.05"/> | ||
| <message name="VISUALTARGET" period="0.10"/> | ||
| <message name="VISION_POSITION_ESTIMATE" period="0.1"/> | ||
| <message name="DIVERGENCE" period="0.05"/> | ||
| <message name="DRAGSPEED" period="0.02"/> | ||
| <message name="LOGGER_STATUS" period="5.1"/> | ||
| <message name="LIDAR" period="1.2"/> | ||
| <message name="INS_EKF2" period=".25"/> | ||
| <message name="WIND_INFO_RET" period="1."/> | ||
| <message name="AHRS_REF_QUAT" period="0.5"/> | ||
| <message name="GUIDANCE_INDI_HYBRID" period="0.1"/> | ||
| <message name="ACTUATORS" period="0.1"/> | ||
| <message name="STAB_ATTITUDE_INDI" period=".25"/> | ||
| </mode> | ||
|
|
||
| <mode name="ppm"> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="ROTORCRAFT_CMD" period=".05"/> | ||
| <message name="PPM" period="0.5"/> | ||
| <message name="RC" period="0.5"/> | ||
| <message name="ROTORCRAFT_RADIO_CONTROL" period="0.5"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1"/> | ||
| <message name="BEBOP_ACTUATORS" period="0.2"/> | ||
| </mode> | ||
|
|
||
| <mode name="raw_sensors"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="IMU_ACCEL_RAW" period=".05"/> | ||
| <message name="IMU_GYRO_RAW" period=".05"/> | ||
| <message name="IMU_MAG_RAW" period=".05"/> | ||
| <message name="BARO_RAW" period=".1"/> | ||
| <message name="IMU_MAG_CURRENT_CALIBRATION" period=".05"/> | ||
| <message name="ARDRONE_NAVDATA" period=".05"/> | ||
| </mode> | ||
|
|
||
| <mode name="scaled_sensors"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="IMU_GYRO_SCALED" period=".075"/> | ||
| <message name="IMU_ACCEL_SCALED" period=".075"/> | ||
| <message name="IMU_MAG_SCALED" period=".1"/> | ||
| </mode> | ||
|
|
||
| <mode name="ahrs"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="FILTER_ALIGNER" period="2.2"/> | ||
| <message name="FILTER" period=".5"/> | ||
| <message name="GEO_MAG" period="5."/> | ||
| <message name="AHRS_GYRO_BIAS_INT" period="0.08"/> | ||
| <message name="AHRS_QUAT_INT" period=".25"/> | ||
| <message name="AHRS_EULER_INT" period=".1"/> | ||
| <message name="AHRS_EULER" period=".1"/> | ||
| <!-- <message name="AHRS_RMAT_INT" period=".5"/> --> | ||
| </mode> | ||
|
|
||
| <mode name="rate_loop"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="RATE_LOOP" period=".02"/> | ||
| </mode> | ||
|
|
||
| <mode name="attitude_setpoint_viz" key_press="v"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="ROTORCRAFT_RADIO_CONTROL" period="0.1"/> | ||
| <message name="AHRS_REF_QUAT" period="0.05"/> | ||
| </mode> | ||
|
|
||
| <mode name="attitude_loop" key_press="a"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="STAB_ATTITUDE_INT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_REF_INT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_FLOAT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_REF_FLOAT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_INDI" period=".25"/> | ||
| <message name="INDI_G" period="2.0"/> | ||
| </mode> | ||
|
|
||
| <mode name="vert_loop" key_press="v"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="VFF" period=".05"/> | ||
| <message name="VFF_EXTENDED" period=".05"/> | ||
| <message name="VERT_LOOP" period=".05"/> | ||
| <message name="INS_Z" period=".05"/> | ||
| <message name="INS" period=".11"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| </mode> | ||
|
|
||
| <mode name="vel_guidance" key_press="q"> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="HYBRID_GUIDANCE" period="0.062"/> | ||
| <message name="GUIDANCE_INDI_HYBRID" period="0.1"/> | ||
| <!--<message name="STAB_ATTITUDE_REF" period="0.4"/>--> | ||
| <message name="ROTORCRAFT_FP" period="0.8"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="1.6"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <message name="WP_MOVED" period="1.3"/> | ||
| <message name="GPS_INT" period="1.0"/> | ||
| <message name="INS" period="1.0"/> | ||
| </mode> | ||
|
|
||
| <mode name="h_loop" key_press="h"> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="HOVER_LOOP" period="0.062"/> | ||
| <message name="GUIDANCE_H_REF_INT" period="0.062"/> | ||
| <message name="STAB_ATTITUDE_INT" period="0.4"/> | ||
| <message name="STAB_ATTITUDE_FLOAT" period="0.4"/> | ||
| <!--<message name="STAB_ATTITUDE_REF_INT" period="0.4"/>--> | ||
| <message name="ROTORCRAFT_FP" period="0.8"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="1.6"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <!-- HFF messages are only sent if USE_HFF --> | ||
| <message name="HFF" period=".05"/> | ||
| <message name="HFF_GPS" period=".03"/> | ||
| <message name="HFF_DBG" period=".2"/> | ||
| </mode> | ||
|
|
||
| <mode name="aligner"> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="FILTER_ALIGNER" period="0.02"/> | ||
| </mode> | ||
|
|
||
| <mode name="tune_hover"> | ||
| <message name="DL_VALUE" period="1.1"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="GUIDANCE_H_INT" period="0.05"/> | ||
| <message name="ROTORCRAFT_TUNE_HOVER" period=".1"/> | ||
| <!-- <message name="GPS_INT" period=".20"/> --> | ||
| <!--<message name="INS2" period=".05"/> | ||
| <message name="INS3" period=".20"/>--> | ||
| <message name="INS_REF" period="5.1"/> | ||
| </mode> | ||
|
|
||
| <mode name="RTCM3" > | ||
| <message name="GPS_RXMRTCM" period="1"/> | ||
| <message name="GPS_INT" period=".25"/> | ||
| <message name="GPS_RTK" period="1"/> | ||
| </mode> | ||
|
|
||
| </process> | ||
|
|
||
| <process name="FlightRecorder"> | ||
| <mode name="default"> | ||
| <message name="AUTOPILOT_VERSION" period="11.1"/> | ||
| <message name="DL_VALUE" period="1.1"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ROTORCRAFT_FP" period="0.25"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="1.6"/> | ||
| <message name="WP_MOVED" period="1.3"/> | ||
| <message name="GPS_INT" period=".1"/> | ||
| <message name="INS" period=".1"/> | ||
| <message name="I2C_ERRORS" period="4.1"/> | ||
| <message name="UART_ERRORS" period="3.1"/> | ||
| <message name="ENERGY" period="2.5"/> | ||
| <message name="DATALINK_REPORT" period="5.1"/> | ||
| <message name="STATE_FILTER_STATUS" period="3.2"/> | ||
| <message name="AIR_DATA" period="1.3"/> | ||
| <message name="SURVEY" period="2.5"/> | ||
| <message name="IMU_GYRO_SCALED" period=".075"/> | ||
| <message name="IMU_ACCEL_SCALED" period=".075"/> | ||
| <message name="IMU_MAG_SCALED" period=".2"/> | ||
| <message name="LIDAR" period="0.05"/> | ||
| <message name="GUIDANCE_INDI_HYBRID" period="0.1"/> | ||
| <message name="ACTUATORS" period="0.1"/> | ||
| <message name="STAB_ATTITUDE_INT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_REF_INT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_FLOAT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_REF_FLOAT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_INDI" period=".25"/> | ||
| <message name="INDI_G" period="2.0"/> | ||
| </mode> | ||
| </process> | ||
|
|
||
| <process name="Extra"> | ||
| <mode name="default"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="GPS_INT" period=".25"/> | ||
| <message name="MISSION_STATUS" period="0.5"/> | ||
| <message name="ROTORCRAFT_FP" period="0.25"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <message name="INS" period=".25"/> | ||
| </mode> | ||
| </process> | ||
|
|
||
| </telemetry> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,177 @@ | ||
| <?xml version="1.0"?> | ||
| <!DOCTYPE telemetry SYSTEM "telemetry.dtd"> | ||
| <telemetry> | ||
|
|
||
|
|
||
| <process name="Main"> | ||
|
|
||
| <mode name="default" key_press="d"> | ||
| <message name="AUTOPILOT_VERSION" period="11.1"/> | ||
| <message name="DL_VALUE" period="1.1"/> | ||
| <message name="ROTORCRAFT_STATUS" period="3.2"/> | ||
| <message name="ROTORCRAFT_FP" period="0.5"/> | ||
| <message name="ALIVE" period="3.1"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="2.6"/> | ||
| <message name="WP_MOVED" period="2.3"/> | ||
| <message name="GPS_INT" period="1."/> | ||
| <!--message name="INS" period="1.2"/--> | ||
| <message name="ENERGY" period="3.5"/> | ||
| <message name="DATALINK_REPORT" period="6.1"/> | ||
| <message name="STATE_FILTER_STATUS" period="4.2"/> | ||
| <message name="AIR_DATA" period="2.3"/> | ||
| <!--message name="SURVEY" period="4.5"/--> | ||
| <message name="FBW_STATUS" period="2.0"/> | ||
| </mode> | ||
|
|
||
| <mode name="ppm"> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="ROTORCRAFT_CMD" period=".05"/> | ||
| <message name="PPM" period="0.5"/> | ||
| <message name="RC" period="0.5"/> | ||
| <message name="ROTORCRAFT_RADIO_CONTROL" period="0.5"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1"/> | ||
| <message name="BEBOP_ACTUATORS" period="0.2"/> | ||
| </mode> | ||
|
|
||
| <mode name="raw_sensors"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="IMU_ACCEL_RAW" period=".05"/> | ||
| <message name="IMU_GYRO_RAW" period=".05"/> | ||
| <message name="IMU_MAG_RAW" period=".05"/> | ||
| <message name="BARO_RAW" period=".1"/> | ||
| <message name="ARDRONE_NAVDATA" period=".05"/> | ||
| </mode> | ||
|
|
||
| <mode name="scaled_sensors"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="IMU_GYRO_SCALED" period=".075"/> | ||
| <message name="IMU_ACCEL_SCALED" period=".075"/> | ||
| <message name="IMU_MAG_SCALED" period=".1"/> | ||
| </mode> | ||
|
|
||
| <mode name="ahrs"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="FILTER_ALIGNER" period="2.2"/> | ||
| <message name="FILTER" period=".5"/> | ||
| <message name="GEO_MAG" period="5."/> | ||
| <message name="AHRS_GYRO_BIAS_INT" period="0.08"/> | ||
| <message name="AHRS_QUAT_INT" period=".25"/> | ||
| <message name="AHRS_EULER_INT" period=".1"/> | ||
| <!-- <message name="AHRS_RMAT_INT" period=".5"/> --> | ||
| </mode> | ||
|
|
||
| <mode name="rate_loop"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="RATE_LOOP" period=".02"/> | ||
| </mode> | ||
|
|
||
| <mode name="attitude_setpoint_viz" key_press="v"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="ROTORCRAFT_RADIO_CONTROL" period="0.1"/> | ||
| <message name="AHRS_REF_QUAT" period="0.05"/> | ||
| </mode> | ||
|
|
||
| <mode name="attitude_loop" key_press="a"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="STAB_ATTITUDE_INT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_REF_INT" period=".03"/> | ||
| <message name="STAB_ATTITUDE_INDI" period=".25"/> | ||
| </mode> | ||
|
|
||
| <mode name="vert_loop" key_press="v"> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="DL_VALUE" period="0.5"/> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="VFF" period=".05"/> | ||
| <message name="VFF_EXTENDED" period=".05"/> | ||
| <message name="VERT_LOOP" period=".05"/> | ||
| <message name="INS_Z" period=".05"/> | ||
| <message name="INS" period=".11"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| </mode> | ||
|
|
||
| <mode name="h_loop" key_press="h"> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="HOVER_LOOP" period="0.062"/> | ||
| <message name="GUIDANCE_H_REF_INT" period="0.062"/> | ||
| <message name="STAB_ATTITUDE_INT" period="0.4"/> | ||
| <!--<message name="STAB_ATTITUDE_REF_INT" period="0.4"/>--> | ||
| <message name="ROTORCRAFT_FP" period="0.8"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="1.6"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <!-- HFF messages are only sent if USE_HFF --> | ||
| <message name="HFF" period=".05"/> | ||
| <message name="HFF_GPS" period=".03"/> | ||
| <message name="HFF_DBG" period=".2"/> | ||
| </mode> | ||
|
|
||
| <mode name="aligner"> | ||
| <message name="ALIVE" period="0.9"/> | ||
| <message name="FILTER_ALIGNER" period="0.02"/> | ||
| </mode> | ||
|
|
||
| <mode name="tune_hover"> | ||
| <message name="DL_VALUE" period="1.1"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ALIVE" period="2.1"/> | ||
| <message name="GUIDANCE_H_INT" period="0.05"/> | ||
| <message name="ROTORCRAFT_TUNE_HOVER" period=".1"/> | ||
| <!-- <message name="GPS_INT" period=".20"/> --> | ||
| <!--<message name="INS2" period=".05"/> | ||
| <message name="INS3" period=".20"/>--> | ||
| <message name="INS_REF" period="5.1"/> | ||
| </mode> | ||
|
|
||
| </process> | ||
|
|
||
| <process name="FlightRecorder"> | ||
| <mode name="default"> | ||
| <message name="AUTOPILOT_VERSION" period="11.1"/> | ||
| <message name="DL_VALUE" period="1.1"/> | ||
| <message name="ROTORCRAFT_STATUS" period="1.2"/> | ||
| <message name="ROTORCRAFT_FP" period="0.1"/> | ||
| <message name="INS_REF" period="5.1"/> | ||
| <message name="ROTORCRAFT_NAV_STATUS" period="1.6"/> | ||
| <message name="WP_MOVED" period="1.3"/> | ||
| <message name="GPS_INT" period=".1"/> | ||
| <message name="INS" period=".1"/> | ||
| <message name="I2C_ERRORS" period="4.1"/> | ||
| <message name="UART_ERRORS" period="3.1"/> | ||
| <message name="ENERGY" period="0.1"/> | ||
| <message name="DATALINK_REPORT" period="5.1"/> | ||
| <message name="STATE_FILTER_STATUS" period="3.2"/> | ||
| <message name="AIR_DATA" period="0.1"/> | ||
| <message name="SURVEY" period="2.5"/> | ||
| <message name="IMU_GYRO_SCALED" period=".075"/> | ||
| <message name="IMU_ACCEL_SCALED" period=".075"/> | ||
| <message name="IMU_MAG_SCALED" period=".2"/> | ||
| <message name="AHRS_QUAT_INT" period=".05"/> | ||
| <message name="LIDAR" period="0.05"/> | ||
| <message name="GUIDANCE_INDI_HYBRID" period="0.05"/> | ||
| </mode> | ||
| </process> | ||
|
|
||
| <process name="Extra"> | ||
| <mode name="default"> | ||
| <message name="ROTORCRAFT_FP" period="0.1"/> | ||
| <message name="AHRS_QUAT_INT" period="0.1"/> | ||
| </mode> | ||
| </process> | ||
|
|
||
| </telemetry> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,377 @@ | ||
| /* | ||
| * Copyright (C) Anton Naruta && Daniel Hoppener | ||
| * MAVLab Delft University of Technology | ||
| * | ||
| * 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 wls_alloc.c | ||
| * @brief This is an active set algorithm for WLS control allocation | ||
| * | ||
| * This algorithm will find the optimal inputs to produce the least error wrt | ||
| * the control objective, taking into account the weighting matrices on the | ||
| * control objective and the control effort. | ||
| * | ||
| * The algorithm is described in: | ||
| * Prioritized Control Allocation for Quadrotors Subject to Saturation - | ||
| * E.J.J. Smeur, D.C. Höppener, C. de Wagter. In IMAV 2017 | ||
| * | ||
| * written by Anton Naruta && Daniel Hoppener 2016 | ||
| * MAVLab Delft University of Technology | ||
| */ | ||
|
|
||
| #include "wls_alloc.h" | ||
| #include <stdio.h> | ||
| #include "std.h" | ||
|
|
||
| #include <string.h> | ||
| #include <math.h> | ||
| #include <float.h> | ||
| #include "math/qr_solve/qr_solve.h" | ||
| #include "math/qr_solve/r8lib_min.h" | ||
|
|
||
| void print_final_values(int n_u, int n_v, float* u, float** B, float* v, float* umin, float* umax); | ||
| void print_in_and_outputs(int n_c, int n_free, float** A_free_ptr, float* d, float* p_free); | ||
|
|
||
| // provide loop feedback | ||
| #define WLS_VERBOSE FALSE | ||
|
|
||
| // Problem size needs to be predefined to avoid having to use VLAs | ||
| #ifndef CA_N_V_GUIDANCE | ||
| #error CA_N_V_GUIDANCE needs to be defined! | ||
| #endif | ||
|
|
||
| #ifndef CA_N_U_GUIDANCE | ||
| #error CA_N_U_GUIDANCE needs to be defined! | ||
| #endif | ||
|
|
||
| #define CA_N_C_GUIDANCE (CA_N_U_GUIDANCE+CA_N_V_GUIDANCE) | ||
|
|
||
| /** | ||
| * @brief Wrapper for qr solve | ||
| * | ||
| * Possible to use a different solver if needed. | ||
| * Solves a system of the form Ax = b for x. | ||
| * | ||
| * @param m number of rows | ||
| * @param n number of columns | ||
| */ | ||
| void qr_solve_wrapper_guidance(int m, int n, float** A, float* b, float* x) { | ||
| float in[m * n]; | ||
| // convert A to 1d array | ||
| int k = 0; | ||
| for (int j = 0; j < n; j++) { | ||
| for (int i = 0; i < m; i++) { | ||
| in[k++] = A[i][j]; | ||
| } | ||
| } | ||
| // use solver | ||
| qr_solve(m, n, in, b, x); | ||
| } | ||
|
|
||
| /** | ||
| * @brief active set algorithm for control allocation | ||
| * | ||
| * Takes the control objective and max and min inputs from pprz and calculates | ||
| * the inputs that will satisfy most of the control objective, subject to the | ||
| * weighting matrices Wv and Wu | ||
| * | ||
| * @param u The control output vector | ||
| * @param v The control objective | ||
| * @param umin The minimum u vector | ||
| * @param umax The maximum u vector | ||
| * @param B The control effectiveness matrix | ||
| * @param n_u Length of u | ||
| * @param n_v Lenght of v | ||
| * @param u_guess Initial value for u | ||
| * @param W_init Initial working set, if known | ||
| * @param Wv Weighting on different control objectives | ||
| * @param Wu Weighting on different controls | ||
| * @param up Preferred control vector | ||
| * @param gamma_sq Preference of satisfying control objective over desired | ||
| * control vector (sqare root of gamma) | ||
| * @param imax Max number of iterations | ||
| * | ||
| * @return Number of iterations, -1 upon failure | ||
| */ | ||
| int wls_alloc_guidance(float* u, float* v, float* umin, float* umax, float** B, | ||
| float* u_guess, float* W_init, float* Wv, float* Wu, float* up, | ||
| float gamma_sq, int imax) { | ||
| // allocate variables, use defaults where parameters are set to 0 | ||
| if(!gamma_sq) gamma_sq = 100000; | ||
| if(!imax) imax = 100; | ||
|
|
||
| int n_c = CA_N_C_GUIDANCE; | ||
| int n_u = CA_N_U_GUIDANCE; | ||
| int n_v = CA_N_V_GUIDANCE; | ||
|
|
||
| float A[CA_N_C_GUIDANCE][CA_N_U_GUIDANCE]; | ||
| float A_free[CA_N_C_GUIDANCE][CA_N_U_GUIDANCE]; | ||
|
|
||
| // Create a pointer array to the rows of A_free | ||
| // such that we can pass it to a function | ||
| float * A_free_ptr[CA_N_C_GUIDANCE]; | ||
| for(int i = 0; i < n_c; i++) | ||
| A_free_ptr[i] = A_free[i]; | ||
|
|
||
| float b[CA_N_C_GUIDANCE]; | ||
| float d[CA_N_C_GUIDANCE]; | ||
|
|
||
| int free_index[CA_N_U_GUIDANCE]; | ||
| int free_index_lookup[CA_N_U_GUIDANCE]; | ||
| int n_free = 0; | ||
| int free_chk = -1; | ||
|
|
||
| int iter = 0; | ||
| float p_free[CA_N_U_GUIDANCE]; | ||
| float p[CA_N_U_GUIDANCE]; | ||
| float u_opt[CA_N_U_GUIDANCE]; | ||
| int infeasible_index[CA_N_U_GUIDANCE] UNUSED; | ||
| int n_infeasible = 0; | ||
| float lambda[CA_N_U_GUIDANCE]; | ||
| float W[CA_N_U_GUIDANCE]; | ||
|
|
||
| // Initialize u and the working set, if provided from input | ||
| if (!u_guess) { | ||
| for (int i = 0; i < n_u; i++) { | ||
| u[i] = (umax[i] + umin[i]) * 0.5; | ||
| } | ||
| } else { | ||
| for (int i = 0; i < n_u; i++) { | ||
| u[i] = u_guess[i]; | ||
| } | ||
| } | ||
| W_init ? memcpy(W, W_init, n_u * sizeof(float)) | ||
| : memset(W, 0, n_u * sizeof(float)); | ||
|
|
||
| memset(free_index_lookup, -1, n_u * sizeof(float)); | ||
|
|
||
| // find free indices | ||
| for (int i = 0; i < n_u; i++) { | ||
| if (W[i] == 0) { | ||
| free_index_lookup[i] = n_free; | ||
| free_index[n_free++] = i; | ||
| } | ||
| } | ||
|
|
||
| // fill up A, A_free, b and d | ||
| for (int i = 0; i < n_v; i++) { | ||
| // If Wv is a NULL pointer, use Wv = identity | ||
| b[i] = Wv ? gamma_sq * Wv[i] * v[i] : gamma_sq * v[i]; | ||
| d[i] = b[i]; | ||
| for (int j = 0; j < n_u; j++) { | ||
| // If Wv is a NULL pointer, use Wv = identity | ||
| A[i][j] = Wv ? gamma_sq * Wv[i] * B[i][j] : gamma_sq * B[i][j]; | ||
| d[i] -= A[i][j] * u[j]; | ||
| } | ||
| } | ||
| for (int i = n_v; i < n_c; i++) { | ||
| memset(A[i], 0, n_u * sizeof(float)); | ||
| A[i][i - n_v] = Wu ? Wu[i - n_v] : 1.0; | ||
| b[i] = up ? (Wu ? Wu[i-n_v] * up[i-n_v] : up[i-n_v]) : 0; | ||
| d[i] = b[i] - A[i][i - n_v] * u[i - n_v]; | ||
| } | ||
|
|
||
| // -------------- Start loop ------------ | ||
| while (iter++ < imax) { | ||
| // clear p, copy u to u_opt | ||
| memset(p, 0, n_u * sizeof(float)); | ||
| memcpy(u_opt, u, n_u * sizeof(float)); | ||
|
|
||
| // Construct a matrix with the free columns of A | ||
| if (free_chk != n_free) { | ||
| for (int i = 0; i < n_c; i++) { | ||
| for (int j = 0; j < n_free; j++) { | ||
| A_free[i][j] = A[i][free_index[j]]; | ||
| } | ||
| } | ||
| free_chk = n_free; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| if (n_free) { | ||
| // Still free variables left, calculate corresponding solution | ||
|
|
||
| // use a solver to find the solution to A_free*p_free = d | ||
| qr_solve_wrapper_guidance(n_c, n_free, A_free_ptr, d, p_free); | ||
|
|
||
| //print results current step | ||
| #if WLS_VERBOSE | ||
| print_in_and_outputs(n_c, n_free, A_free_ptr, d, p_free); | ||
| #endif | ||
|
|
||
| } | ||
|
|
||
| // Set the nonzero values of p and add to u_opt | ||
| for (int i = 0; i < n_free; i++) { | ||
| p[free_index[i]] = p_free[i]; | ||
| u_opt[free_index[i]] += p_free[i]; | ||
| } | ||
| // check limits | ||
| n_infeasible = 0; | ||
| for (int i = 0; i < n_u; i++) { | ||
| if (u_opt[i] >= (umax[i] + 0.00001) || u_opt[i] <= (umin[i] - 0.00001)) { | ||
| infeasible_index[n_infeasible++] = i; | ||
| } | ||
| } | ||
|
|
||
| // Check feasibility of the solution | ||
| if (n_infeasible == 0) { | ||
| // all variables are within limits | ||
| memcpy(u, u_opt, n_u * sizeof(float)); | ||
| memset(lambda, 0, n_u * sizeof(float)); | ||
|
|
||
| // d = d + A_free*p_free; lambda = A*d; | ||
| for (int i = 0; i < n_c; i++) { | ||
| for (int k = 0; k < n_free; k++) { | ||
| d[i] -= A_free[i][k] * p_free[k]; | ||
| } | ||
| for (int k = 0; k < n_u; k++) { | ||
| lambda[k] += A[i][k] * d[i]; | ||
| } | ||
| } | ||
| bool break_flag = true; | ||
|
|
||
| // lambda = lambda x W; | ||
| for (int i = 0; i < n_u; i++) { | ||
| lambda[i] *= W[i]; | ||
| // if any lambdas are negative, keep looking for solution | ||
| if (lambda[i] < -FLT_EPSILON) { | ||
| break_flag = false; | ||
| W[i] = 0; | ||
| // add a free index | ||
| if (free_index_lookup[i] < 0) { | ||
| free_index_lookup[i] = n_free; | ||
| free_index[n_free++] = i; | ||
| } | ||
| } | ||
| } | ||
| if (break_flag) { | ||
|
|
||
| #if WLS_VERBOSE | ||
| print_final_values(1, n_u, n_v, u, B, v, umin, umax); | ||
| #endif | ||
|
|
||
| // if solution is found, return number of iterations | ||
| return iter; | ||
| } | ||
| } else { | ||
| float alpha = INFINITY; | ||
| float alpha_tmp; | ||
| int id_alpha = 0; | ||
|
|
||
| // find the lowest distance from the limit among the free variables | ||
| for (int i = 0; i < n_free; i++) { | ||
| int id = free_index[i]; | ||
| if(fabs(p[id]) > FLT_EPSILON) { | ||
| alpha_tmp = (p[id] < 0) ? (umin[id] - u[id]) / p[id] | ||
| : (umax[id] - u[id]) / p[id]; | ||
| } else { | ||
| alpha_tmp = INFINITY; | ||
| } | ||
| if (alpha_tmp < alpha) { | ||
| alpha = alpha_tmp; | ||
| id_alpha = id; | ||
| } | ||
| } | ||
|
|
||
| // update input u = u + alpha*p | ||
| for (int i = 0; i < n_u; i++) { | ||
| u[i] += alpha * p[i]; | ||
| } | ||
| // update d = d-alpha*A*p_free | ||
| for (int i = 0; i < n_c; i++) { | ||
| for (int k = 0; k < n_free; k++) { | ||
| d[i] -= A_free[i][k] * alpha * p_free[k]; | ||
| } | ||
| } | ||
| // get rid of a free index | ||
| W[id_alpha] = (p[id_alpha] > 0) ? 1.0 : -1.0; | ||
|
|
||
| free_index[free_index_lookup[id_alpha]] = free_index[--n_free]; | ||
| free_index_lookup[free_index[free_index_lookup[id_alpha]]] = | ||
| free_index_lookup[id_alpha]; | ||
| free_index_lookup[id_alpha] = -1; | ||
| } | ||
| } | ||
| // solution failed, return negative one to indicate failure | ||
| return -1; | ||
| } | ||
|
|
||
| #if WLS_VERBOSE | ||
| void print_in_and_outputs(int n_c, int n_free, float** A_free_ptr, float* d, float* p_free) { | ||
|
|
||
| printf("n_c = %d n_free = %d\n", n_c, n_free); | ||
|
|
||
| printf("A_free =\n"); | ||
| for(int i = 0; i < n_c; i++) { | ||
| for (int j = 0; j < n_free; j++) { | ||
| printf("%f ", A_free_ptr[i][j]); | ||
| } | ||
| printf("\n"); | ||
| } | ||
|
|
||
| printf("d = "); | ||
| for (int j = 0; j < n_c; j++) { | ||
| printf("%f ", d[j]); | ||
| } | ||
|
|
||
| printf("\noutput = "); | ||
| for (int j = 0; j < n_free; j++) { | ||
| printf("%f ", p_free[j]); | ||
| } | ||
| printf("\n\n"); | ||
| } | ||
|
|
||
| void print_final_values(int n_u, int n_v, float* u, float** B, float* v, float* umin, float* umax) { | ||
| printf("n_u = %d n_v = %d\n", n_u, n_v); | ||
|
|
||
| printf("B =\n"); | ||
| for(int i = 0; i < n_v; i++) { | ||
| for (int j = 0; j < n_u; j++) { | ||
| printf("%f ", B[i][j]); | ||
| } | ||
| printf("\n"); | ||
| } | ||
|
|
||
| printf("v = "); | ||
| for (int j = 0; j < n_v; j++) { | ||
| printf("%f ", v[j]); | ||
| } | ||
|
|
||
| printf("\nu = "); | ||
| for (int j = 0; j < n_u; j++) { | ||
| printf("%f ", u[j]); | ||
| } | ||
| printf("\n"); | ||
|
|
||
| printf("\numin = "); | ||
| for (int j = 0; j < n_u; j++) { | ||
| printf("%f ", umin[j]); | ||
| } | ||
| printf("\n"); | ||
|
|
||
| printf("\numax = "); | ||
| for (int j = 0; j < n_u; j++) { | ||
| printf("%f ", umax[j]); | ||
| } | ||
| printf("\n\n"); | ||
|
|
||
| } | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* | ||
| * Copyright (C) Anton Naruta && Daniel Hoppener | ||
| * MAVLab Delft University of Technology | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| /** | ||
| * @brief Wrapper for qr solve | ||
| * | ||
| * Possible to use a different solver if needed. | ||
| * Solves a system of the form Ax = b for x. | ||
| * | ||
| * @param m number of rows | ||
| * @param n number of columns | ||
| */ | ||
| void qr_solve_wrapper_guidance(int m, int n, float** A, float* b, float* x); | ||
|
|
||
| /** | ||
| * @brief active set algorithm for control allocation | ||
| * | ||
| * Takes the control objective and max and min inputs from pprz and calculates | ||
| * the inputs that will satisfy most of the control objective, subject to the | ||
| * weighting matrices Wv and Wu | ||
| * | ||
| * @param u The control output vector | ||
| * @param v The control objective | ||
| * @param umin The minimum u vector | ||
| * @param umax The maximum u vector | ||
| * @param B The control effectiveness matrix | ||
| * @param n_u Length of u | ||
| * @param n_v Lenght of v | ||
| * @param u_guess Initial value for u | ||
| * @param W_init Initial working set, if known | ||
| * @param Wv Weighting on different control objectives | ||
| * @param Wu Weighting on different controls | ||
| * @param up Preferred control vector | ||
| * @param gamma_sq Preference of satisfying control objective over desired | ||
| * control vector (sqare root of gamma) | ||
| * @param imax Max number of iterations | ||
| * | ||
| * @return Number of iterations, -1 upon failure | ||
| */ | ||
| int wls_alloc_guidance(float* u, float* v, float* umin, float* umax, float** B, | ||
| float* u_guess, float* W_init, float* Wv, float* Wu, | ||
| float* ud, float gamma, int imax); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| /* | ||
| * Copyright (C) 2023 Florian Sansou <florian.sansou@enac.fr> | ||
| * Copyright (C) 2023 Gautier Hattenberger <gautier.hattenberger.fr> | ||
| * | ||
| * 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, see | ||
| * <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| /** @file "modules/ctrl/eff_scheduling_falcon.c" | ||
| * Interpolation of control effectivenss matrix of the Falcon hybrid plane | ||
| */ | ||
|
|
||
| #include "modules/ctrl/eff_scheduling_falcon.h" | ||
| #include "firmwares/rotorcraft/stabilization/stabilization_indi.h" | ||
| #include "firmwares/rotorcraft/guidance/guidance_h.h" | ||
| #include "state.h" | ||
|
|
||
| #include "modules/datalink/downlink.h" | ||
|
|
||
| // Airspeed at which only with motor | ||
| #ifndef INDI_SCHEDULING_LOW_AIRSPEED | ||
| #define INDI_SCHEDULING_LOW_AIRSPEED 8.0f | ||
| #endif | ||
|
|
||
| static float g1g2_hover[INDI_OUTPUTS][INDI_NUM_ACT] = { | ||
| STABILIZATION_INDI_G1_ROLL, | ||
| STABILIZATION_INDI_G1_PITCH, | ||
| STABILIZATION_INDI_G1_YAW, | ||
| STABILIZATION_INDI_G1_THRUST | ||
| }; | ||
|
|
||
| void ctrl_eff_scheduling_init(void) | ||
| { | ||
| for (int8_t i = 0; i < INDI_OUTPUTS; i++) { | ||
| for (int8_t j = 0; j < INDI_NUM_ACT; j++) { | ||
| g1g2[i][j] = g1g2_hover[i][j] / INDI_G_SCALING; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| void ctrl_eff_scheduling_periodic(void) | ||
| { | ||
| // calculate squared airspeed | ||
| float airspeed = stateGetAirspeed_f(); | ||
|
|
||
| if (airspeed > INDI_SCHEDULING_LOW_AIRSPEED) { | ||
| airspeed -= INDI_SCHEDULING_LOW_AIRSPEED; //offset for start eff at zero! | ||
| struct FloatEulers eulers_zxy; | ||
| float_eulers_of_quat_zxy(&eulers_zxy, stateGetNedToBodyQuat_f()); | ||
|
|
||
| float pitch_ratio = 0.0f; | ||
| if (eulers_zxy.theta > -M_PI_4) { | ||
| pitch_ratio = 0.0f; | ||
| } | ||
| else { | ||
| pitch_ratio = fabsf(1.0f - eulers_zxy.theta/(float)(-M_PI_4)); | ||
| } | ||
| Bound(pitch_ratio, 0.0f, 1.0f); | ||
|
|
||
|
|
||
| Bound(airspeed, 0.0f, 30.0f); | ||
| float airspeed2 = airspeed*airspeed; | ||
|
|
||
| // not effect of elevon on body roll axis | ||
| g1g2[0][4] = 0; | ||
| g1g2[0][5] = 0; | ||
|
|
||
| //g1g2[1][0] = 0; | ||
| //g1g2[1][1] = 0; | ||
| //g1g2[1][2] = 0; | ||
| //g1g2[1][3] = 0; | ||
| //g1g2[1][0] = g1g2_hover[1][0] / INDI_G_SCALING/10.; | ||
| //g1g2[1][1] = g1g2_hover[1][1] / INDI_G_SCALING/10.; | ||
| //g1g2[1][2] = g1g2_hover[1][2] / INDI_G_SCALING/10.; | ||
| //g1g2[1][3] = g1g2_hover[1][3] / INDI_G_SCALING/10.; | ||
| float pitch_eff = pitch_ratio * EFF_PITCH_A * airspeed2; | ||
| g1g2[1][4] = pitch_eff / 1000; // elevon_right | ||
| g1g2[1][5] = -pitch_eff / 1000; // elevon_left | ||
|
|
||
| float yaw_eff = pitch_ratio * EFF_YAW_A * airspeed2; | ||
| g1g2[2][4] = -yaw_eff / 1000; // elevon_right | ||
| g1g2[2][5] = -yaw_eff / 1000; // elevon_left | ||
|
|
||
| // No thrust generated by elevon, maybe take drag in accout for the future ? | ||
| g1g2[3][4] = 0; | ||
| g1g2[3][5] = 0; | ||
| } | ||
| else { | ||
| //Come back to motor control | ||
| g1g2[0][4] = 0; // elevon_left | ||
| g1g2[0][5] = 0; // elevon_right | ||
|
|
||
| //g1g2[1][0] = g1g2_hover[1][0] / INDI_G_SCALING; | ||
| //g1g2[1][1] = g1g2_hover[1][1] / INDI_G_SCALING; | ||
| //g1g2[1][2] = g1g2_hover[1][2] / INDI_G_SCALING; | ||
| //g1g2[1][3] = g1g2_hover[1][3] / INDI_G_SCALING; | ||
| g1g2[1][4] = 0; // elevon_left | ||
| g1g2[1][5] = 0; // elevon_right | ||
|
|
||
| g1g2[2][4] = 0; // elevon_left | ||
| g1g2[2][5] = 0; // elevon_right | ||
|
|
||
| g1g2[3][4] = 0; // elevon_left | ||
| g1g2[3][5] = 0; // elevon_right | ||
| } | ||
| } | ||
|
|
||
| extern void ctrl_eff_scheduling_report(void) | ||
| { | ||
| //float f[4] = { g1g2_forward[0][0], g1g2_forward[1][0], g1g2_forward[2][0], g1g2_forward[3][0]}; | ||
| //g1g2[1][0], g1g2[1][1], g1g2[1][2], g1g2[1][3], g1g2[1][4], g1g2[1][5], | ||
| //g1g2[2][0], g1g2[2][1], g1g2[2][2], g1g2[2][3], g1g2[2][4], g1g2[2][5], | ||
| //g1g2[3][0], g1g2[3][1], g1g2[3][2], g1g2[3][3], g1g2[3][4], g1g2[3][5] | ||
|
|
||
| //float f[6] = { g1g2[0][0], g1g2[0][1], g1g2[0][2], g1g2[0][3], g1g2[0][4], g1g2[0][5] }; | ||
| float f[6] = { g1g2[1][4], g1g2[1][5], g1g2[2][4], g1g2[2][5], g1g2[1][0], g1g2[2][0] }; | ||
| DOWNLINK_SEND_PAYLOAD_FLOAT(DefaultChannel, DefaultDevice, 6, f); | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Copyright (C) 2023 Florian Sansou <florian.sansou@enac.fr> | ||
| * Copyright (C) 2023 Gautier Hattenberger <gautier.hattenberger.fr> | ||
| * | ||
| * 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, see | ||
| * <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| /** @file "modules/ctrl/eff_scheduling_falcon.h" | ||
| * Interpolation of control effectivenss matrix of the Falcon hybrid plane | ||
| */ | ||
|
|
||
| #ifndef EFF_SCHEDULING_FALCON_H | ||
| #define EFF_SCHEDULING_FALCON_H | ||
|
|
||
| extern void ctrl_eff_scheduling_init(void); | ||
| extern void ctrl_eff_scheduling_periodic(void); | ||
| extern void ctrl_eff_scheduling_report(void); | ||
|
|
||
| #endif // EFF_SCHEDULING_FALCON_H |