当前位置: 首页>>代码示例>>C++>>正文


C++ ekf_type函数代码示例

本文整理汇总了C++中ekf_type函数的典型用法代码示例。如果您正苦于以下问题:C++ ekf_type函数的具体用法?C++ ekf_type怎么用?C++ ekf_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ekf_type函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_primary_accel_index

// get the index of the current primary accelerometer sensor
uint8_t AP_AHRS_NavEKF::get_primary_accel_index(void) const
{
    if (ekf_type() != 0) {
        return get_primary_IMU_index();
    }
    return _ins.get_primary_accel();
}
开发者ID:ardupilot-th,项目名称:ardupilot,代码行数:8,代码来源:AP_AHRS_NavEKF.cpp

示例2: WITH_SEMAPHORE

// Resets the baro so that it reads zero at the current height
// Resets the EKF height to zero
// Adjusts the EKf origin height so that the EKF height + origin height is the same as before
// Returns true if the height datum reset has been performed
// If using a range finder for height no reset is performed and it returns false
bool AP_AHRS_NavEKF::resetHeightDatum(void)
{
    // support locked access functions to AHRS data
    WITH_SEMAPHORE(_rsem);
    
    switch (ekf_type()) {

    case 2:
    default: {
        EKF3.resetHeightDatum();
        return EKF2.resetHeightDatum();
    }

    case 3: {
        EKF2.resetHeightDatum();
        return EKF3.resetHeightDatum();
    }

#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
    case EKF_TYPE_SITL:
        return false;
#endif
    }
    return false;
}
开发者ID:ericzhangva,项目名称:ardupilot,代码行数:30,代码来源:AP_AHRS_NavEKF.cpp

示例3: get_primary_gyro_index

// get the index of the current primary gyro sensor
uint8_t AP_AHRS_NavEKF::get_primary_gyro_index(void) const
{
    if (ekf_type() != 0) {
        return get_primary_IMU_index();
    }
    return AP::ins().get_primary_gyro();
}
开发者ID:langfan1990,项目名称:ardupilot,代码行数:8,代码来源:AP_AHRS_NavEKF.cpp

示例4: switch

// passes a reference to the location of the inertial navigation origin
// in WGS-84 coordinates
// returns a boolean true when the inertial navigation origin has been set
bool AP_AHRS_NavEKF::get_origin(Location &ret) const
{
    switch (ekf_type()) {
    case EKF_TYPE_NONE:
        return false;

#if AP_AHRS_WITH_EKF1
    case EKF_TYPE1:
        if (!EKF1.getOriginLLH(ret)) {
            return false;
        }
        return true;
#endif

    case EKF_TYPE2:
    default:
        if (!EKF2.getOriginLLH(ret)) {
            return false;
        }
        return true;

#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
    case EKF_TYPE_SITL:
        ret = get_home();
        return ret.lat != 0 || ret.lng != 0;
#endif
    }
}
开发者ID:AquilaUAS,项目名称:ardupilot,代码行数:31,代码来源:AP_AHRS_NavEKF.cpp

示例5: get_primary_gyro_index

// get the index of the current primary gyro sensor
uint8_t AP_AHRS_NavEKF::get_primary_gyro_index(void) const
{
    if (ekf_type() == 2) {
        return get_primary_IMU_index();
    }
    return _ins.get_primary_gyro();
}
开发者ID:ArmaJo,项目名称:ardupilot,代码行数:8,代码来源:AP_AHRS_NavEKF.cpp

示例6: switch

// passes a reference to the location of the inertial navigation origin
// in WGS-84 coordinates
// returns a boolean true when the inertial navigation origin has been set
bool AP_AHRS_NavEKF::get_origin(Location &ret) const
{
    switch (ekf_type()) {
    case EKF_TYPE_NONE:
        return false;

    case EKF_TYPE2:
    default:
        if (!EKF2.getOriginLLH(-1,ret)) {
            return false;
        }
        return true;

    case EKF_TYPE3:
        if (!EKF3.getOriginLLH(-1,ret)) {
            return false;
        }
        return true;

#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
    case EKF_TYPE_SITL:
        if (!_sitl) {
            return false;
        }
        const struct SITL::sitl_fdm &fdm = _sitl->state;
        ret = fdm.home;
        return true;
#endif
    }
}
开发者ID:langfan1990,项目名称:ardupilot,代码行数:33,代码来源:AP_AHRS_NavEKF.cpp

