In this tutorial we learn how to install Klamp't, step by step.
Difficulty: easy
Time: 10-30 minutes
For Mac OSX (Mavericks) 10.9 and above, and Python 2.7, or 3.5-3.12, you should be able to simply run
pip install klampt
To run a visualization, you will need PyOpenGL and PyQt5 (or PyQt6):
pip install PyOpenGLpip install PyQt5git clone http://github.com/krishauser/Klampt-examples(this is needed to run example programs)cd Klampt-examples/Python3/demos/controlpython simulated_mirobot.py
-
You will need to install the Xcode Command Line Tools. To see if they are installed, run
xcode-select -pIf you see
/Applications/Xcode.app/Contents/Developerthen the full Xcode package is already installed. If not, you'll need to run
xcode-select --install -
Install XQuartz from http://xquartz.macosforge.org/
-
Install homebrew from http://brew.sh
-
In the terminal, run
brew install assimp cmake ffmpeg freeglut glui homebrew/science/glpk python qt5 ode --with-double-precision -
Clone the Klamp't git repo:
git clone https://github.com/krishauser/Klampt -
Make the Klamp't dependencies:
cd Klampt/Cpp/Dependencies; make unpack-deps; make deps -
Configure Klamp't via CMake
cd ..\..\; cmake .or
cmake -DCMAKE_BUILD_TYPE=Debug .if you wish to have debugging information.
-
Compile the Klamp't static library:
make Klampt -
Make the apps:
make apps -
Obtain the Klampt-examples package and test whether the build works:
git clone http://github.com/krishauser/Klampt-examples bin/SimTest Klampt-examples/data/athlete_fractal_1.xml
-
Modify ~/.bash_profile as follows to use the homebrew version of Python:
export PATH=~/bin:/usr/local/bin:$PATH export PYTHONPATH=/usr/local/lib/python2.7/site-packages -
Restart your terminal window and check that you have the right Python:
which pythonshould return
/usr/local/bin/python -
In the terminal, install PyOpenGL and PyQt5 with:
pip install PyOpenGL PyQt5 -
Make and install the Klamp't Python bindings:
make python make python-installNote: sudo is not required for installation if you use homebrew's Python.
-
Test that the Python bindings work:
python Python3/demos/control/kbdrive.py data/manipulation_worlds/tx90roll.xml