4 #include <px4_platform_common/module.h> 5 #include <px4_platform_common/module_params.h> 6 #include <px4_platform_common/posix.h> 117 static int task_spawn(
int argc,
char *argv[]);
120 static int custom_command(
int argc,
char *argv[]);
123 static int print_usage(
const char *reason =
nullptr);
130 enum {X_x = 0, X_y,
X_z, X_vx, X_vy, X_vz, X_bx, X_by, X_bz, X_tz, n_x};
131 enum {U_ax = 0, U_ay,
U_az, n_u};
132 enum {Y_baro_z = 0, n_y_baro};
133 enum {Y_lidar_z = 0, n_y_lidar};
135 enum {Y_sonar_z = 0, n_y_sonar};
136 enum {Y_gps_x = 0, Y_gps_y,
Y_gps_z, Y_gps_vx, Y_gps_vy, Y_gps_vz, n_y_gps};
144 FUSE_VIS_POS = 1 << 2,
145 FUSE_LAND_TARGET = 1 << 3,
147 FUSE_PUB_AGL_Z = 1 << 5,
148 FUSE_FLOW_GYRO_COMP = 1 << 6,
153 SENSOR_BARO = 1 << 0,
155 SENSOR_LIDAR = 1 << 2,
156 SENSOR_FLOW = 1 << 3,
157 SENSOR_SONAR = 1 << 4,
158 SENSOR_VISION = 1 << 5,
159 SENSOR_MOCAP = 1 << 6,
160 SENSOR_LAND = 1 << 7,
161 SENSOR_LAND_TARGET = 1 << 8,
181 void updateSSStates();
182 void updateSSParams();
191 void lidarCheckTimeout();
197 void sonarCheckTimeout();
203 void baroCheckTimeout();
209 void gpsCheckTimeout();
215 void flowCheckTimeout();
219 void visionCorrect();
221 void visionCheckTimeout();
227 void mocapCheckTimeout();
233 void landCheckTimeout();
237 void landingTargetCorrect();
238 void landingTargetInit();
239 void landingTargetCheckTimeout();
242 void checkTimeouts();
247 return _x(X_tz) - _x(X_z);
250 int getDelayPeriods(
float delay, uint8_t *periods);
253 void publishLocalPos();
254 void publishGlobalPos();
256 void publishEstimatorStatus();
296 Target_Stationary = 1
396 (ParamInt<px4::params::SYS_AUTOSTART>) _param_sys_autostart,
399 (ParamInt<px4::params::LPE_FUSION>) _param_lpe_fusion,
400 (ParamFloat<px4::params::LPE_VXY_PUB>) _param_lpe_vxy_pub,
401 (ParamFloat<px4::params::LPE_Z_PUB>) _param_lpe_z_pub,
404 (ParamFloat<px4::params::LPE_SNR_Z>) _param_lpe_snr_z,
405 (ParamFloat<px4::params::LPE_SNR_OFF_Z>) _param_lpe_snr_off_z,
408 (ParamFloat<px4::params::LPE_LDR_Z>) _param_lpe_ldr_z,
409 (ParamFloat<px4::params::LPE_LDR_OFF_Z>) _param_lpe_ldr_off_z,
412 (ParamFloat<px4::params::LPE_ACC_XY>) _param_lpe_acc_xy,
413 (ParamFloat<px4::params::LPE_ACC_Z>) _param_lpe_acc_z,
416 (ParamFloat<px4::params::LPE_BAR_Z>) _param_lpe_bar_z,
419 (ParamFloat<px4::params::LPE_GPS_DELAY>) _param_lpe_gps_delay,
420 (ParamFloat<px4::params::LPE_GPS_XY>) _param_lpe_gps_xy,
421 (ParamFloat<px4::params::LPE_GPS_Z>) _param_lpe_gps_z,
422 (ParamFloat<px4::params::LPE_GPS_VXY>) _param_lpe_gps_vxy,
423 (ParamFloat<px4::params::LPE_GPS_VZ>) _param_lpe_gps_vz,
424 (ParamFloat<px4::params::LPE_EPH_MAX>) _param_lpe_eph_max,
425 (ParamFloat<px4::params::LPE_EPV_MAX>) _param_lpe_epv_max,
428 (ParamFloat<px4::params::LPE_VIS_XY>) _param_lpe_vis_xy,
429 (ParamFloat<px4::params::LPE_VIS_Z>) _param_lpe_vis_z,
430 (ParamFloat<px4::params::LPE_VIS_DELAY>) _param_lpe_vis_delay,
433 (ParamFloat<px4::params::LPE_VIC_P>) _param_lpe_vic_p,
436 (ParamFloat<px4::params::LPE_FLW_OFF_Z>) _param_lpe_flw_off_z,
437 (ParamFloat<px4::params::LPE_FLW_SCALE>) _param_lpe_flw_scale,
438 (ParamInt<px4::params::LPE_FLW_QMIN>) _param_lpe_flw_qmin,
439 (ParamFloat<px4::params::LPE_FLW_R>) _param_lpe_flw_r,
440 (ParamFloat<px4::params::LPE_FLW_RR>) _param_lpe_flw_rr,
443 (ParamFloat<px4::params::LPE_LAND_Z>) _param_lpe_land_z,
444 (ParamFloat<px4::params::LPE_LAND_VXY>) _param_lpe_land_vxy,
447 (ParamFloat<px4::params::LPE_PN_P>) _param_lpe_pn_p,
448 (ParamFloat<px4::params::LPE_PN_V>) _param_lpe_pn_v,
449 (ParamFloat<px4::params::LPE_PN_B>) _param_lpe_pn_b,
450 (ParamFloat<px4::params::LPE_PN_T>) _param_lpe_pn_t,
451 (ParamFloat<px4::params::LPE_T_MAX_GRADE>) _param_lpe_t_max_grade,
453 (ParamFloat<px4::params::LPE_LT_COV>) _param_lpe_lt_cov,
454 (ParamInt<px4::params::LTEST_MODE>) _param_ltest_mode,
457 (ParamInt<px4::params::LPE_FAKE_ORIGIN>) _param_lpe_fake_origin,
458 (ParamFloat<px4::params::LPE_LAT>) _param_lpe_lat,
459 (ParamFloat<px4::params::LPE_LON>) _param_lpe_lon
uint64_t _global_ref_timestamp
uint64_t _time_last_mocap
static const float BETA_TABLE[7]
uint8_t _estimatorInitialized
BlockStats< float, n_y_lidar > _lidarStats
BlockStats< float, 1 > _flowQStats
BlockStats< float, n_y_sonar > _sonarStats
Definition of geo / math functions to perform geodesic calculations.
BlockStats< float, n_y_baro > _baroStats
static const size_t HIST_LEN
uint64_t _time_init_sonar
A high pass filter as described here: http://en.wikipedia.org/wiki/High-pass_filter.
BlockStats< double, n_y_gps > _gpsStats
matrix::Dcm< float > _R_att
static void print_usage()
High-resolution timer with callouts and timekeeping.
static const size_t N_DIST_SUBS
A low pass filter as described here: http://en.wikipedia.org/wiki/Low-pass_filter.
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
Matrix< float, n_u, n_u > m_R
static const float DELAY_MAX
void init()
Activates/configures the hardware registers.
BlockStats< float, n_y_mocap > _mocapStats
static const float HIST_STEP
BlockHighPass _flow_gyro_y_high_pass
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
uint64_t _time_last_lidar
Matrix< float, n_x, n_x > m_Q
uint64_t _time_last_target
static const float BIAS_MAX
Matrix< float, n_x, n_x > m_A
Matrix< float, n_x, n_x > m_P
BlockLowPassVector< float, n_x > _xLowPass
uint64_t _time_last_vision_p
uint64_t _time_last_sonar
Matrix< float, n_x, n_u > m_B
BlockDelay< uint64_t, 1, 1, HIST_LEN > _tDelay
A simple matrix template library.
BlockStats< float, n_y_vision > _visionStats
uint64_t _timeStampLastBaro
BlockDelay< float, n_x, 1, HIST_LEN > _xDelay
BlockHighPass _flow_gyro_x_high_pass
bool _altOriginInitialized