示例7: switch

// return the amount of yaw angle change due to the last yaw angle reset in radians
// returns the time of the last yaw angle reset or 0 if no reset has ever occurred
uint32_t AP_AHRS_NavEKF::getLastYawResetAngle(float &yawAng)
{
    switch (ekf_type()) {
    case 1:
        return EKF1.getLastYawResetAngle(yawAng);
    case 2:
        return EKF2.getLastYawResetAngle(yawAng);
    }
    return false;
}
开发者ID:czq13,项目名称:THUF35,代码行数:12,代码来源:AP_AHRS_NavEKF.cpp

示例8: switch

// return the amount of NE velocity change in metres/sec due to the last reset
// returns the time of the last reset or 0 if no reset has ever occurred
uint32_t AP_AHRS_NavEKF::getLastVelNorthEastReset(Vector2f &vel) const
{
    switch (ekf_type()) {
    case 1:
        return EKF1.getLastVelNorthEastReset(vel);
    case 2:
        return EKF2.getLastVelNorthEastReset(vel);
    }
    return 0;
}
开发者ID:smagix95,项目名称:ardupilot,代码行数:12,代码来源:AP_AHRS_NavEKF.cpp

示例9: switch

// get_location - updates the provided location with the latest calculated location
//  returns true on success (i.e. the EKF knows it's latest position), false on failure
bool AP_AHRS_NavEKF::get_location(struct Location &loc) const
{
    switch (ekf_type()) {
    case EKF_TYPE_NONE:
        // We are not using an EKF so no data
        return false;

    case EKF_TYPE1:
    default:
        return EKF1.getLLH(loc);

    case EKF_TYPE2:
        return EKF2.getLLH(loc);
    }
}
开发者ID:rotra,项目名称:ardupilot,代码行数:17,代码来源:AP_AHRS_NavEKF.cpp

示例10: switch

void AP_AHRS_NavEKF::setTouchdownExpected(bool val)
{
    switch (ekf_type()) {
        case EKF_TYPE1:
            EKF1.setTouchdownExpected(val);
            break;
        case EKF_TYPE2:
            EKF2.setTouchdownExpected(val);
            break;
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
        case EKF_TYPE_SITL:
            break;
#endif
    }
}
开发者ID:ahmadseyfi,项目名称:ardupilot,代码行数:15,代码来源:AP_AHRS_NavEKF.cpp

示例11: switch

// get earth-frame accel vector for primary IMU
uint8_t AP_AHRS_NavEKF::get_primary_IMU_index() const
{
    int8_t imu = -1;
    switch (ekf_type()) {
    case 2:
        // let EKF2 choose primary IMU
        imu = EKF2.getPrimaryCoreIMUIndex();
        break;
    default:
        break;
    }
    if (imu == -1) {
        imu = _ins.get_primary_accel();
    }
    return imu;
}
开发者ID:ArmaJo,项目名称:ardupilot,代码行数:17,代码来源:AP_AHRS_NavEKF.cpp

示例12: getCorrectedDeltaVelocityNED

// Retrieves the NED delta velocity corrected
void AP_AHRS_NavEKF::getCorrectedDeltaVelocityNED(Vector3f& ret, float& dt) const
{
    if (ekf_type() == 2) {
        uint8_t imu_idx = EKF2.getPrimaryCoreIMUIndex();
        float accel_z_bias;
        EKF2.getAccelZBias(-1,accel_z_bias);
        ret.zero();
        _ins.get_delta_velocity(imu_idx, ret);
        dt = _ins.get_delta_velocity_dt(imu_idx);
        ret.z -= accel_z_bias*dt;
        ret = _dcm_matrix * get_rotation_autopilot_body_to_vehicle_body() * ret;
        ret.z += GRAVITY_MSS*dt;
    } else {
        AP_AHRS::getCorrectedDeltaVelocityNED(ret, dt);
    }
}
开发者ID:ArmaJo,项目名称:ardupilot,代码行数:17,代码来源:AP_AHRS_NavEKF.cpp


注:本文中的ekf_type函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。