mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
little bit cleanup in estimator, no functional changes
This commit is contained in:
@@ -12,13 +12,13 @@
|
|||||||
<define name="USE_BARO_AS_ALTIMETER"/>
|
<define name="USE_BARO_AS_ALTIMETER"/>
|
||||||
<raw>
|
<raw>
|
||||||
ifeq ($(BOARD), navgo)
|
ifeq ($(BOARD), navgo)
|
||||||
ap.CFLAGS += -DUSE_I2C1 -DUSE_ADS1114_1
|
ap.CFLAGS += -DUSE_I2C1 -DUSE_ADS1114_1
|
||||||
ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1
|
ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1
|
||||||
ap.srcs += peripherals/ads1114.c
|
ap.srcs += peripherals/ads1114.c
|
||||||
else ifeq ($(BOARD), umarim)
|
else ifeq ($(BOARD), umarim)
|
||||||
ap.CFLAGS += -DUSE_I2C1 -DUSE_ADS1114_1
|
ap.CFLAGS += -DUSE_I2C1 -DUSE_ADS1114_1
|
||||||
ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1
|
ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1
|
||||||
ap.srcs += peripherals/ads1114.c
|
ap.srcs += peripherals/ads1114.c
|
||||||
endif
|
endif
|
||||||
</raw>
|
</raw>
|
||||||
</makefile>
|
</makefile>
|
||||||
|
|||||||
+2
-11
@@ -75,19 +75,13 @@ float estimator_AOA;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// FIXME maybe vz = -climb for NED??
|
|
||||||
#define EstimatorSetSpeedCart(vx, vy, vz) { \
|
#define EstimatorSetSpeedCart(vx, vy, vz) { \
|
||||||
estimator_vx = vx; \
|
estimator_vx = vx; \
|
||||||
estimator_vy = vy; \
|
estimator_vy = vy; \
|
||||||
estimator_vz = vz; \
|
estimator_vz = vz; \
|
||||||
}
|
}
|
||||||
// estimator_hspeed_mod = sqrt( estimator_vx * estimator_vx + estimator_vy * estimator_vy);
|
|
||||||
// estimator_hspeed_dir = atan2(estimator_vy, estimator_vx);
|
|
||||||
|
|
||||||
|
|
||||||
//FIXME is this true ?? estimator_vx = estimator_hspeed_mod * cos(estimator_hspeed_dir);
|
|
||||||
//FIXME is this true ?? estimator_vy = estimator_hspeed_mod * sin(estimator_hspeed_dir);
|
|
||||||
|
|
||||||
void estimator_init( void ) {
|
void estimator_init( void ) {
|
||||||
|
|
||||||
EstimatorSetPosXY(0., 0.);
|
EstimatorSetPosXY(0., 0.);
|
||||||
@@ -99,17 +93,14 @@ void estimator_init( void ) {
|
|||||||
|
|
||||||
EstimatorSetRate(0., 0., 0.);
|
EstimatorSetRate(0., 0., 0.);
|
||||||
|
|
||||||
#if USE_AIRSPEED
|
|
||||||
EstimatorSetAirspeed( 0. );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_AOA
|
#ifdef USE_AOA
|
||||||
EstimatorSetAOA( 0. );
|
EstimatorSetAOA( 0. );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
estimator_flight_time = 0;
|
estimator_flight_time = 0;
|
||||||
|
|
||||||
estimator_airspeed = NOMINAL_AIRSPEED;
|
// FIXME? Set initial airspeed to zero if USE_AIRSPEED ?
|
||||||
|
EstimatorSetAirspeed( NOMINAL_AIRSPEED );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user