Skip to content

Commit

Permalink
Merge pull request #23 from xela-95/add-pixi-environment
Browse files Browse the repository at this point in the history
Add pixi support
  • Loading branch information
CarlottaSartore authored Dec 3, 2024
2 parents 51e43e4 + ba6f647 commit 16c6d53
Show file tree
Hide file tree
Showing 5 changed files with 12,402 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# pixi environments
.pixi
*.egg-info
87 changes: 67 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CoMoDO

## Control Motion Design Optimization
**Control Motion Design Optimization**

Suite of parametrized controller and simulator for codesign of robots.
**CoMoDO** is a suite of parametrized controllers and simulators for codesign of robots.


---
Expand All @@ -14,7 +14,17 @@ Suite of parametrized controller and simulator for codesign of robots.

---

## Installation
## Table of contents

- [⚙️ Dependencies](#-dependencies)
- [💾 Installation](#-installation)
- [🐍 Installation with conda](#-installation-with-conda)
- [📦 Installation with pixi](#-installation-with-pixi)
- [🚀 Usage](#-usage)
- [:construction_worker: Maintainer](#construction_worker-maintainer)


## ⚙️ Dependencies

This library depends on

Expand All @@ -23,17 +33,24 @@ This library depends on
- [``idyntree``](https://github.com/robotology/idyntree)
- [``bipedal-locomotion-framework``](https://github.com/ami-iit/bipedal-locomotion-framework)
- [``adam-robotics``](https://github.com/ami-iit/ADAM)
- [``mujoco``](https://mujoco.org/)
- [``mujoco-python-viewer``](https://github.com/rohanpsingh/mujoco-python-viewer)
- [``matplotlib``](https://matplotlib.org/stable/)
- [``urllib3``](https://urllib3.readthedocs.io/en/stable/)
- [``urchin``](https://github.com/fishbotics/urchin)

And, optionally, on:

- [``mujoco``](https://mujoco.org/) and [``mujoco-python-viewer``](https://github.com/rohanpsingh/mujoco-python-viewer)
- [``jaxsim``](https://github.com/ami-iit/jaxsim)
- [`drake`](https://drake.mit.edu/)
- [`hippopt`](https://github.com/ami-iit/hippopt.git)

To install you can use the following commands
## 💾 Installation

### 🐍 Installation with conda

```
To install comodo in a conda environment, you can use the following commands

```bash
conda create -n comododev -c conda-forge adam-robotics bipedal-locomotion-framework=0.19.0 mujoco-python-viewer matplotlib urllib3 urchin notebook jaxsim

conda activate comododev
Expand All @@ -42,31 +59,61 @@ pip install --no-deps -e .

```

### With hippopt
#### With hippopt

```
To work in comodo with [`hippopt`](https://github.com/ami-iit/hippopt.git) requires to install also the following packages:

```bash
conda install -c conda-forge -c robotology casadi pytest liecasadi meshcat-python ffmpeg-python
pip install --no-deps git+https://github.com/ami-iit/hippopt.git
```


### With Drake
Working with drake as the simulator backend requires the following additional dependencies,
```
#### With Drake

To use [`drake`](https://drake.mit.edu/) as the simulator backend requires the following additional dependencies:

```bash
conda install meshio tqdm
pip install drake git+https://github.com/ami-iit/amo_urdf
```

## Usage
### 📦 Installation with pixi

Take a look at the [examples](./examples) folder!
An alternative and easy way to use comodo is with [`pixi`](https://pixi.sh/latest/) package manager. It automatically handles the creation and activation of virtual environments in which to use the different simulators that comodo supports.

### Maintainer
At the moment there is an environment associated with each simulator backend, namely:
- `mujoco`: for mujoco simulator
- `jaxsim`: for jaxsim simulator
- `drake`: for drake simulator
- `all` for all the simulators

This repository is maintained by
| | |
| :----------------------------------------------------------: | :--------------------------------------------------: |
| <img src="https://user-images.githubusercontent.com/56030908/135461492-6d9a1174-19bd-46b3-bee6-c4dbaea9e210.jpeg" width="40"> | [@CarlottaSartore](https://github.com/CarlottaSartore) |
To activate one of these environments in a terminal run:

```bash
pixi shell -e <environment-name>
```

It is also possible to run directly a command in one of these environments using:

```bash
pixi run -e <environment-name> python <script-filename.py>
```

For example, it is possible to run the Jupyter notebooks in the [examples](./examples) folder by just executing:

```bash
pixi run -e all jupyter notebook
```

and then running the examples you prefer in Jupyter.

## 🚀 Usage

Take a look at the [examples](./examples) folder!

## :construction_worker: Maintainer

This repository is maintained by
| | |
| :----------------------------------------------------------: | :--------------------------------------------------: |
| <img src="https://user-images.githubusercontent.com/56030908/135461492-6d9a1174-19bd-46b3-bee6-c4dbaea9e210.jpeg" width="40"> | [@CarlottaSartore](https://github.com/CarlottaSartore) |
Loading

0 comments on commit 16c6d53

Please sign in to comment.