Giter Club home page Giter Club logo

evosoro's Introduction

evosoro: soft robot simulator

Evosoro is a Python soft robot simulation library based on the Voxelyze physics engine. It provides a high-level interface for the dynamic simulation and automated design of soft multimaterial robots.

Evosoro was designed and developed by the Morphology, Evolution & Cognition Laboratory, University of Vermont. The library is built on top of the open source VoxCAD and the underlying voxel physics engine (Voxelyze) which were both developed by the Creative Machines Lab, Columbia University.

(1) Citing

If using this code for academic purposes please consider citing the following two papers.

Voxelyze physics engine and VoxCAD GUI:

Hiller, J., & Lipson, H. (2014). Dynamic simulation of soft multimaterial 3d-printed objects. Soft Robotics, 1(1), 88-101.

Encoding and optimization (genetic algorithm):

Cheney, N., MacCurdy, R., Clune, J., & Lipson, H. (2013). Unshackling evolution: evolving soft robots with multiple materials and a powerful generative encoding. In Proceedings of the 15th annual conference on Genetic and evolutionary computation (pp. 167-174). ACM.

(2) Installation

It is recommended that you install Anaconda as your Python (2.7) distribution. Anaconda is a free package manager and Python distribution that includes all of the dependencies required for evosoro. However if you instead choose to manually install Python 2.7, the following packages are required: scipy, numpy, networkx, decorator.

Also networkx must be <2.0. When networkx updated 1.0-->2.0 some function changed and I haven't updated the python code to reflect this change.

pip install networkx==1.11

Install Qt and QMake if you have not already done so, specifically these packages: "libqt4-dev", "qt4-qmake", "libqwt-dev", "freeglut3-dev" and "zlib1g-dev".

sudo apt-get install libqt4-dev qt4-qmake libqwt-dev freeglut3-dev zlib1g-dev

Install git if you have not already done so.

sudo apt-get install git

Navigate to your working directory (e.g. your home).

cd ~

Clone the repo.

git clone https://github.com/skriegman/evosoro.git

There are different well documented examples (evosoro/examples) and custom versions of VoxCad/Voxelyze included in this repository (evosoro/_voxcad* folders). Let's try running an example in which soft robots are optimized to locomote in a terrestrial environment, using an evolutionary algorithm and a basic version (_voxcad) of the physics engine (the procedure is the same for all the examples).

Navigate to the _voxcad directory:

cd evosoro/evosoro/_voxcad/

The following command compiles both VoxCad and Voxelyze, installing the library at the same time:

./rebuild_everything.sh

If you happen to modify VoxCad or Voxelyze in the future, you can call the same script to be sure to clean and recompile everything.

make

Install the voxelyze library.

cd Voxelyze
make
make installusr
cd ../voxelyzeMain/
make

Navigate back out to the examples folder and run basic.py

cd ../examples
python basic.py

You should start seeing some output being produced in your console, and a new directory being created (evosoro/evosoro/basic_data), which contains the results of the simulation.

(3) Examples

After allowing basic.py to run for a few generations, you can view the evolved morphologies and behaviors by opening up the generated .vxa files within the VoxCAD GUI. A .vxa file is just an XML file representing a robot that can be simulated by VoxCad/Voxelyze. Different versions of the physics engine can play slightly different .vxa files. Navigate to evosoro/evosoro/_voxcad/release:

cd ../_voxcad/release

Open VoxCad:

./VoxCad

Then select the desired .vxa file from

"File -> Import -> Simulation"

The .vxa files for the best performing individuals will be saved in

evosoro/evosoro/examples/basic_data/bestSoFar/fitOnly.

Once the design is loaded, you can start the physics simulation by clicking the icon in the top bar ("Physics Sandbox"). The robot should start moving: if it doesn't, please check the following section (Known issues).

(4) Known issues

