px4 BlockLocalPositionEstimator.cpp/hpp 源碼中的疑問

在類BlockLocalPositionEstimator定義了很多私有成員如下

    // general parameters
    BlockParamInt  _pub_agl_z;
    BlockParamFloat  _vxy_pub_thresh;
    BlockParamFloat  _z_pub_thresh;

    // sonar parameters
    BlockParamFloat  _sonar_z_stddev;
    BlockParamFloat  _sonar_z_offset;

    // lidar parameters
    BlockParamFloat  _lidar_z_stddev;
    BlockParamFloat  _lidar_z_offset;

    // accel parameters
    BlockParamFloat  _accel_xy_stddev;
    BlockParamFloat  _accel_z_stddev;

    // baro parameters
    BlockParamFloat  _baro_stddev;

    // gps parameters
    BlockParamInt   _gps_on;
    BlockParamFloat  _gps_delay;
    BlockParamFloat  _gps_xy_stddev;
    BlockParamFloat  _gps_z_stddev;
    BlockParamFloat  _gps_vxy_stddev;
    BlockParamFloat  _gps_vz_stddev;
    BlockParamFloat  _gps_eph_max;
    BlockParamFloat  _gps_epv_max;

    // vision parameters
    BlockParamFloat  _vision_xy_stddev;
    BlockParamFloat  _vision_z_stddev;
    BlockParamFloat  _vision_delay;
    BlockParamInt   _vision_on;

    // mocap parameters
    BlockParamFloat  _mocap_p_stddev;

    // flow parameters
    BlockParamInt  _flow_gyro_comp;
    BlockParamFloat  _flow_z_offset;
    BlockParamFloat  _flow_scale;
    //BlockParamFloat  _flow_board_x_offs;
    //BlockParamFloat  _flow_board_y_offs;
    BlockParamInt    _flow_min_q;

    // land parameters
    BlockParamFloat  _land_z_stddev;

    // process noise
    BlockParamFloat  _pn_p_noise_density;
    BlockParamFloat  _pn_v_noise_density;
    BlockParamFloat  _pn_b_noise_density;
    BlockParamFloat  _pn_t_noise_density;
    BlockParamFloat  _t_max_grade;

    // init origin
    BlockParamFloat  _init_origin_lat;
    BlockParamFloat  _init_origin_lon;

    // flow gyro filter
    BlockHighPass _flow_gyro_x_high_pass;
    BlockHighPass _flow_gyro_y_high_pass;

    // stats
    BlockStats<float, n_y_baro> _baroStats;
    BlockStats<float, n_y_sonar> _sonarStats;
    BlockStats<float, n_y_lidar> _lidarStats;
    BlockStats<float, 1> _flowQStats;
    BlockStats<float, n_y_vision> _visionStats;
    BlockStats<float, n_y_mocap> _mocapStats;
    BlockStats<double, n_y_gps> _gpsStats;
    uint16_t _landCount;

    // low pass
    BlockLowPassVector<float, n_x> _xLowPass;
    BlockLowPass _aglLowPass;

在其構造函數中有以下實現

    // block parameters
    _pub_agl_z(this, "PUB_AGL_Z"),
    _vxy_pub_thresh(this, "VXY_PUB"),
    _z_pub_thresh(this, "Z_PUB"),
    _sonar_z_stddev(this, "SNR_Z"),
    _sonar_z_offset(this, "SNR_OFF_Z"),
    _lidar_z_stddev(this, "LDR_Z"),
    _lidar_z_offset(this, "LDR_OFF_Z"),
    _accel_xy_stddev(this, "ACC_XY"),
    _accel_z_stddev(this, "ACC_Z"),
    _baro_stddev(this, "BAR_Z"),
    _gps_on(this, "GPS_ON"),
    _gps_delay(this, "GPS_DELAY"),
    _gps_xy_stddev(this, "GPS_XY"),
    _gps_z_stddev(this, "GPS_Z"),
    _gps_vxy_stddev(this, "GPS_VXY"),
    _gps_vz_stddev(this, "GPS_VZ"),
    _gps_eph_max(this, "EPH_MAX"),
    _gps_epv_max(this, "EPV_MAX"),
    _vision_xy_stddev(this, "VIS_XY"),
    _vision_z_stddev(this, "VIS_Z"),
    _vision_delay(this, "VIS_DELAY"),
    _vision_on(this, "VIS_ON"),
    _mocap_p_stddev(this, "VIC_P"),
    _flow_gyro_comp(this, "FLW_GYRO_CMP"),
    _flow_z_offset(this, "FLW_OFF_Z"),
    _flow_scale(this, "FLW_SCALE"),
    //_flow_board_x_offs(NULL, "SENS_FLW_XOFF"),
    //_flow_board_y_offs(NULL, "SENS_FLW_YOFF"),
    _flow_min_q(this, "FLW_QMIN"),
    _land_z_stddev(this, "LAND_Z"),
    _pn_p_noise_density(this, "PN_P"),
    _pn_v_noise_density(this, "PN_V"),
    _pn_b_noise_density(this, "PN_B"),
    _pn_t_noise_density(this, "PN_T"),
    _t_max_grade(this, "T_MAX_GRADE"),

    // init origin
    _init_origin_lat(this, "LAT"),
    _init_origin_lon(this, "LON"),

    // flow gyro
    _flow_gyro_x_high_pass(this, "FGYRO_HP"),
    _flow_gyro_y_high_pass(this, "FGYRO_HP"),

    // stats
    _baroStats(this, ""),
    _sonarStats(this, ""),
    _lidarStats(this, ""),
    _flowQStats(this, ""),
    _visionStats(this, ""),
    _mocapStats(this, ""),
    _gpsStats(this, ""),

進入到BlockParam.cpp/hpp的內部也看不懂是怎麼實現的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章