Giter VIP home page Giter VIP logo

evolving-soft-robots's Introduction

Soft Robots Learn to Crawl: Jointly Optimizing Design and Control with Sim-to-Real Transfer

This repository contains code for the paper Soft Robots Learn to Crawl: Jointly Optimizing Design and Control with Sim-to-Real Transfer.

It provides the code for model order reduction, co-optimiztion of design and control, and testing the optimized design-control pairs in simulation.

Installation

Our code relies on Docker and the docker wrapper cpk to manage its dependencies.

To use this codebase, follow these installation steps:

  1. Intstall Docker.
  2. Install cpk: python -m pip install cpk
  3. Clone this repository.
  4. From the top level directory, run cpk build to build the docker container.

Additionally, this codebase uses Weights and Biases for logging and visualization, which is free to use for academics. Running a training job will prompt you to login, create an account, or not visualize the results. If you wish to avoid manual logins, place your wandb .netrc file in the assets/wandb_info directory.

If you only want to visiualize the pretrained model, then creating a wandb account is not required.

Testing the Learned and Baseline Models

We provide code to visualize a pretrained model and our baseline.

  • To visualize the pretrained model, run: cpk run -M -f -X -L viz_pretrained
  • To visualize the baseline, run: cpk run -M -f -X -L viz_baseline

Running a Co-optimization Experiment

The training code is run in two pieces: a training script and an evaluation script which runs concurrently. Training is CPU intensive. We ran this experiment with 96 paralell SOFA environments for training on a 32-core AMD EPYC 7502. You can adjust the cpu load by editing the config file configs/coopt.yaml.

  • To launch a training job, run: cpk run -M -f -n train -L train
  • To launch the eval job, run: cpk run -M -f -n eval -L eval

The eval job will search for checkpoints in the exps directory and generate videos and evaluation performance. All logs and videos will be visible on wandb in a newly created evolving-soft-robots project.

Performing Model Order Reduction

This repository contains the reduced order models used in this paper, as well as code to create your own reductions.

  • To launch a reduction, run: python scripts/launch_reduction_block.py

This will launch a grid search over the two tolerances for the reduction. The reduction takes several hours to complete and requires large amount of RAM (~200GB).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.