nicolapiccinelli / libmpc

libmpc++ is a C++ header-only library to solve linear and non-linear MPC
https://altairlab.gitlab.io/optcontrol/libmpc/
MIT License
137 stars 21 forks source link

ROS implementation of libmpc? #17

Closed abdelhakim96 closed 1 year ago

abdelhakim96 commented 1 year ago

I want to try using libmpc in ROS, I'm having troubles with compiling the ROS package due to issues with boost. Did someone try to make a ROS package implementation? would be very helpful. Thanks!

nicolapiccinelli commented 1 year ago

I've integrated libmpc++ in ROS 1 several times but I've not released an official integration yet since it is hard to define a clear use case to build the ROS package. As far as I know, since libmpc++ requires C++20 it is not possible to directly integrate it in a ROS node due to some compilation conflicts once enabling the support for c++20.

Anyway, what I usually do to circumvent it is to use the ROS pluginlib library. You have to compile the controller featuring libmpc++ separately and then load it as a plugin inside the ROS node. In this way, you can compile your controller with c++20 enabled by keeping the ROS node compilation with the C++ version required by your ROS version.