mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
misc cleaning
This commit is contained in:
@@ -4,15 +4,14 @@
|
||||
Tiny 2.1 board (http://paparazzi.enac.fr/wiki/index.php/Tiny_v2)
|
||||
Tilted infrared sensor (http://paparazzi.enac.fr/wiki/index.php/Image:Tiny_v2_1_Funjet.jpg)
|
||||
Radiotronix modem
|
||||
Digital camera
|
||||
-->
|
||||
|
||||
<airframe name="Funjet 1 Tiny 2.1">
|
||||
|
||||
<!--
|
||||
<modules>
|
||||
<load name="enose.xml"/>
|
||||
<load name="poles.xml"/>
|
||||
</modules>
|
||||
-->
|
||||
|
||||
<!-- commands section -->
|
||||
<servos>
|
||||
@@ -25,6 +24,7 @@
|
||||
<axis name="THROTTLE" failsafe_value="0"/>
|
||||
<axis name="ROLL" failsafe_value="0"/>
|
||||
<axis name="PITCH" failsafe_value="0"/>
|
||||
<axis name="HATCH" failsafe_value="0"/>
|
||||
</commands>
|
||||
|
||||
<rc_commands>
|
||||
@@ -147,7 +147,7 @@
|
||||
</section>
|
||||
|
||||
<section name="HORIZONTAL CONTROL" prefix="H_CTL_">
|
||||
<define name="COURSE_PGAIN" value="-1.2"/>
|
||||
<define name="COURSE_PGAIN" value="-0.8"/>
|
||||
|
||||
<define name="ROLL_MAX_SETPOINT" value="0.7" unit="radians"/>
|
||||
<define name="PITCH_MAX_SETPOINT" value="0.5" unit="radians"/>
|
||||
@@ -284,7 +284,7 @@ ap.CFLAGS += -DDIGITAL_CAM
|
||||
ap.srcs += dc.c
|
||||
|
||||
#ap.CFLAGS += -DUSE_MODULES
|
||||
#sim.CFLAGS += -DUSE_MODULES
|
||||
sim.CFLAGS += -DUSE_MODULES
|
||||
|
||||
# Config for SITL simulation
|
||||
#include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">
|
||||
|
||||
<flight_plan alt="75" ground_alt="0" lat0="43.46223" lon0="1.27289" max_dist_from_home="1500" name="Basic" security_height="25">
|
||||
<header>
|
||||
#include "datalink.h"
|
||||
</header>
|
||||
<waypoints>
|
||||
<waypoint name="HOME" x="0" y="0"/>
|
||||
<waypoint name="STDBY" x="49.5" y="100.1"/>
|
||||
<waypoint name="1" x="-58.3" y="128.6"/>
|
||||
<waypoint name="2" x="259.1" y="231.9"/>
|
||||
<waypoint alt="30.0" name="AF" x="203.5" y="-9.8"/>
|
||||
<waypoint alt="0.0" name="TD" x="28.8" y="57.0"/>
|
||||
<waypoint name="_BASELEG" x="168.8" y="-13.8"/>
|
||||
<waypoint name="CLIMB" x="-114.5" y="162.3"/>
|
||||
<waypoint name="C1" x="16.9" y="155.6"/>
|
||||
<waypoint name="C2" x="104.8" y="127.1"/>
|
||||
<waypoint name="TARGET" x="28.0" y="23.9"/>
|
||||
</waypoints>
|
||||
<exceptions/>
|
||||
<blocks>
|
||||
<block name="Wait GPS">
|
||||
<set value="1" var="kill_throttle"/>
|
||||
<while cond="!GpsFixValid()"/>
|
||||
</block>
|
||||
<block name="Geo init">
|
||||
<while cond="LessThan(NavBlockTime(), 1)"/>
|
||||
<call fun="NavSetGroundReferenceHere()"/>
|
||||
</block>
|
||||
<block name="Holding point">
|
||||
<set value="1" var="kill_throttle"/>
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="estimator_z > ground_alt+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="estimator_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
</block>
|
||||
<block key="<Control>a" name="Standby" strip_button="Standby" strip_icon="home.png">
|
||||
<circle radius="nav_radius" wp="STDBY"/>
|
||||
</block>
|
||||
<block name="Poles 1" strip_button="Line (wp 1-2)" strip_icon="line.png">
|
||||
<call fun="nav_poles_init(WP_1, WP_2, WP_C1, WP_C2, nav_radius)"/>
|
||||
<oval p1="C1" p2="C2" radius="nav_radius" until="nav_oval_count>=nav_poles_count"/>
|
||||
</block>
|
||||
<block name="Drop">
|
||||
<go wp="TARGET" approaching_time="0"/>
|
||||
<set value="MAX_PPRZ" var="ap_state->commands[COMMAND_HATCH]"/>
|
||||
</block>
|
||||
<block name="Poles 2">
|
||||
<oval p1="C1" p2="C2" radius="nav_radius" until="nav_oval_count>=nav_poles_count"/>
|
||||
</block>
|
||||
<block name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png">
|
||||
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||
<deroute block="land"/>
|
||||
</block>
|
||||
<block name="Land Left AF-TD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png">
|
||||
<set value="-DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||
<deroute block="land"/>
|
||||
</block>
|
||||
<block name="land">
|
||||
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
|
||||
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/>
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > estimator_z" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
<go approaching_time="0" from="AF" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/>
|
||||
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
|
||||
</block>
|
||||
</blocks>
|
||||
</flight_plan>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE settings SYSTEM "settings.dtd">
|
||||
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_settings NAME="Poles">
|
||||
<dl_setting MAX="25" MIN="1" STEP="1" VAR="nav_poles_count" module="nav_poles"/>
|
||||
</dl_settings>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "nav_poles.h"
|
||||
#include "common_nav.h"
|
||||
|
||||
uint8_t nav_poles_count = 0;
|
||||
|
||||
#define SAFETY_MARGIN 0.9
|
||||
|
||||
/** computes position of wp1c and wp2c, reference points for an oval around
|
||||
waypoints wp1 and wp2 */
|
||||
bool nav_poles_init(uint8_t wp1, uint8_t wp2,
|
||||
uint8_t wp1c, uint8_t wp2c,
|
||||
float radius) {
|
||||
float x = WaypointX(wp2) - WaypointX(wp1);
|
||||
float y = WaypointY(wp2) - WaypointY(wp1);
|
||||
float d = sqrt(x*x+y*y);
|
||||
|
||||
/* Unit vector from wp1 to wp2 */
|
||||
x /= d;
|
||||
y /= d;
|
||||
|
||||
WaypointX(wp2c) = WaypointX(wp2) - (x * SAFETY_MARGIN + y) * radius;
|
||||
WaypointY(wp2c) = WaypointY(wp2) - (y * SAFETY_MARGIN - x) * radius;
|
||||
|
||||
WaypointX(wp1c) = WaypointX(wp1) + (x * SAFETY_MARGIN - y) * radius;
|
||||
WaypointY(wp1c) = WaypointY(wp1) + (y * SAFETY_MARGIN + x) * radius;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef NAV_POLS_H
|
||||
#define NAV_POLS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "std.h"
|
||||
|
||||
extern uint8_t nav_poles_count;
|
||||
|
||||
bool nav_poles_init(uint8_t wp1, uint8_t wp2,
|
||||
uint8_t wp1c, uint8_t wp2c,
|
||||
float radius );
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user