Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重力补偿模块考虑空气阻力 #55

Merged
merged 3 commits into from
Mar 8, 2024
Merged

重力补偿模块考虑空气阻力 #55

merged 3 commits into from
Mar 8, 2024

Conversation

zhaoxi-scut
Copy link
Member

Pull Request 合并请求准备清单

详情参见此处

  • 我同意在 Apache 2 开源许可下为本项目做贡献
  • 此 pull request 是在正确的分支上提出的
  • 此 pull request 有对应的错误报告或其他待改进的内容
  • 我本地的 RMVL 进行了单元测试、性能测试,有对应的测试数据
  • 我提交的 feature 有很好的文档记录,并且可以使用 CMake 项目构建示例代码

具体内容

  • 重力补偿模块修改弹道轨迹计算方式(考虑空气阻力)

单元测试

TEST(GravityCompensator, bulletModel)
{
    rm::GravityCompensator::Impl impl;
    auto [y_fric, t_fric] = impl.bulletModel(10, 16, 45_to_rad);
    // 无阻力情况下
    double t = 10 / (16 * cos(rm::PI_4));
    double y = 16 * sin(rm::PI_4) * t - 0.5 * para::gravity_compensator_param.g * t * t;
    EXPECT_LE(std::abs(y - y_fric), 5e-2);
    EXPECT_LE(std::abs(t - t_fric), 5e-2);
}

本地测试结果

[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from GravityCompensator
[ RUN      ] GravityCompensator.bulletModel
[       OK ] GravityCompensator.bulletModel (0 ms)
[----------] 1 test from GravityCompensator (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 1 test.

@zhaoxi-scut zhaoxi-scut added the optimization 代码重构、功能优化 label Mar 8, 2024
@zhaoxi-scut zhaoxi-scut added this to the 1.3.0 milestone Mar 8, 2024
@zhaoxi-scut zhaoxi-scut merged commit a493287 into cv-rmvl:master Mar 8, 2024
2 checks passed
@zhaoxi-scut zhaoxi-scut deleted the new-gravity-compensator branch March 8, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization 代码重构、功能优化
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant