This repo has code for discovering object-level latent spaces based on interactions with that object. This is an extension of the stacking repository and Tmuch of the robot functionality comes from the rachelholladay/pb_robot repository.
Dependencies: python3, git
- Install
latent_feasibility
- Clone this repository.
- Create a virual environment for this project.
cd latent_feasibility
virtualenv .venv --python=/usr/bin/python3
source .venv/bin/activate
- Install dependencies.
xargs -n1 pip3 install < requirements.txt
- We are currently using PyTorch
1.9.1
:pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
- Install pb_robot using the instructions below, not the ones in the repo's README
- Clone
pb_robot
outside oflatent_feasibility
. - Compile the IKFast library for the panda
cd pb_robot/src/pb_robot/ikfast/franka_panda
python3 setup.py build
(for errors, see troubleshooting below)
- Clone
- Install pddlstream
- Clone
pddlstream
outside oflatent_feasibility
. - Follow installation instructions there.
- Clone
- Create a symlink to required repos (this assumes you cloned
pb_robot
andpddl_stream
to your home directory). Run these commands from the top directorylatent_feasibility
.ln -s <path-to-pb_robot>/pb_robot/src/pb_robot .
ln -s <path-to-pddstream>/pddlstream/pddlstream .
To use the grasping modules (specifically from pb_robot/planners/antipodalGraspPlanner.py
), you will need to download a dataset
containing URDFs:
- Download URDFs and object meshes from here.
- Unzip the archive:
unzip shapenet-sim.zip
- Set the
SHAPENET_ROOT
environment variable to the location of the dataset:export SHAPENET_ROOT=<path-to-dataset>/shapenet-sem
Update: This repo will now work by default with Python3.7. This troubleshooting may still be useful for setting up the repo using a different Python version.
On macOS Catalina using a Python3.7 virtualenv, building pb_robot with python setup.py build
failed with the following error
./ikfast.h:41:10: fatal error: 'python3.6/Python.h' file not found
The compiler can't find the appropriate python header. The solution is to first locate the header:
$ find /usr/local/Cellar/ -name Python.h
/usr/local/Cellar//python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h
/usr/local/Cellar//[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/include/python3.8/Python.h
which prints the python include directories. I wanted to use 3.7, so then I set the environment variable
export CPLUS_INCLUDE_PATH=/usr/local/Cellar//python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/
and finally modify pb_robot/src/pb_robot/ikfast/ikfast.h
by changing
#include "python3.6/Python.h" -> #include "python3.7m/Python.h"