Some versions of VoxCad utilize the qhull library (http://www.qhull.org/). In these versions of the GUI, the 'qhull' executable must be present in your binary path.

sudo apt-get install qhull-bin

If the robot does not move, disappears, or seems to behave in an unexpected manner when running a .vxa file in VoxCad (GUI), you may be affected by a known problem observed on some non-US machines. The problem is due to an unexpected behavior of the atof function when the system's numeric locale differs from en_US.UTF-8, which entails loading wrong parameters from the .vxa file (in some cases it was observed how the atof function was approximating all double and floating point values to their integer part, which was the cause of the unexpected behavior).

While we work on a better solution, you can fix this problem by making sure that your machine is configured according to a US numeric locale. Open the following file:

sudo gedit /etc/default/locale

Make sure that LC_NUMERIC is set as follows:

LC_NUMERIC="en_US.UTF-8"

Save, close the file, and reboot.

(5) Documentation

Although the code included in this repository diverged from the main VoxCad/Voxelyze development branch some time ago, useful indications could be find in the online Voxelyze documentation, available here.

(6) License

Released under a MIT License (MIT)

evosoro's People

Contributors

fcorucci avatar kriegmerica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evosoro's Issues

Wrong directory of basic_data folder

As the title, I found that the basic_data folder is in

evosoro/evosoro/examples/basic_data

not in:

evosoro/evosoro/basic_data

as indicated in the README.md

More questions

nfy0vxxg df4u _13zxe i3
it is my product of generation799,i select IND_SIZE is 444 and POP_SIZE is 8,I spent 8 hours to run this script .it can't run,just like “Dead robot”.I read your paper that you create the robot like this
j1 fnctsch t nimb56l4j7
Your robot is using 101010 voxels to simulate?when i change IND_SIZE to 101010 to run ,that too slow for me,I guess it need 500 hours to run.

Installation instructions

Hi, I couldn't find in the Readme what platform your installation instructions refer to, but I think it's linux. Does the code only run on linux?
I'm on Mac and I can't get the voxcad files to compile using rebuild_everything.sh. I'm wondering if it can be fixed with minimal pain or if it would take me days of recursive debugging of packages and subpackages...

No module name evosoro.networks

Hi Sam,

I've just started my research and I want to use evosoro to familiarise myself. However, when running basic.py I get the error:

ImportError: No module named evosoro.networks

Any help would be greatly appreciated thanks!

Some questions about evosoro-master

I am interested in your Evolving Soft Robots,as you showed in the youtube (https://youtu.be/EXuR_soDnFo) .I want to achieve running faster ,Could you please provide a example,or I want know which example(basic.py,growth.py,land_continuous.py,plotting.py,swimming_basic.py,swimming_complex.py) can achieve this. I have run an example basic.py, but my computer too slow,it's just spent my 6 hours to run, i just get 82 generation,and no big change

Please give me some advice or example

I get a faster computer to run the script(basic.py). First of all, I want to achieve the results you show in the video.
7yn 6_qs 7 d8f e6 han
After watching the video ,I think I need choice IND_SIZE = (10,10, 10) , and I remember you say "Treatments consist of 35 runs, each with a population size of 30, evolved for 1000 generations."in the "Unshackling Evolution: Evolving Soft Robots with Multiple Materials and a Powerful Generative Encoding", shuld I need 30 simulations per generation(POPSIZE = 30 ) ? or What parameters need me to modify?

libqwt-dev is not available on Ubuntu 20.04

Package 'libqwt-dev' has no installation candidate on Ubuntu 20.04. I could find a work around for libqt4-dev though. Is there a way out of it? And, can you suggest a way to dealt with the Python 2.7 dependency?

/tmp/.../qhull Not Found

Screenshot from 2019-10-05 15-44-08

Importing any example vxa, then running the simulation causes VoxCad Land Water to take a massive performance hit and be unable to run the simulation. Terminal outputs sh: 1: /tmp/../qhull: not found sh: 1: qhull: not found
over and over again, followed eventually by
CVX_MeshUtil ERROR: Cannot get a valid result from qhull in 20 attempts. Returning -1.

can not run basic.py

Type "scientific" for more details.

        runfile('/home/sx/evosoro/evosoro/examples/basic.py', wdir=r'/home/sx/evosoro/evosoro/examples')
        Traceback (most recent call last):
        File "", line 1, in
        File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
        execfile(filename, namespace)
        File "/home/sx/evosoro/evosoro/examples/basic.py", line 165, in
        my_pop = Population(my_objective_dict, MyGenotype, MyPhenotype, pop_size=POPSIZE)
        File "/home/sx/evosoro/evosoro/examples/../../evosoro/softbot.py", line 389, in init
        self.add_random_individual()
        File "/home/sx/evosoro/evosoro/examples/../../evosoro/softbot.py", line 450, in add_random_individual
        ind = SoftBot(self.max_id, self.objective_dict, self.genotype, self.phenotype)
        File "/home/sx/evosoro/evosoro/examples/../../evosoro/softbot.py", line 324, in init
        self.genotype = genotype() # initialize new random genome
        File "/home/sx/evosoro/evosoro/examples/basic.py", line 94, in init
        self.add_network(CPPN(output_node_names=["shape", "muscleOrTissue", "muscleType", "tissueType"]))
        File "/home/sx/evosoro/evosoro/examples/../../evosoro/networks.py", line 53, in init
        self.mutate()
        File "/home/sx/evosoro/evosoro/examples/../../evosoro/networks.py", line 114, in mutate
        variation_degree = self.add_node()
        File "/home/sx/evosoro/evosoro/examples/../../evosoro/networks.py", line 148, in add_node
        this_edge = random.choice(self.graph.edges())
        File "/usr/lib/python2.7/random.py", line 273, in choice
        return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
        File "/usr/local/lib/python2.7/dist-packages/networkx/classes/reportviews.py", line 926, in getitem
        u, v = e
        TypeError: 'int' object is not iterable

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.