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

Merge devel in main #1

Merged
merged 39 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
77d99d1
First version of Computation class
Giulero May 26, 2021
e8210cd
Adding install structure
Giulero May 26, 2021
03a806a
Adding tests
Giulero May 26, 2021
830b4c7
Adding iCub urdf model
Giulero May 26, 2021
8129833
Adding jupyter example file
Giulero May 26, 2021
9d03cbd
Update .gitignore
Giulero May 26, 2021
b78017e
Update readme
Giulero May 27, 2021
0e91269
Adding more infos
Giulero May 27, 2021
cd1651c
Formatting with pep8
Giulero May 27, 2021
b5215b7
Update tests
Giulero May 27, 2021
e659901
Fix typo
Giulero May 27, 2021
60db00f
Update readme
Giulero May 27, 2021
9cca2a6
Remove useless comment
Giulero May 27, 2021
fc9be15
Add github action
Giulero May 27, 2021
1e1c841
Fix action
Giulero May 27, 2021
1ee338f
Update .gitignore
Giulero Jun 4, 2021
419d16e
Restructure project
Giulero Jun 4, 2021
f0227f5
Fix setup
Giulero Jun 4, 2021
80330b9
Update tests.yml
Giulero Jun 4, 2021
47bdd7c
Update tests
Giulero Jun 4, 2021
483873d
Update example
Giulero Jun 4, 2021
62f4fc8
Fix github action
Giulero Jun 4, 2021
5f1af76
Fix missing dependency
Giulero Jun 4, 2021
672a209
Remove urdf (replaced using gym-ignition)
Giulero Jun 4, 2021
5936520
Format with black and move jit option in the constructor
Giulero Jun 4, 2021
24b33e9
raise NotImplementedError
Giulero Jun 4, 2021
b2a90d6
Adding logging module to show the robot structure
Giulero Jun 4, 2021
8fc856a
Update README
Giulero Jun 4, 2021
03300e8
Fix dataclasses usage
Giulero Jun 4, 2021
76ad23d
Changing fun generation option
Giulero Jun 4, 2021
6234757
Update example
Giulero Jun 7, 2021
4192e10
Update readme
Giulero Jun 7, 2021
719b0b7
Add action also on push
Giulero Jun 7, 2021
18d8576
Fix indentation in .cfg
Giulero Jun 7, 2021
9075496
Revomove useless rw property
Giulero Jun 7, 2021
d0a13c7
Change mutable types pattern in Tree dataclass
Giulero Jun 7, 2021
35779ae
Prune gh action commands
Giulero Jun 7, 2021
9630f2f
Cleanup
Giulero Jun 7, 2021
0137451
Small cleanup
Giulero Jun 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Adam

on: [push]
Giulero marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
Giulero marked this conversation as resolved.
Show resolved Hide resolved
pip install idyntree
pip install .
- name: Test with pytest
run: |
pytest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**.pytest_cache
**.vscode
**.ipynb_checkpoints
**__pycache__
Giulero marked this conversation as resolved.
Show resolved Hide resolved
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,71 @@
# ADAM
Automatic Differentiation for rigid body dynamics algorithMs

**Automatic Differentiation for rigid-body-dynamics AlgorithMs**

This library implements kinematics and dynamics algorithms for **floating-base** robots, in _mixed representation_ (see [Traversaro's A Unified View of the Equations of Motion used for Control Design of Humanoid Robots](https://www.researchgate.net/publication/312200239_A_Unified_View_of_the_Equations_of_Motion_used_for_Control_Design_of_Humanoid_Robots)).

Adam employs [CasADi](https://web.casadi.org/), which embeds the computed kinematics and dynamics quantities in expression graphs and provides if needed, gradients, Jacobians, and Hessians. This approach enables the design of optimal control strategies in robotics. Using its `CodeGenerator`, CasADi enables also the generation of C-code - usable also in `Matlab` or `C++`.
Giulero marked this conversation as resolved.
Show resolved Hide resolved

Adam is based on Roy Featherstone's Rigid Body Dynamics Algorithms.

This work is still at an early stage and bugs could jump out!
PRs are welcome! :rocket:

## :hammer: Dependencies

- `python3`
Giulero marked this conversation as resolved.
Show resolved Hide resolved

Other requisites are:

- `urdf_parser_py`
- `casadi`

They will be installed in the installation step!

## :floppy_disk: Installation

```
git clone https://github.com/dic-iit/ADAM.git
cd ADAM
pip install .
```

preferably in a virtual environment.
Giulero marked this conversation as resolved.
Show resolved Hide resolved

## :rocket: Usage

```python
from adam.Computations.KinDynComputations import KinDynComputations
import numpy as np

urdf_path = '../urdf/iCubGenova04/model.urdf'
# The joint list
joints_name_list = [
'torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch', 'l_hip_roll',
'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll', 'r_hip_pitch',
'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll'
]
# Specify the root link
root_link = 'root_link'
kinDyn = KinDynComputations(urdf_path, joints_name_list, root_link)
w_H_b = np.eye(4)
joints = np.ones(len(joints_name_list))
M = kinDyn.mass_matrix_fun()
print(M(w_H_b, joints))
```

## Todo

- [x] Center of Mass position
- [x] Jacobians
- [x] Forward kinematics
- [x] Mass Matrix via CRBA
- [x] Centroidal Momentum Matrix via CRBA
- [ ] Recursive Newton-Euler algorithm
- [ ] Articulated Body algorithm

---

The structure of the library is inspired by the module [urdf2casadi](https://github.com/mahaarbo/urdf2casadi/blob/master/README.md), which generates kinematic and dynamics quantities using CasADi. Please check their interesting work!
Loading