0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

发表于 2020-8-4 18:34:12 10973 浏览 15 回复

请问EKF2中位置和姿态的uORB消息的更新频率是多少?

请问EKF2中位置和姿态的uORB消息名是什么?更新频率是多少?在EKF2_AID_MASK中选择不同传感器组合做融合会影响更新频率么?
wilsonleong已获得悬赏 10 阿木币

最佳答案

[md]EKF2中update和predict是跑在两个不同的频率上的,update的频率是之前提过的IMU下采样的频率,而predict是IMU的硬件频率(也可能是Pixhawk的硬件频率)。再看飞机的状态:姿态的更新是跑在predict的频率下,只 ...

扫一扫浏览分享
回复

使用道具 举报

110

阿木币

0

精华

142 小时

在线时间

技术大V

Rank: 4

发表于 2020-8-5 08:28:29
不懂帮顶!阿木币好多,土豪!好想回答啊,就是问题太难了。。。
回复 点赞

使用道具 举报

Better 该用户已被删除
发表于 2020-8-5 09:54:08
提示: 作者被禁止或删除 内容自动屏蔽
回复 点赞

使用道具 举报

185

阿木币

3

精华

71 小时

在线时间

技术大V

Rank: 4

发表于 2020-8-5 09:54:21
这个要问黄文(铂贝的EKF课程讲师)了。。我觉得这里没人能回答你
回复 点赞

使用道具 举报

0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

 楼主| 发表于 2020-8-5 10:20:25
Better 发表于 2020-8-5 09:54
EKF2中位置和姿态的uORB消息名是什么,可以在ekf2_mian.cpp中搜索publish关键词 找到主题消息,我大概看了 ...

400hz的更新频率是真实更新频率么?我的真实更新频率的意思是:比如200hz的数据硬是以400hz更新发布,就会有一半都是重复数据,消息发布频率有400hz,但是真实更新频率只有200hz
回复 点赞

使用道具 举报

0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

 楼主| 发表于 2020-8-5 15:43:33
本帖最后由 wilsonleong 于 2020-8-5 15:45 编辑
Better 发表于 2020-8-5 09:54
EKF2中位置和姿态的uORB消息名是什么,可以在ekf2_mian.cpp中搜索publish关键词 找到主题消息,我大概看了 ...

我从sd卡拿到的ulg文件,发现:
1. vehicle_angular_velocity大概45~50hz
2. vehicle_attitude大概20hz
3. vehicle_local_position大概10hz
远不到400hz,是因为ulg降频率采样uORB信号么?
回复 点赞

使用道具 举报

0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

 楼主| 发表于 2020-8-5 21:10:38
wilsonleong 发表于 2020-8-5 15:43
我从sd卡拿到的ulg文件,发现:
1. vehicle_angular_velocity大概45~50hz
2. vehicle_attitude大概20hz

logger.cpp文件的add_topic函数定义了记录的频率

捕获.PNG
回复 点赞

使用道具 举报

0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

 楼主| 发表于 2020-8-5 21:12:23
Better 发表于 2020-8-5 09:54
EKF2中位置和姿态的uORB消息名是什么,可以在ekf2_mian.cpp中搜索publish关键词 找到主题消息,我大概看了 ...

请问ekf2代码哪出定义了400hz的频率?我把vehicle_attitude拿出来看只有250hz
回复 点赞

使用道具 举报

0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

 楼主| 发表于 2020-8-6 10:28:46
1. uorb top 命令实时显示每个主题的发布频率。
2. 日志主题列表可以以 SD 卡文件的形式定制。


2.PNG
1.PNG
回复 点赞

使用道具 举报

0

阿木币

2

精华

76 小时

在线时间

老司机

Rank: 2

 楼主| 发表于 2020-8-10 12:03:49

本帖最后由 wilsonleong 于 2020-8-10 14:22 编辑

IMU下采样

estimator_interface.h

static constexpr unsigned FILTER_UPDATE_PERIOD_MS{10};        // ekf prediction period in milliseconds - this should ideally be an integer multiple of the IMU time delta
static constexpr float FILTER_UPDATE_PERIOD_S{FILTER_UPDATE_PERIOD_MS * 0.001f};
EstimatorInterface():_imu_down_sampler(FILTER_UPDATE_PERIOD_S){};

estimator_interface.cpp

const bool new_downsampled_imu_sample_ready = _imu_down_sampler.update(_newest_high_rate_imu_sample);
_imu_updated = new_downsampled_imu_sample_ready;

// accumulate and down-sample imu data and push to the buffer when new downsampled data becomes available
if (new_downsampled_imu_sample_ready) {

        _imu_buffer.push(_imu_down_sampler.getDownSampledImuAndTriggerReset());

        // get the oldest data from the buffer
        _imu_sample_delayed = _imu_buffer.get_oldest();

        // calculate the minimum interval between observations required to guarantee no loss of data
        // this will occur if data is overwritten before its time stamp falls behind the fusion time horizon
        _min_obs_interval_us = (_newest_high_rate_imu_sample.time_us - _imu_sample_delayed.time_us) / (_obs_buffer_length - 1);

        setDragData();
}

imu_down_sampler.cpp

bool ImuDownSampler::update(const imuSample &imu_sample_new)
{
    if (_do_reset) {
        reset();
    }

    // accumulate time deltas
    _imu_down_sampled.delta_ang_dt += imu_sample_new.delta_ang_dt;
    _imu_down_sampled.delta_vel_dt += imu_sample_new.delta_vel_dt;
    _imu_down_sampled.time_us = imu_sample_new.time_us;
    _imu_down_sampled.delta_vel_clipping[0] += imu_sample_new.delta_vel_clipping[0];
    _imu_down_sampled.delta_vel_clipping[1] += imu_sample_new.delta_vel_clipping[1];
    _imu_down_sampled.delta_vel_clipping[2] += imu_sample_new.delta_vel_clipping[2];

    // use a quaternion to accumulate delta angle data
    // this quaternion represents the rotation from the start to end of the accumulation period
    const Quatf delta_q(AxisAnglef(imu_sample_new.delta_ang));
    _delta_angle_accumulated = _delta_angle_accumulated * delta_q;
    _delta_angle_accumulated.normalize();

    // rotate the accumulated delta velocity data forward each time so it is always in the updated rotation frame
    const Dcmf delta_R(delta_q.inversed());
    _imu_down_sampled.delta_vel = delta_R * _imu_down_sampled.delta_vel;

    // accumulate the most recent delta velocity data at the updated rotation frame
    // assume effective sample time is halfway between the previous and current rotation frame
    _imu_down_sampled.delta_vel += (imu_sample_new.delta_vel + delta_R * imu_sample_new.delta_vel) * 0.5f;

    // check if the target time delta between filter prediction steps has been exceeded
    if (_imu_down_sampled.delta_ang_dt >= _target_dt - _imu_collection_time_adj) {
        // accumulate the amount of time to advance the IMU collection time so that we meet the
        // average EKF update rate requirement
        _imu_collection_time_adj += 0.01f * (_imu_down_sampled.delta_ang_dt - _target_dt);
        _imu_collection_time_adj = math::constrain(_imu_collection_time_adj, -0.5f * _target_dt,
                               0.5f * _target_dt);

        _imu_down_sampled.delta_ang = _delta_angle_accumulated.to_axis_angle();

        return true;

    } else {

        return false;
    }
}
回复 点赞

使用道具 举报

下一页 »
12下一页
返回列表
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表