对于模拟,我使用boost ::数字:: odeint但我有一个问题。 我使用了我的一个类的方法内部集成的功能,我有“不匹配功能呼叫整合”的错误。 为了更清楚,这里是我的代码的压缩版本:
#include "MotionGeneration.h"
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
typedef boost::array< double , 10 > state_type;
MotionGeneration::MotionGeneration(some_data) {
//My constructor.
//some_data assignment.
}
MotionGeneration::~MotionGeneration() {
}
double MotionGeneration::getError(double time) {
//error calculation.
}
void MotionGeneration::execute(){
state_type init_conf = { 0, -1.5708, 0, 0, 0, -1.5708, 0, -1.5708, 0, 0.5};
boost::numeric::odeint::integrate(motionScheme, init_conf, 0.0, 1.0, 0.05, plot);
}
void MotionGeneration::motionScheme(const state_type &q, state_type &q_dot, double t){
//Some long code goes here. Also I have some calls to some methods of this class. for example:
double err = getError(t);
}
void MotionGeneration::plot(const state_type &q , const double t){
//some data pfintf here.
}
请注意,所有的我的方法是静态的,并且事实上,我不能用静态方法。 当我生成项目,我有以下错误:
error: no matching function for call to `integrate(<unknown type>, state_type&, double, double, double, <unknown type>)'
我认为这是具有系统功能的一类方法的问题,但我不知道如何处理这种情况。