CDF is a differentiable robot representation. It is a function d=f(p,q) where p is the spatial point and q is the joint configuration. DIfferent from SDF that indicates the distance from p to the robot surface defined by q, CDF uses the distance in radians, corresponding to the minimal joint motion required by the robot to contact with the point. Therefore, the distance is evenly spanned in joint space and the gradient points against to the point consistently, and we can solve the inverse kinematics problem through one-step gradient projection without the requirement of iterations.
pip install -r requirements.txt
Run
python cdf.py
to see the main difference between SDFs and CDF.
You can also replace the line
plot_fig1(scene_1)
with
plot_projection(scene_2)
to see how gradient projection works in solving inverse kinematics in one-step without iterations.
We provide pretrained neural CDF model at 'model_dict.pt' and precomputed data 'data.pt' for franka emika panda robot.
Examples for data generation and neural network training can be found at 'data_generator.py' and 'nn_cdf.py'.
Note: Many funtions require the RDF library (such as offline data generation, comparison with SDFs). You can run
git clone https://github.com/yimingli1998/RDF.git
and put it in the same folder with CDF.
Run
python mp_ik.py
to see the gradient projection works on the robot.
Run
python throw_wik.py
to see the goalkeeper experiment in simulation.
Run
python wik_eval.py
to evalute the whole-body inverse kinematics and compare it with baseline approaches.
For motion planning, you can run
python qp_mp.py
to see a simple example that uses a reactive QP controller for collision avoidance. this example is in a static scene but it also works for moving objects.
CDF is maintained by Yiming LI and licensed under the MIT License.
Copyright (c) 2024 Idiap Research Institute contact@idiap.ch