Geonhee-LEE / mpc_ros

Differential Wheeled Mobile Robot - Nonlinear Model Predictive Control based on ROS
https://www.youtube.com/watch?v=5IqFGBmDGjU
Apache License 2.0
727 stars 169 forks source link

Issue with building on branch 'local_planner_plugin' and suggested fix. #34

Closed JohnTGZ closed 2 years ago

JohnTGZ commented 2 years ago

Currently building on Ubuntu 20.04 (ROS Noetic) on local_planner_plugin branch. I get the following error messages:

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/navMPC.cpp:19:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/mpc_plannner.cpp:19:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/MPC.cpp:21:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/trackRefTraj.cpp:20:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

One way to fix said errors is to adopt the fix suggested by this Stack Overflow answer, where I add the following define headers to navMPC.cpp, mpc_plannner.cpp, MPC.cpp, trackRefTraj.cpp :

#define HAVE_CSTDDEF
#include <cppad/ipopt/solve.hpp>
#undef HAVE_CSTDDEF
Geonhee-LEE commented 2 years ago

Hello, @JohnTGZ Did you install Ipopt and change noetic branch?