machines-in-motion / kino_dynamic_opt

Kino-dynamic optimization algorithm for multiped robots
BSD 3-Clause "New" or "Revised" License
39 stars 9 forks source link

Pure cmake #37

Closed righetti closed 3 years ago

righetti commented 3 years ago

Description

The goal is to create an ament-free, pure cmake version of this package that still can be compiled and installed using colcon. The package can also be compiled independently using cmake only.

How I Tested

Do not merge before

I fulfilled the following requirements

jviereck commented 3 years ago

I tried to install this on Ubuntu 18.04. When running the colcon build --merge-install I end up with problems finding the pybind11 cmake setup:

$ colcon build --merge-install
Starting >>> solver  
--- stderr: solver
CMake Error at CMakeLists.txt:25 (find_package):
  Could not find a package configuration file provided by "pybind11" with any
  of the following names:

    pybind11Config.cmake
    pybind11-config.cmake

I tired to fix this by installing the pybind11 pip package without success. In addition, I tried to use the pybind11_vendor package. However, this relies on ament again, which was the idea to avoid with the repackaging.

jviereck commented 3 years ago

Installing the pybind11 via the apt-get package seems to resolve the last reported issue:

sudo apt-get install python-pybind11
jviereck commented 3 years ago

When building the yaml_utils package on the pure_cmake branch, I was getting

$ colcon build --merge-install
Starting >>> yaml_utils
--- stderr: yaml_utils
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)

The solution for me was to build the gtest library as outlined here: https://stackoverflow.com/a/52392930

sudo apt install libgtest-dev build-essential cmake
cd /usr/src/googletest
sudo cmake .
sudo cmake --build . --target install
righetti commented 3 years ago

Installing the pybind11 via the apt-get package seems to resolve the last reported issue:

sudo apt-get install python-pybind11

You would need to do a global install with pip to get the cmake files in the right directory https://github.com/pybind/pybind11/blob/master/docs/installing.rst#include-with-pypi Not sure what's the best policy for our lab. I used brew install pybind11 on my machine for this reason.

MaximilienNaveau commented 3 years ago

@righetti @jviereck @majidkhadiv can you run the demo on solo8? They should pass. The one on bolt and solo12 did not finished properly. The one with bolt hanged (my pc maybe too slow) The one with solo12 crashed due to some eigen stuff (yaml parsing?)

If you all validated we should merge.

jviereck commented 3 years ago

If you all validated we should merge.

Can you tell me which command to run for this? We fixed some problem with the solo12 demos on the amd-clmc repo. Maybe we have to port it over here as well.

MaximilienNaveau commented 3 years ago

I you fixed some demos for solo12 we should do a PR here yes

workspace/src/kino_dynamic_opt/momentumopt/demos
cd 
ipython demo_momentumopt_solo_jump.py
ipython demo_momentumopt_solo_jump_no_lqr.py