-1

自分のプロジェクトをコンパイルすると、次のようなエラーが発生しました。

myRRT.cc:80:78: error: no matching function for call to ‘ompl::tools::SelfConfig::getDefaultNearestNeighbors(ompl::geometric::RRT*)’
        nn_.reset(tools::SelfConfig::getDefaultNearestNeighbors<Motion *>(this));
                                                                              ^
In file included from /home/htf/Downloads/Active-ORB-SLAM2-octomap/src/myRRT.cc:36:0:
/opt/ros/indigo/include/ompl/tools/config/SelfConfig.h:93:42: note: candidate: template<class _T> static ompl::NearestNeighbors<_T>* ompl::tools::SelfConfig::getDefaultNearestNeighbors(const StateSpacePtr&)
             static NearestNeighbors<_T>* getDefaultNearestNeighbors(const base::StateSpacePtr &space)
                                          ^
/opt/ros/indigo/include/ompl/tools/config/SelfConfig.h:93:42: note:   template argument deduction/substitution failed:
/home/htf/Downloads/Active-ORB-SLAM2-octomap/src/myRRT.cc:80:78: note:   cannot convert ‘(ompl::geometric::RRT*)this’ (type ‘ompl::geometric::RRT*’) to type ‘const StateSpacePtr& {aka const boost::shared_ptr<ompl::base::StateSpace>&}’
        nn_.reset(tools::SelfConfig::getDefaultNearestNeighbors<Motion *>(this))

これが私のソースコードの一部です。

void ompl::geometric::RRT::setup()
{
    Planner::setup();
    tools::SelfConfig sc(si_, getName());
    sc.configurePlannerRange(maxDistance_);

    if (!nn_)
       nn_.reset(tools::SelfConfig::getDefaultNearestNeighbors<Motion *>(this));
    nn_->setDistanceFunction(std::bind(&RRT::distanceFunction, this, std::placeholders::_1, std::placeholders::_2));
}

これは、私が参照したサンプル ファイルの 1 つです。RRT で同様の質問に遭遇した人はいますか? 私はC ++を初めて使用します。手がかりが得られることを願っています。前もって感謝します。

4

1 に答える 1