junhyeokahn / PnC

Planning and Control Algorithms for Robotics
MIT License
56 stars 12 forks source link

Trim down dependencies for easier C++ installation. Example provided. #4

Closed stevenjj closed 3 years ago

stevenjj commented 3 years ago

@junhyeokahn I was wondering if we can provide a more lean (easier) approach to compiling the code and make everything else optional? The documentation implies that everything needs to be installed for PnC to work. Which is not the case.

Essentially, the C++ example only needs dart to run the code.

But when installing dart using the install script install_dart.sh , it's strange to install liboctomap-dev which we don't even use.

From the official dart install instructions, we can instead reduce the dependencies to the core requirements:

sudo apt-get install build-essential cmake pkg-config git
sudo apt-get install libeigen3-dev libassimp-dev libccd-dev libfcl-dev libboost-regex-dev libboost-system-dev
sudo apt-get install libopenscenegraph-dev

After dart, it seems that the CMakeLists makes pybind11 a hard requirement along with other python dependencies.

I do like the anaconda approach since the repo with python dependencies will be self contained

For the atlas walking, this was the simplest set of install instructions

  1. git clone the PnC repo
  2. source install dart by: git cloning the dart repo, and git checkout the desired version number (release-6.11)
  3. install anaconda by following https://docs.anaconda.com/anaconda/install/linux/
  4. activate and install anaconda dependencies by cd'ing to the PnC repo, and install python dependencies
    conda env create -f pnc.yml
    conda activate pnc
  5. Compile as before
    mkdir build && cd build && cmake.. && make -j4 

    Now we can run the atlas example:

    ./build/bin/run_atlas

    Press spacebar to start the sim. Press WASDEQX keys to get the robot walking around.

But, this is not enough to get the example python simulator working.

 python simulator/pybullet/draco_main.py

since it complains about the draco_interface not being available. It's not clear to me how to debug this one.

junhyeokahn commented 3 years ago

Hello, I agree that we are installing redundant dependencies from Dart.

Currently, all the dependencies listed on the README.md are required and not optional for the sake of the hardware experiment. I wonder how you ran the atlas example without other dependencies l(ZMQ or Protobuf) installed. Were you able to compile the code without other dependencies installed?

stevenjj commented 3 years ago

Ah I see. I think ZMQ and Protobuf was previously installed in my machine for other projects. That's probably why it still worked.

Hmm. I suppose in some sense I'm trying to get the simplicity of the PyPnC to also work with the C++ PnC. For example, it was very nice to run the WBLC code with minimum dependencies: https://github.com/dhkim0821/IJRR_WBLC

But from a fresh install, it seems that the install instructions are pretty good.

I'm closing this for now.

junhyeokahn commented 3 years ago

One possible solution is to differentiate core dependencies (e.g., dart, anaconda for pybind and pybullet) from the optional dependencies (e.g., zmq, protobuf, plotjuggler << these are for online plotting, data streaming and so on..). Based on the flag set in CMakeLists.txt, I can make it compile the minimal (or core) parts in the library. This will let people run example more easier.

Thanks for the suggestion and I will try to make it in near future!