Repository to reproduce the results of the paper "An Empirical Study on the Computation Budget of Co-Optimization of Robot Design and Control in Simulation"
The project integrates with the following robotic simulation frameworks:
- EvoGym - Soft robot co-design using PPO
- RoboGrammar - Rigid robot design using MCTS and MPC
- Tholiao - Modular soft robot simulation (not used in the paper)
- GymREM2D - 2D modular robot environment
- JorgenREM - Modular robot evolution
- KevinCoAdapting - Co-adapting morphology and control (not used in the paper)
- Python 3.7 (required for compatibility with some frameworks)
- CMake 3.20+
- Ubuntu 18.04 or later
- Various OpenGL libraries (see
setup.sh)
- PyTorch 1.12.0
- NumPy, Pandas, Matplotlib
- Stable-Baselines3
- PyBullet
- scipy 1.4.1
- GPy, GPyOpt
- neat-python
- CMA-ES, Nevergrad
- See
requirements.txtfor complete list
- Clone the repository:
git clone <repository-url>
cd co-optimization-two-phase- Run the setup script:
bash setup.sh --localThis will:
- Install system dependencies
- Create a Python 3.7 virtual environment
- Install Python packages
- Compile GLEW
- Build RoboGrammar with Python bindings
- Install EvoGym
- Set up GymREM2D with Box2D
- Install Revolve dependencies
- Activate the environment:
source venv/bin/activateEach framework has its own experiment script in the src/ directory:
# Activate virtual environment
source venv/bin/activate
# Run experiment with index 0
python src/robogrammar_experiment.py --local_launch 0
# Generate plots
python src/robogrammar_experiment.py --plot
# Clean temporary files
python src/robogrammar_experiment.py --cleanpython src/evogym_experiment.py --local_launch 0
python src/evogym_experiment.py --plotpython src/tholiao_experiment.py --local_launch 0
python src/gymrem2d_experiment.py --local_launch 0
python src/jorgenrem_experiment.py --local_launch 0
python src/kevincoadapting_experiment.py --local_launch 0Submit jobs to the cluster using provided SLURM scripts:
sbatch cluster_scripts/launch_one_robogrammar.sl
sbatch cluster_scripts/launch_one_evogym.sl
sbatch cluster_scripts/launch_one_jorgenrem.slRun all plots in background:
bash all_plots_background.shThe Parameters class in NestedOptimization.py (src/NestedOptimization.py:65) allows configuration of:
- Number of seeds for experiments
- Stopping criteria (max steps)
- Environment-specific parameters
- Inner optimization quantities and episode lengths
Results are saved in results/<framework>/:
data/- Raw experimental data (.txt files)figures/- Generated plots (.pdf files)videos/- Robot animations (.mp4 files)
This software is released into the public domain under The Unlicense.
Note: The code in other_repos/ and glew-2.1.0/ directories are from external authors and may have different licenses. Please refer to each repository for their respective licenses.