Skip to content

Commit

Permalink
[rotorcraft] ins_int_extended without sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Aug 1, 2013
1 parent df2297f commit f59d32b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sw/airborne/subsystems/ins/ins_int_extended.c
Expand Up @@ -82,6 +82,7 @@ int32_t ins_baro_alt;
#include "filters/median_filter.h"
struct MedianFilterInt baro_median;

#if USE_SONAR
/* sonar */
bool_t ins_update_on_agl;
int32_t ins_sonar_alt;
Expand All @@ -92,6 +93,7 @@ struct MedianFilterInt sonar_median;
#endif
#define VFF_R_SONAR_0 0.1
#define VFF_R_SONAR_OF_M 0.2
#endif // USE_SONAR

/* output */
struct NedCoor_i ins_ltp_pos;
Expand Down Expand Up @@ -122,9 +124,13 @@ void ins_init() {

ins_baro_initialised = FALSE;
init_median_filter(&baro_median);

#if USE_SONAR
ins_update_on_agl = FALSE;
init_median_filter(&sonar_median);
ins_sonar_offset = INS_SONAR_OFFSET;
#endif

vff_init(0., 0., 0., 0.);
ins.vf_realign = FALSE;
ins.hf_realign = FALSE;
Expand Down Expand Up @@ -203,6 +209,7 @@ void ins_update_baro() {
vff_update_baro(alt_float);
}
}
INS_NED_TO_STATE();
}


Expand Down Expand Up @@ -244,6 +251,7 @@ void ins_update_gps(void) {
#endif /* hff not used */

}
INS_NED_TO_STATE();
#endif /* USE_GPS */
}

Expand All @@ -261,6 +269,8 @@ float var_err[VAR_ERR_MAX];
uint8_t var_idx = 0;
#endif


#if USE_SONAR
void ins_update_sonar() {
static float last_offset = 0.;
// new value filtered with median_filter
Expand Down Expand Up @@ -309,3 +319,4 @@ void ins_update_sonar() {
vff_update_offset(last_offset);
}
}
#endif // USE_SONAR

0 comments on commit f59d32b

Please sign in to comment.