.
├── implicit_soft_body
├── energy : all the energy class
├── network.py : neural network class
├── system.py : base robot class
├── robot_model.py : include all the robot models
├── Sim.py : differentiable simulator
The folder scripts
contains different scripts using the package.
normalize_mesh.py
is to normalize the given mesh to make it located within the boundary of visualization.pretrain.py
uses the given log of input and output of a control policy to imitate this control policysimulate.py
loads a trained model to simulate and output the sequence of actuations for visualizationtrain.py
trains a model to predict the actuation given the position and velocity of nodes of soft robot.visualize_actuation_seq.py
: visualize the motion of soft robot given the sequence of actuation.robot_model_euler.py
: use implicit euler integrator to optimize the walk but stuck in local minimum, results inassets/example/vis_euler_12.html
supervised_learning.py
: use supervised learning to learn the actuation signals directly, resutls can be found inassets/example/final99.html
robot_model_bdf.py
: use bdf2 integrator to optimize the walk, results inassets/example/bdf31.html
SITL.py
: use Solver-in-the-loop training strategy.
-
Install Depencencies (
jinja2
,numpy
,Pytorch
)and locally install the package (Tested on Python 3.9)pip install -e .
. In addition, Pytorch should be installed. -
Run the script
case_0.py
or Run the script in the following order:train.py
->simulate.py
->visualize_actuation_seq.py
-
In the
output
folder, you can find the visualizedindex.html
file
We provide different training cases. Not all cases are stable. The training on the differentiable simulator is not easy. We did add some noise to the actuation during the training. Training of control policy of simple robots is easier than that of complex one.