为什么在FCL中使用fcl::continuousCollide会报错?

问题描述

我用vs2019写了一个简单的连续碰撞的例子,但是总是编译不了。 错误信息:

C2259   'fcl::InterpMotion<S>': cannot instantiate abstract class   
C2259   'fcl::ScrewMotion<S>': cannot instantiate abstract class
    auto g1 = std::make_shared<fcl::Boxf>(1,2,3);
    auto t1 = fcl::Transform3f::Identity();
    auto o1 = new fcl::CollisionObjectf(g1,t1);
    auto t1_final = fcl::Transform3f::Identity();
    t1_final.translation() = fcl::Vector3f(1,0);

    auto g2 = std::make_shared<fcl::Conef>(1,3);
    auto t2 = fcl::Transform3f::Identity();
    auto o2 = new fcl::CollisionObjectf(g2,t2);
    auto t2_final = fcl::Transform3f::Identity();
    t2_final.translation() = fcl::Vector3f(-1,0);

    fcl::ContinuousCollisionRequestf request;
    fcl::ContinuousCollisionResultf result;
    std::cout << fcl::continuousCollide(o1,t1_final,o2,t2_final,request,result);

    delete o1;
    delete o2;

'fcl::InterpMotion': cannot instantiate abstract class

解决方法

fcl/math/motion/interp_motion.h fcl/math/motion/interp_motion-inl.h fcl/math/motion/screw_motion.h fcl/math/motion/screw_motion-inl.h 我不得不将 double 更改为 S

template <typename S>
bool InterpMotion<S>::integrate(double dt) const

template <typename S>
bool InterpMotion<S>::integrate(S dt) const

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...