解决方案:
退出anaconda的工作环境,在CMakeLists.txt文件里面添加
include_directories(/usr/include/python3.6)
include_directories(/usr/lib/python3/dist-packages/matplotlib)
target_link_libraries(ct_plot ${ct_core_LIBS} /home/sjtuer/anaconda3/lib/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libboost_python-py36.so
/usr/lib/x86_64-linux-gnu/libpython3.6m.so)
git clone https://github.com/giaf/blasfeo.git;
cd blasfeo
mkdir build
cd build
cmake …
make
sudo make install
git clone https://github.com/giaf/hpipm.git
cd hpipm
mkdir build
cd build
cmake …
make
sudo make install
ct_core里面
<package format="3">
<name>ct_core</name>
<version>3.0.2</version>
<description>
Control toolbox - core module.
</description>
<author>Markus Giftthaler</author>
<author>Michael Neunert</author>
<author>Markus Stäuble</author>
<maintainer email="markusgft@gmail.com">Markus Giftthaler</maintainer>
<license>BSD-2</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>eigen</depend>
<!-- <exec_depend>catkin</exec_depend> ROS compatibility -->
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export> <!-- Specify that this is not a ROS package-->
<build_type>ament_cmake</build_type>
</export>
</package>
ct_doc里面:
<package format="3">
<name>ct_doc</name>
<version>3.0.2</version>
<description>
Control toolbox - Documentation
</description>
<maintainer email="markusgft@gmail.com">Markus Giftthaler</maintainer>
<license>BSD-2</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>ct_core</depend>
<depend>ct_optcon</depend>
<depend>ct_rbd</depend>
<depend>ct_models</depend>
<!-- <exec_depend>catkin</exec_depend> ROS compatibility -->
<export> <!-- Specify that this is not a ROS package-->
<build_type>ament_cmake</build_type>
</export>
</package>
ct_models里面:
<package format="3">
<name>ct_models</name>
<version>3.0.2</version>
<description>
Control toolbox - models module.
</description>
<maintainer email="markusgft@gmail.com">Markus Giftthaler</maintainer>
<license>BSD-2</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>ct_rbd</depend>
<!-- <exec_depend>catkin</exec_depend> ROS compatibility -->
<export> <!-- Specify that this is not a ROS package-->
<build_type>ament_cmake</build_type>
</export>
</package>
ct_optcon里面:
<package format="3">
<name>ct_optcon</name>
<version>3.0.2</version>
<description>
Control toolbox - optcon module.
</description>
<license>BSD-2</license>
<author>Markus Giftthaler</author>
<author>Michael Neunert</author>
<author>Markus Stäuble</author>
<maintainer email="markusgft@gmail.com">Markus Giftthaler</maintainer>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>ct_core</depend>
<!-- <exec_depend>catkin</exec_depend> ROS compatibility -->
<export> <!-- Specify that this is not a ROS package-->
<build_type>ament_cmake</build_type>
</export>
</package>
ct_rbd里面:
<package format="3">
<name>ct_rbd</name>
<version>3.0.2</version>
<description>
Control toolbox - rbd module.
</description>
<license>BSD-2</license>
<author>Markus Giftthaler</author>
<author>Michael Neunert</author>
<maintainer email="markusgft@gmail.com">Markus Giftthaler</maintainer>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>ct_optcon</depend>
<depend>kindr</depend>
<!-- <exec_depend>catkin</exec_depend> ROS compatibility -->
<export> <!-- Specify that this is not a ROS package-->
<build_type>ament_cmake</build_type>
</export>
</package>
添加
find_package(ament_cmake REQUIRED)
ament_package()
添加后编译可能会报错,有些包提示找不到ct_core,这个时候在将对应报错的包的ament_package()
注释掉,然后再编译一边就可以了.