CppRobotics icon indicating copy to clipboard operation
CppRobotics copied to clipboard

mpc中的solution为空

Open chengfenghuayu opened this issue 6 years ago • 6 comments

你好~ 我编译通过了model_predictive_control.cpp文件通过了,两个依赖库也安装了,但是运行会显示数数组超界限,然后发现里面求解的 // solve the problem CppAD::ipopt::solve<Dvector, FG_EVAL>( options, vars, vars_lowerbound, vars_upperbound, constraints_lowerbound, constraints_upperbound, fg_eval, solution); 这一步中的solution 求解出来的为空. 库应该时安装对的,你知道是哪里有问题吗? 谢谢~

chengfenghuayu avatar Jun 18 '19 04:06 chengfenghuayu

FYI, 我的相关版本: Ipopt-3.12.13 CppAD-20190200.1 在我这运行没有问题,请注意你有没有给所有变量设置上下界

onlytailei avatar Jun 18 '19 06:06 onlytailei

我是直接跑model_predictive_control的例子的,没有修改任何东西,两个库也安装成和你一样的版本,运行时还是报下面的错误: cppad-20190200.1 error from a known source: vector: index greater than or equal vector size Error detected by false result for i < length_ at line 478 in the file /usr/include/cppad/utility/vector.hpp mpc: /usr/include/cppad/utility/error_handler.hpp:206: static void CppAD::ErrorHandler::Default(bool, int, const char*, const char*, const char*): Assertion `false' failed. Aborted (core dumped)

chengfenghuayu avatar Jun 21 '19 07:06 chengfenghuayu

如果你可以搞成一个docker环境,并且复现相关问题的话 我可以帮你看一下

onlytailei avatar Jun 21 '19 08:06 onlytailei

MPC 出来的路径不对啊,

longjianquan avatar Nov 18 '19 06:11 longjianquan

我是直接跑model_predictive_control的例子的,没有修改任何东西,两个库也安装成和你一样的版本,运行时还是报下面的错误: cppad-20190200.1 error from a known source: vector: index greater than or equal vector size Error detected by false result for i < length_ at line 478 in the file /usr/include/cppad/utility/vector.hpp mpc: /usr/include/cppad/utility/error_handler.hpp:206: static void CppAD::ErrorHandler::Default(bool, int, const char*, const char*, const char*): Assertion `false' failed. Aborted (core dumped)

问题解决了吗。我也遇到了

SilvAmumu avatar Aug 18 '20 06:08 SilvAmumu

应该是ipopt缺少依赖HSL (Harwell Subroutines Library)。 可以按照官方文档中方法安装依赖:https://coin-or.github.io/Ipopt/INSTALL.html#DOWNLOAD_HSL 或者直接用脚本重新安装ipopt:https://blog.csdn.net/weixin_37532614/article/details/105124200

qq543811 avatar Aug 21 '20 02:08 qq543811