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

Remove geometry module usage and clean up tests #106

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions src/adam/geometry/__init__.py

This file was deleted.

115 changes: 0 additions & 115 deletions src/adam/geometry/utils.py

This file was deleted.

5 changes: 3 additions & 2 deletions tests/body_fixed/test_CasADi_body_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import pytest

from adam.casadi import KinDynComputations
from adam.geometry import utils
from adam.numpy.numpy_like import SpatialMath
from adam import Representations


np.random.seed(42)

model_path = str(icub_models.get_model_file("iCubGazeboV2_5"))
Expand Down Expand Up @@ -79,7 +80,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
5 changes: 3 additions & 2 deletions tests/body_fixed/test_Jax_body_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
from jax import config

import adam
from adam.geometry import utils
from adam.jax import KinDynComputations
from adam.numpy.numpy_like import SpatialMath


np.random.seed(42)
config.update("jax_enable_x64", True)
Expand Down Expand Up @@ -81,7 +82,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
5 changes: 3 additions & 2 deletions tests/body_fixed/test_NumPy_body_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import pytest

from adam import Representations
from adam.geometry import utils
from adam.numpy import KinDynComputations
from adam.numpy.numpy_like import SpatialMath


np.random.seed(42)

Expand Down Expand Up @@ -78,7 +79,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
2 changes: 1 addition & 1 deletion tests/body_fixed/test_pytorch_body_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import torch

from adam import Representations
from adam.geometry import utils
from adam.pytorch import KinDynComputations
from adam.pytorch.torch_like import SpatialMath


np.random.seed(42)
torch.set_default_dtype(torch.float64)

Expand Down
5 changes: 3 additions & 2 deletions tests/conversions/test_idyntree.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
import pytest

from adam.casadi import KinDynComputations
from adam.geometry import utils
from adam.numpy.numpy_like import SpatialMath
from adam import Representations
from adam.model.conversions.idyntree import to_idyntree_model


np.random.seed(42)

model_path = str(icub_models.get_model_file("iCubGazeboV2_5"))
Expand Down Expand Up @@ -82,7 +83,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
5 changes: 3 additions & 2 deletions tests/conversions/test_idyntree_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
)
from adam.model.conversions.idyntree import to_idyntree_model
from adam.core.constants import Representations
from adam.numpy.numpy_like import SpatialMath

from adam.geometry import utils
import tempfile
from git import Repo


# Getting stickbot urdf file
temp_dir = tempfile.TemporaryDirectory()
git_url = "https://github.com/icub-tech-iit/ergocub-gazebo-simulations.git"
Expand Down Expand Up @@ -96,7 +97,7 @@
joints_val = (np.random.rand(n_dofs) - 0.5) * 5
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
vb_ = base_vel
s_ = joints_val
s_dot_ = joints_dot_val
Expand Down
5 changes: 3 additions & 2 deletions tests/mixed/test_CasADi_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import pytest

from adam.casadi import KinDynComputations
from adam.geometry import utils
from adam.numpy.numpy_like import SpatialMath
from adam import Representations


np.random.seed(42)

model_path = str(icub_models.get_model_file("iCubGazeboV2_5"))
Expand Down Expand Up @@ -79,7 +80,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
5 changes: 3 additions & 2 deletions tests/mixed/test_Jax_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
from jax import config

import adam
from adam.geometry import utils
from adam.jax import KinDynComputations
from adam.numpy.numpy_like import SpatialMath


np.random.seed(42)
config.update("jax_enable_x64", True)
Expand Down Expand Up @@ -81,7 +82,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
5 changes: 3 additions & 2 deletions tests/mixed/test_NumPy_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import pytest

from adam import Representations
from adam.geometry import utils
from adam.numpy import KinDynComputations
from adam.numpy.numpy_like import SpatialMath


np.random.seed(42)

Expand Down Expand Up @@ -77,7 +78,7 @@ def H_from_Pos_RPY_idyn(xyz, rpy):
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

g = np.array([0, 0, -9.80665])
H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
kinDyn.setRobotState(H_b, joints_val, base_vel, joints_dot_val, g)


Expand Down
2 changes: 1 addition & 1 deletion tests/mixed/test_pytorch_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import torch

from adam import Representations
from adam.geometry import utils
from adam.pytorch import KinDynComputations
from adam.pytorch.torch_like import SpatialMath


np.random.seed(42)
torch.set_default_dtype(torch.float64)

Expand Down
5 changes: 3 additions & 2 deletions tests/parametric/test_CasADi_computations_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
import math
from adam.parametric.casadi import KinDynComputationsParametric
from adam.casadi import KinDynComputations
from adam.numpy.numpy_like import SpatialMath

from adam.geometry import utils
import tempfile
from git import Repo
from adam import Representations


# Getting stickbot urdf file
temp_dir = tempfile.TemporaryDirectory()
git_url = "https://github.com/icub-tech-iit/ergocub-gazebo-simulations.git"
Expand Down Expand Up @@ -88,7 +89,7 @@
joints_val = (np.random.rand(n_dofs) - 0.5) * 5
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
vb_ = base_vel
s_ = joints_val
s_dot_ = joints_dot_val
Expand Down
10 changes: 3 additions & 7 deletions tests/parametric/test_Jax_computations_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import math
from adam.parametric.jax import KinDynComputationsParametric
from adam.jax import KinDynComputations
from adam.numpy.numpy_like import SpatialMath

from adam.geometry import utils
import tempfile
from git import Repo
from adam import Representations


np.random.seed(42)
config.update("jax_enable_x64", True)

Expand Down Expand Up @@ -65,11 +66,6 @@
"r_ankle_roll",
]


def SX2DM(x):
return cs.DM(x)


logging.basicConfig(level=logging.DEBUG)
logging.debug("Showing the robot tree.")

Expand All @@ -96,7 +92,7 @@ def SX2DM(x):
joints_val = (np.random.rand(n_dofs) - 0.5) * 5
joints_dot_val = (np.random.rand(n_dofs) - 0.5) * 5

H_b = utils.H_from_Pos_RPY(xyz, rpy)
H_b = SpatialMath().H_from_Pos_RPY(xyz, rpy).array
vb_ = base_vel
s_ = joints_val
s_dot_ = joints_dot_val
Expand Down
Loading
Loading