Skip to content

carolinahiguera/NCF-Policy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NCF-Policy

Perceiving Extrinsic Contacts from Touch Improves Learning Insertion Policies

Paper | Video

Prior work on Neural Contact Fields (NCF) use intrinsic tactile sensing between gripper and object to estimate extrinsic contacts in simulation. However, its effectiveness and utility in real-world tasks remains unknown.

In this work, we improve NCF to enable sim-to-real transfer and use it to train policies for mug-in-cupholder and bowl-in-dishrack insertion tasks.

drawing


NCF-v2 sim-to-real

Our work builds on Neural Contact Fields (NCF-v1) and improves it on several fronts to enable sim-to-real transfer.

Our NCF-v2 is able to track extrinsic contacts from touch, generalizing to unseen shapes and environments.

drawing


Is estimating extrinsic contacts useful for manipulation policies?

We explore the effectiveness of estimating extrinsic contacts in downstream tasks of mug-in-cupholder and bowl-in-dishrack, which involve contact-rich interactions between object and environment.

drawing


Setup conda environment

We recommend using a conda environment to install the dependencies. You can create a new environment with the following command:

conda create -n ncf python=3.8
conda activate ncf

Download the Isaac Gym Preview 4 release from this link. Then, install it with the following command:

cd IsaacGym_Preview_4_Package/isaacgym/python # Go to the python folder of the Isaac Gym package
pip install -e .

Install TACTO from this repository link

cd tacto # Go to the tacto folder
pip install -r requirements/requirements.txt
pip install -e .
pip install numpy==1.23 # TACTO requires numpy 1.23

Install additional dependencies:

pip install submitit
pip install pytorch-lightning
pip install open3d
pip install trimesh
pip install vedo

Install this repo:

cd NCF_policies
pip install -e .

NCF-v2

We made modifications to key componentes on the NCF pipeline to enable sim2real transfer.

drawing

You can find the code of NCF-v2 in:

NCF-policy/
    algo2/
    ncf/
        vae/
        ndf/
        contact_regressor/
        pipeline.py

For data generation and training procedures, you can follow the same steps for (NCF-v1).


Visualize and evaluate policies with/without extrinsic contacts in simulation

  1. Download the checkpoints for NCF_v2 and the trained policies

    . download_checkpoints.sh
  2. Edit in run_test_cupholder.sh or run_test_dishrack.sh the path to the checkpoint of the policy you want to evaluate.

    These files are located in NCF_policies/isaacgymenvs/run_test_cupholder.sh and NCF_policies/isaacgymenvs/run_test_dishrack.sh

  3. To run a policy for the mug-in-cupholder task:

    NCF_policies/isaacgymenvs/run_test_cupholder.sh <GPU ID> <SEED> <FOLDER NAME> POLICY NAME>

    For example, for testing the policy with ground truth extrinsic contacts:

    NCF_policies/isaacgymenvs/run_test_cupholder.sh 0 42 v1 proprio_gt

    Testing the policy with proprioception + ncf:

    NCF_policies/isaacgymenvs/run_test_cupholder.sh 0 42 v1 proprio_ncf

    Testing the policy with proprioception + tactile:

    NCF_policies/isaacgymenvs/run_test_cupholder.sh 0 42 v1 tactile

    Testing the policy with proprioception only:

    NCF_policies/isaacgymenvs/run_test_cupholder.sh 0 42 v1 proprio
  4. Similarly, for testing a policy on the bowl-in-dishrack task:

    NCF_policies/isaacgymenvs/run_test_dishrack.sh <GPU ID> <SEED> <FOLDER NAME> POLICY NAME>

Citing

If you find NCF-v2 or this codebase helpful in your research, please consider citing:

@misc{higuera2023perceiving,
      title={Perceiving Extrinsic Contacts from Touch Improves Learning Insertion Policies}, 
      author={Carolina Higuera and Joseph Ortiz and Haozhi Qi and Luis Pineda and Byron Boots and Mustafa Mukadam},
      year={2023},
      eprint={2309.16652},
      archivePrefix={arXiv},
      primaryClass={cs.RO}
}

License

The majority of NCF-v2 is licensed under MIT license, however portions of the project are available under separate license terms. Pytorch-lightning is under Apache License 2.0. IsaacGymEnvs is licensed under the BSD 3-clause license. See LICENSE for details.

Acknowledgements

We use the implementation provided in the neural descriptor fields repo. For implementing the insertion tasks, we use as reference the Factory environments available in the IsaacGymEnvs repo. As for the RL method, we use the PPO implementation available in the codebase of the Hora project.

For TACTO intergration, we reference from the Hora-Tactile and MidasTouch projects.

We encourage you to check out all these projects!

About

Downstream insertion tasks with NCF for tracking extrinsic contacts with tactile sensing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published