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 recipe for adam-robotics Python package #21894

Merged
merged 13 commits into from
May 25, 2023
100 changes: 100 additions & 0 deletions recipes/adam-robotics/40.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
From 10acc266f6398d9c9e9cf123f19a6e4335436cb2 Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <silvio@traversaro.it>
Date: Sun, 14 May 2023 22:13:52 +0200
Subject: [PATCH] tests: Always initialize twists with idyntree.Twist.Zero()

---
tests/test_CasADi_computations.py | 4 ++--
tests/test_Jax_computations.py | 4 ++--
tests/test_NumPy_computations.py | 4 ++--
tests/test_pytorch_computations.py | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/test_CasADi_computations.py b/tests/test_CasADi_computations.py
index 73c53e9..c604829 100644
--- a/tests/test_CasADi_computations.py
+++ b/tests/test_CasADi_computations.py
@@ -76,7 +76,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):

# set iDynTree kinDyn
H_b_idyn = H_from_Pos_RPY_idyn(xyz, rpy)
-vb = idyntree.Twist()
+vb = idyntree.Twist.Zero()
[vb.setVal(i, base_vel[i]) for i in range(6)]

s = idyntree.VectorDynSize(n_dofs)
@@ -190,7 +190,7 @@ def test_coriolis_term():


def test_gravity_term():
- vb0 = idyntree.Twist()
+ vb0 = idyntree.Twist.Zero()
s_dot0 = idyntree.VectorDynSize(n_dofs)
kinDyn.setRobotState(H_b_idyn, s, vb0, s_dot0, g)
G_iDyn = idyntree.FreeFloatingGeneralizedTorques(kinDyn.model())
diff --git a/tests/test_Jax_computations.py b/tests/test_Jax_computations.py
index 2bb81e0..ed9ff96 100644
--- a/tests/test_Jax_computations.py
+++ b/tests/test_Jax_computations.py
@@ -76,7 +76,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):

# set iDynTree kinDyn
H_b_idyn = H_from_Pos_RPY_idyn(xyz, rpy)
-vb = idyntree.Twist()
+vb = idyntree.Twist.Zero()
[vb.setVal(i, base_vel[i]) for i in range(6)]

s = idyntree.VectorDynSize(n_dofs)
@@ -185,7 +185,7 @@ def test_gravity_term():
kinDyn2.loadRobotModel(robot_iDyn.model())
kinDyn2.setFloatingBase(root_link)
kinDyn2.setFrameVelocityRepresentation(idyntree.MIXED_REPRESENTATION)
- vb0 = idyntree.Twist()
+ vb0 = idyntree.Twist.Zero()
s_dot0 = idyntree.VectorDynSize(n_dofs)
kinDyn2.setRobotState(H_b_idyn, s, vb0, s_dot0, g)
G_iDyn = idyntree.FreeFloatingGeneralizedTorques(kinDyn2.model())
diff --git a/tests/test_NumPy_computations.py b/tests/test_NumPy_computations.py
index d0356fa..863ae2a 100644
--- a/tests/test_NumPy_computations.py
+++ b/tests/test_NumPy_computations.py
@@ -75,7 +75,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):

# set iDynTree kinDyn
H_b_idyn = H_from_Pos_RPY_idyn(xyz, rpy)
-vb = idyntree.Twist()
+vb = idyntree.Twist.Zero()
[vb.setVal(i, base_vel[i]) for i in range(6)]

s = idyntree.VectorDynSize(n_dofs)
@@ -184,7 +184,7 @@ def test_gravity_term():
kinDyn2.loadRobotModel(robot_iDyn.model())
kinDyn2.setFloatingBase(root_link)
kinDyn2.setFrameVelocityRepresentation(idyntree.MIXED_REPRESENTATION)
- vb0 = idyntree.Twist()
+ vb0 = idyntree.Twist.Zero()
s_dot0 = idyntree.VectorDynSize(n_dofs)
kinDyn2.setRobotState(H_b_idyn, s, vb0, s_dot0, g)
G_iDyn = idyntree.FreeFloatingGeneralizedTorques(kinDyn2.model())
diff --git a/tests/test_pytorch_computations.py b/tests/test_pytorch_computations.py
index f400a62..db0d70e 100644
--- a/tests/test_pytorch_computations.py
+++ b/tests/test_pytorch_computations.py
@@ -76,7 +76,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):

# set iDynTree kinDyn
H_b_idyn = H_from_Pos_RPY_idyn(xyz, rpy)
-vb = idyntree.Twist()
+vb = idyntree.Twist.Zero()
[vb.setVal(i, base_vel[i]) for i in range(6)]

s = idyntree.VectorDynSize(n_dofs)
@@ -185,7 +185,7 @@ def test_gravity_term():
kinDyn2.loadRobotModel(robot_iDyn.model())
kinDyn2.setFloatingBase(root_link)
kinDyn2.setFrameVelocityRepresentation(idyntree.MIXED_REPRESENTATION)
- vb0 = idyntree.Twist()
+ vb0 = idyntree.Twist.Zero()
s_dot0 = idyntree.VectorDynSize(n_dofs)
kinDyn2.setRobotState(H_b_idyn, s, vb0, s_dot0, g)
G_iDyn = idyntree.FreeFloatingGeneralizedTorques(kinDyn2.model())
60 changes: 60 additions & 0 deletions recipes/adam-robotics/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% set name = "adam-robotics" %}
{% set version = "0.0.6" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/ami-iit/ADAM/archive/refs/tags/v{{ version }}.tar.gz
sha256: 4a726ac0c0ce6735eb51be30f512583d63721a270d16cb74738f78615540a6cb
patches:
- 40.patch
ocefpaf marked this conversation as resolved.
Show resolved Hide resolved

build:
noarch: python
script: {{ PYTHON }} -m pip install . -vv --no-deps
number: 0

requirements:
host:
- python >=3.7
- pip
- wheel
- setuptools
run:
- python >=3.7
- numpy
- scipy
- casadi
- prettytable
- urdfdom-py

test:
source_files:
- tests
imports:
- adam
commands:
# Workaround for glibc <= 2.25 problems,
# See https://github.com/ami-iit/ADAM/pull/38#issuecomment-1546909762
- pytest ./tests/ -v -k "not gravity" # [not win]
- pytest ./tests/ -v --ignore-glob=*Jax* --ignore-glob=*pytorch* # [win]
requires:
- pip
- pytest
- gym-ignition-models
- pytorch # [not win]
- jax # [not win]
- idyntree

about:
home: https://github.com/ami-iit/ADAM
summary: 'ADAM implements a collection of algorithms for calculating rigid-body dynamics in Jax, CasADi, PyTorch, and NumPy.'
license: LGPL-2.1-only
license_file: LICENSE

extra:
recipe-maintainers:
- traversaro
- Giulero
5 changes: 5 additions & 0 deletions recipes/adam-robotics/yum_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mesa-libGL
libselinux
libXdamage
libXxf86vm
libXext