Merge remote-tracking branch 'paparazzi/master' into dev

This commit is contained in:
Felix Ruess
2011-08-10 23:53:49 +02:00
13 changed files with 21 additions and 165 deletions
-84
View File
@@ -1,84 +0,0 @@
<!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 "subsystems/navigation/nav_line.h"
#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="10.1" y="189.9"/>
<waypoint name="2" x="132.3" y="139.1"/>
<waypoint name="MOB" x="137.0" y="-11.6"/>
<waypoint name="S1" x="-119.2" y="69.6"/>
<waypoint name="S2" x="274.4" y="209.5"/>
<waypoint alt="30.0" name="AF" x="177.4" y="45.1"/>
<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"/>
</waypoints>
<blocks>
<block name="Wait GPS">
<set value="1" var="kill_throttle"/>
<while cond="!GpsFixValid()"/>
</block>
<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 10)"/>
<call fun="NavSetGroundReferenceHere()"/>
</block>
<block name="Hold for Takeoff">
<set value="1" var="kill_throttle"/>
<attitude roll="0" throttle="0" vmode="throttle"/>
</block>
<block name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png">
<set value="0" var="kill_throttle"/>
<set value="0" var="estimator_flight_time"/>
<deroute block="Standby"/>
</block>
<block name="Standby" strip_button="Standby" strip_icon="home.png">
<circle radius="nav_radius" wp="STDBY"/>
</block>
<block name="Figure 8 around wp 1" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png">
<eight center="1" radius="nav_radius" turn_around="2"/>
</block>
<block name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png">
<oval p1="1" p2="2" radius="nav_radius"/>
</block>
<block name="MOB" strip_button="Circle here" strip_icon="mob.png">
<call fun="NavSetWaypointHere(WP_MOB)"/>
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
<circle radius="nav_radius" wp="MOB"/>
</block>
<block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png">
<call fun="nav_line_init()"/>
<call fun="nav_line(WP_1, WP_2, nav_radius)"/>
</block>
<block name="Survey S1-S2" strip_button="Survey (wp S1-S2)" strip_icon="survey.png">
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
</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="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*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" approaching_time="THROTTLE_CUT_APPROACHING_TIME" hmode="route" wp="TD" alt="WaypointAlt(WP_AF)"/>
<go from="AF" approaching_time="FLARE_APPROACHING_TIME" vmode="throttle" throttle="0.1" hmode="route" wp="TD"/>
<deroute block="flare"/>
</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>
+2
View File
@@ -574,6 +574,8 @@
</message>
<message name="BMP_STATUS" id="84">
<field name="UP" type="int32"/>
<field name="UT" type="int32"/>
<field name="press" type="int32" unit="Pa"/>
<field name="temp" type="int32" unit="10x_deg_celsius"/>
</message>
-54
View File
@@ -1,54 +0,0 @@
<!-- $Id$ -->
<!-- coronis wavecard protocol description -->
<wavecard>
<constant name="sync" val="0xFF"/>
<constant name="stx" val="0x02"/>
<constant name="etx" val="0x03"/>
<class name="control">
<message name="ACK" ID="0x06"/>
<message name="NAK" ID="0x15"/>
<message name="ERROR" ID="0x00">
<field name="errno" format="U1">
</message>
</class>
<class name="applicative">
<class name="request">
0x40, "REQ_WRITE_RADIO_PARAM";
0x41, "RES_WRITE_RADIO_PARAM";
0x50, "REQ_READ_RADIO_PARAM";
0x51, "RES_READ_RADIO_PARAM";
0x60, "REQ_SELECT_CHANNEL";
0x61, "RES_SELECT_CHANNEL";
0x62, "REQ_READ_CHANNEL";
0x63, "RES_READ_CHANNEL";
0x64, "REQ_SELECT_PHYCONFIG";
0x65, "RES_SELECT_PHYCONFIG";
0x66, "REQ_READ_PHYCONFIG";
0x67, "RES_READ_PHYCONFIG";
0x68, "REQ_READ_REMOTE_RSSI";
0x69, "RES_READ_REMOTE_RSSI";
0x6A, "REQ_READ_LOCAL_RSSI";
0x6B, "RES_READ_LOCAL_RSSI";
0xA0, "REQ_FIRMWARE_VERSION";
0xA1, "RES_ FIRMWARE_VERSION";
</class>
<class name="response">
</class>
</class>
<class name="rf_dialog">
</class>
<class name="test">
</class>
</wavecard>
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sector name="ricou" lat0="43.237535" lon0="1.327747">
<waypoint name="HOME" x="-29.0" y="-100.0" alt="440."/>
<waypoint name="THRS" x="8.0" y="-46.0" alt="350."/>
<waypoint name="FAF" x="211.0" y="-136.0" alt="360."/>
</sector>
<sector name="muret" lat0="43.46223" lon0="1.27289">
<waypoint name="HOME" x="0.0" y="30.0" alt="250."/>
<waypoint name="AF" x="267.5" y="35.0" alt="215."/>
<waypoint name="RWAY" x="0.0" y="30.0" alt="185."/>
<waypoint name="IAF" x="267.5" y="200.0" alt="250."/>
</sector>
<sector name="magny" lat0="48.7356" lon0="2.0478">
<waypoint name="HOME" x="-30" y="20"/>
<waypoint name="Cimetiere" x="640" y="500"/>
<waypoint name="Romainville" x="-781" y="381"/>
</sector>
+3 -3
View File
@@ -130,7 +130,7 @@ void baro_bmp_event( void ) {
/* get uncompensated pressure, oss=3 */
bmp_up = (bmp_trans.buf[0] << 11) |
(bmp_trans.buf[1] << 3) |
bmp_trans.buf[2];
(bmp_trans.buf[2] >> 5);
/* start temp measurement */
bmp_trans.buf[0] = BMP085_CTRL_REG;
bmp_trans.buf[1] = BMP085_START_TEMP;
@@ -157,7 +157,7 @@ void baro_bmp_event( void ) {
if (bmp_b7 < 0x80000000)
bmp_p = (bmp_b7 * 2) / bmp_b4;
else
bmp_p = (bmp_b7 * bmp_b4) * 2;
bmp_p = (bmp_b7 / bmp_b4) * 2;
bmp_x1 = (bmp_p / (1<<8)) * (bmp_p / (1<<8));
bmp_x1 = (bmp_x1 * 3038) / (1<<16);
bmp_x2 = (-7357 * bmp_p) / (1<<16);
@@ -166,7 +166,7 @@ void baro_bmp_event( void ) {
baro_bmp_temperature = bmp_t;
baro_bmp_pressure = bmp_p;
#ifdef SENSOR_SYNC_SEND
DOWNLINK_SEND_BMP_STATUS(DefaultChannel, &bmp_p, &bmp_t);
DOWNLINK_SEND_BMP_STATUS(DefaultChannel, &bmp_up, &bmp_ut, &bmp_p, &bmp_t);
#endif
}
}
+2 -2
View File
@@ -462,8 +462,8 @@ void Drift_correction(void)
// Here we will place a limit on the integrator so that the integrator cannot ever exceed half the saturation limit of the gyros
Integrator_magnitude = sqrt(Vector_Dot_Product(Omega_I,Omega_I));
if (Integrator_magnitude > DegOfRad(300)) {
Vector_Scale(Omega_I,Omega_I,0.5f*DegOfRad(300)/Integrator_magnitude);
if (Integrator_magnitude > RadOfDeg(300)) {
Vector_Scale(Omega_I,Omega_I,0.5f*RadOfDeg(300)/Integrator_magnitude);
}
+1
View File
@@ -79,6 +79,7 @@ struct GpsState {
uint8_t nb_channels; ///< Number of scanned satellites
struct SVinfo svinfos[GPS_NB_CHANNELS];
uint32_t last_fix_ticks; ///< cpu time in ticks at last valid fix
uint16_t last_fix_time; ///< cpu time in sec at last valid fix
uint16_t reset; ///< hotstart, warmstart, coldstart
};
+1
View File
@@ -87,6 +87,7 @@ extern bool_t gps_configuring;
if (gps_mtk.msg_class == MTK_DIY16_ID && \
gps_mtk.msg_id == MTK_DIY16_NAV_ID) { \
if (gps.fix == GPS_FIX_3D) { \
gps.last_fix_ticks = cpu_time_ticks; \
gps.last_fix_time = cpu_time_sec; \
} \
_sol_available_callback(); \
+1
View File
@@ -69,6 +69,7 @@ extern struct GpsNmea gps_nmea;
nmea_parse_msg(); \
if (gps_nmea.pos_available) { \
if (gps.fix == GPS_FIX_3D) { \
gps.last_fix_ticks = cpu_time_ticks; \
gps.last_fix_time = cpu_time_sec; \
} \
_sol_available_callback(); \
+1
View File
@@ -96,6 +96,7 @@ extern struct GpsSkytraq gps_skytraq;
gps_skytraq_read_message(); \
if (gps_skytraq.msg_id == SKYTRAQ_ID_NAVIGATION_DATA) { \
if (gps.fix == GPS_FIX_3D) \
gps.last_fix_ticks = cpu_time_ticks; \
gps.last_fix_time = cpu_time_sec; \
_sol_available_callback(); \
} \
+2
View File
@@ -93,6 +93,7 @@ void gps_impl_init(void) {
gps_status_config = 0;
gps_configuring = TRUE;
#endif
gps_ubx.have_velned = 0;
}
@@ -172,6 +173,7 @@ void gps_ubx_read_message(void) {
// First x 10 for loosing less resolution, then to radians, then multiply x 10 again
gps.course = (RadOfDeg(UBX_NAV_VELNED_Heading(gps_ubx.msg_buf)*10)) * 10;
gps.tow = UBX_NAV_VELNED_ITOW(gps_ubx.msg_buf);
gps_ubx.have_velned = 1;
}
else if (gps_ubx.msg_id == UBX_NAV_SVINFO_ID) {
gps.nb_channels = Min(UBX_NAV_SVINFO_NCH(gps_ubx.msg_buf), GPS_NB_CHANNELS);
+4 -1
View File
@@ -51,6 +51,7 @@ struct GpsUbx {
uint8_t status_flags;
uint8_t sol_flags;
uint8_t have_velned;
};
extern struct GpsUbx gps_ubx;
@@ -89,8 +90,10 @@ extern bool_t gps_configuring;
GpsParseOrConfigure(); \
if (gps_ubx.msg_class == UBX_NAV_ID && \
(gps_ubx.msg_id == UBX_NAV_VELNED_ID || \
gps_ubx.msg_id == UBX_NAV_SOL_ID)) { \
(gps_ubx.msg_id == UBX_NAV_SOL_ID && \
gps_ubx.have_velned == 0))) { \
if (gps.fix == GPS_FIX_3D) { \
gps.last_fix_ticks = cpu_time_ticks; \
gps.last_fix_time = cpu_time_sec; \
} \
_sol_available_callback(); \
+4 -1
View File
@@ -22,7 +22,7 @@
#
import sys
import os
from optparse import OptionParser
import scipy
@@ -50,6 +50,9 @@ def main():
else:
print args[0] + " not found"
sys.exit(1)
if options.sensor == "GYRO":
print "You can't calibate gyros with this!"
sys.exit(1)
ac_ids = calibration_utils.get_ids_in_log(filename)
# import code; code.interact(local=locals())
if options.ac_id == None and len(ac_ids) == 1: