Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pixi support #23

Merged
merged 12 commits into from
Dec 3, 2024
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