diff --git a/docs/conf.py b/docs/conf.py index c64063f6..b5f55b90 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,7 +59,7 @@ templates_path = ["_templates"] exclude_patterns = [] -html_title = f"adam" +html_title = "adam" # -- Options for HTML output ------------------------------------------------- diff --git a/examples/mpc-ik.ipynb b/examples/mpc-ik.ipynb index ba527fcc..f5444845 100644 --- a/examples/mpc-ik.ipynb +++ b/examples/mpc-ik.ipynb @@ -66,20 +66,17 @@ "import mediapy as media\n", "from adam.casadi import KinDynComputations\n", "import numpy as np\n", - "import casadi as cs\n", - "import distutils.util\n", - "import os\n", - "import subprocess" + "import casadi as cs" ] }, { "cell_type": "markdown", - "source": [ - "## Import the panda scene in mujoco" - ], "metadata": { "id": "2zw4FO-IGxdR" - } + }, + "source": [ + "## Import the panda scene in mujoco" + ] }, { "cell_type": "code", @@ -90,11 +87,14 @@ "outputs": [], "source": [ "# load scene from xml\n", - "model = mujoco.MjModel.from_xml_path(\"mujoco_menagerie/franka_emika_panda/scene.xml\")\n" + "model = mujoco.MjModel.from_xml_path(\"mujoco_menagerie/franka_emika_panda/scene.xml\")" ] }, { "cell_type": "markdown", + "metadata": { + "id": "CZMO7PsmKUB6" + }, "source": [ "## Import urdf in adam\n", "\n", @@ -102,10 +102,7 @@ "\n", "For now I have to use a separate urdf for adam.\n", "An importer for a mujoco model could be an idea for the future!" - ], - "metadata": { - "id": "CZMO7PsmKUB6" - } + ] }, { "cell_type": "code", @@ -115,19 +112,28 @@ }, "outputs": [], "source": [ - "joints_name_list = ['panda_joint1', 'panda_joint2', 'panda_joint3', 'panda_joint4', 'panda_joint5', 'panda_joint6', 'panda_joint7', 'panda_joint8']\n", + "joints_name_list = [\n", + " \"panda_joint1\",\n", + " \"panda_joint2\",\n", + " \"panda_joint3\",\n", + " \"panda_joint4\",\n", + " \"panda_joint5\",\n", + " \"panda_joint6\",\n", + " \"panda_joint7\",\n", + " \"panda_joint8\",\n", + "]\n", "\n", - "kindyn = KinDynComputations(urdfstring=\"panda.urdf\", joints_name_list=joints_name_list)\n" + "kindyn = KinDynComputations(urdfstring=\"panda.urdf\", joints_name_list=joints_name_list)" ] }, { "cell_type": "markdown", - "source": [ - "## A wrapper interface with mujoco" - ], "metadata": { "id": "g5LX5kQAKwaM" - } + }, + "source": [ + "## A wrapper interface with mujoco" + ] }, { "cell_type": "code", @@ -138,50 +144,51 @@ "outputs": [], "source": [ "class MujocoWrapper:\n", - " # a simple wrapper to use mujoco as a simulator\n", - " def __init__(self, model, joints_list=None):\n", - " self.model = model\n", - " self.data = mujoco.MjData(model)\n", - " self.renderer = mujoco.Renderer(self.model)\n", + " # a simple wrapper to use mujoco as a simulator\n", + " def __init__(self, model, joints_list=None):\n", + " self.model = model\n", + " self.data = mujoco.MjData(model)\n", + " self.renderer = mujoco.Renderer(self.model)\n", + "\n", + " def set_qpos(self, qpos):\n", + " # set the joint positions\n", + " self.data.qpos[:] = qpos\n", + " mujoco.mj_forward(self.model, self.data)\n", "\n", - " def set_qpos(self, qpos):\n", - " # set the joint positions\n", - " self.data.qpos[:] = qpos\n", - " mujoco.mj_forward(self.model, self.data)\n", + " def get_qpos(self):\n", + " # get the joint positions\n", + " return self.data.qpos[:]\n", "\n", - " def get_qpos(self):\n", - " # get the joint positions\n", - " return self.data.qpos[:]\n", + " def render(self):\n", + " # render the scene and return the frame\n", + " mujoco.mj_forward(self.model, self.data)\n", + " self.renderer.update_scene(self.data)\n", + " return self.renderer.render()\n", "\n", - " def render(self):\n", - " # render the scene and return the frame\n", - " mujoco.mj_forward(self.model, self.data)\n", - " self.renderer.update_scene(self.data)\n", - " return self.renderer.render()\n", + " def step(self):\n", + " # step the simulation\n", + " mujoco.mj_step(self.model, self.data)\n", "\n", - " def step(self):\n", - " # step the simulation\n", - " mujoco.mj_step(self.model, self.data)\n", + " def set_qvel(self, qvel):\n", + " # set the joint velocities\n", + " self.data.qvel[:] = qvel\n", + " mujoco.mj_forward(self.model, self.data)\n", "\n", - " def set_qvel(self, qvel):\n", - " # set the joint velocities\n", - " self.data.qvel[:] = qvel\n", - " mujoco.mj_forward(self.model, self.data)\n", "\n", - "wrapper = MujocoWrapper(model)\n" + "wrapper = MujocoWrapper(model)" ] }, { "cell_type": "markdown", + "metadata": { + "id": "wuY9hqdlD3Vo" + }, "source": [ "# Model Inverse Kinematics as an MPC\n", "\n", "An MPC is maybe not the best way to solve an IK problem.\n", "I just want to show how to use the casadi interface." - ], - "metadata": { - "id": "wuY9hqdlD3Vo" - } + ] }, { "cell_type": "code", @@ -197,13 +204,13 @@ "# casadi opti stack\n", "opti = cs.Opti()\n", "\n", - "N = 10 # number of control intervals\n", - "dt = 0.05 # time step\n", + "N = 10 # number of control intervals\n", + "dt = 0.05 # time step\n", "\n", "# joints variables\n", - "q = opti.variable(8, N+1)\n", + "q = opti.variable(8, N + 1)\n", "q_dot = opti.variable(8, N)\n", - "w_H_b = np.eye(4) # base of the manipulator as identity matrix\n", + "w_H_b = np.eye(4) # base of the manipulator as identity matrix\n", "\n", "# set the desidered end-effector position as a parameter\n", "# it will be set later when the mpc is solved at each iteration\n", @@ -217,7 +224,7 @@ "\n", "for i in range(N):\n", " # integration - forward euler\n", - " opti.subject_to(q[:, i+1] == q[:, i] + q_dot[:, i] * dt)\n", + " opti.subject_to(q[:, i + 1] == q[:, i] + q_dot[:, i] * dt)\n", " # bounds on the joint velocities\n", " opti.subject_to(opti.bounded(-5, q_dot[:, i], 5))\n", " # running cost\n", @@ -232,13 +239,16 @@ "opti.minimize(target_cost + velocities_cost)\n", "\n", "# set the solver\n", - "p_opts = {\"expand\": True, 'ipopt.print_level': 0, 'print_time': 0, 'ipopt.sb': 'yes'}\n", + "p_opts = {\"expand\": True, \"ipopt.print_level\": 0, \"print_time\": 0, \"ipopt.sb\": \"yes\"}\n", "s_opts = {\"max_iter\": 100, \"print_level\": 0}\n", - "opti.solver(\"ipopt\", p_opts, s_opts)\n" + "opti.solver(\"ipopt\", p_opts, s_opts)" ] }, { "cell_type": "markdown", + "metadata": { + "id": "Hf-Uq8PWFy6v" + }, "source": [ "# Simulation loop\n", "\n", @@ -247,10 +257,7 @@ "\n", "On the notebook it is a bit slow.\n", "To run it real time set OMP_NUM_THREADS=1 on your laptop!" - ], - "metadata": { - "id": "Hf-Uq8PWFy6v" - } + ] }, { "cell_type": "code", @@ -275,45 +282,49 @@ "mujoco.mj_resetData(wrapper.model, wrapper.data)\n", "i = 0\n", "while wrapper.data.time < duration:\n", - " wrapper.step()\n", - " if len(frames) < wrapper.data.time * framerate:\n", - " # you do not need to set the desired ee position every time step\n", - " # you can set it only when you want to change it\n", - " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", - " q0_numeric = wrapper.get_qpos()\n", - " # remove the last joint since they are not controlled\n", - " q0_numeric = q0_numeric[:-1]\n", - " # set the initial condition\n", - " opti.set_value(q0, q0_numeric)\n", - " sol = opti.solve()\n", - " # take the q_dot solution at the first time step and extend with the last joint to 0\n", - " sol_q_dot = sol.value(q_dot)[:, 0]\n", - " sol_q_dot = np.concatenate((sol_q_dot, np.zeros(1)))\n", - " wrapper.set_qvel(sol_q_dot)\n", - " pixels = wrapper.render()\n", - " frames.append(pixels)\n", - " # set the solution as the initial condition for the next time step\n", - " opti.set_initial(q, sol.value(q))\n", - " opti.set_initial(q_dot, sol.value(q_dot))\n", - " i += 1\n", - " if wrapper.data.time > 2:\n", - " # change the desired ee position\n", - " des_ee_pos_numeric = np.array([2.0, 0.0, 0.2])\n", - " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", - " if wrapper.data.time > 4:\n", - " # change the desired ee position\n", - " des_ee_pos_numeric = np.array([0.0, 0.5, 0.4])\n", - " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", - " if wrapper.data.time > 6:\n", - " # change the desired ee position\n", - " des_ee_pos_numeric = np.array([0.0, -0.6, 0.6])\n", - " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", + " wrapper.step()\n", + " if len(frames) < wrapper.data.time * framerate:\n", + " # you do not need to set the desired ee position every time step\n", + " # you can set it only when you want to change it\n", + " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", + " q0_numeric = wrapper.get_qpos()\n", + " # remove the last joint since they are not controlled\n", + " q0_numeric = q0_numeric[:-1]\n", + " # set the initial condition\n", + " opti.set_value(q0, q0_numeric)\n", + " sol = opti.solve()\n", + " # take the q_dot solution at the first time step and extend with the last joint to 0\n", + " sol_q_dot = sol.value(q_dot)[:, 0]\n", + " sol_q_dot = np.concatenate((sol_q_dot, np.zeros(1)))\n", + " wrapper.set_qvel(sol_q_dot)\n", + " pixels = wrapper.render()\n", + " frames.append(pixels)\n", + " # set the solution as the initial condition for the next time step\n", + " opti.set_initial(q, sol.value(q))\n", + " opti.set_initial(q_dot, sol.value(q_dot))\n", + " i += 1\n", + " if wrapper.data.time > 2:\n", + " # change the desired ee position\n", + " des_ee_pos_numeric = np.array([2.0, 0.0, 0.2])\n", + " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", + " if wrapper.data.time > 4:\n", + " # change the desired ee position\n", + " des_ee_pos_numeric = np.array([0.0, 0.5, 0.4])\n", + " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", + " if wrapper.data.time > 6:\n", + " # change the desired ee position\n", + " des_ee_pos_numeric = np.array([0.0, -0.6, 0.6])\n", + " opti.set_value(des_ee_pos, des_ee_pos_numeric)\n", "\n", - "media.show_video(frames, fps=framerate)\n" + "media.show_video(frames, fps=framerate)" ] } ], "metadata": { + "colab": { + "include_colab_link": true, + "provenance": [] + }, "kernelspec": { "display_name": "adam_env", "language": "python", @@ -330,10 +341,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.11" - }, - "colab": { - "provenance": [], - "include_colab_link": true } }, "nbformat": 4, diff --git a/src/adam/casadi/computations.py b/src/adam/casadi/computations.py index 8b0dc66d..527553c2 100644 --- a/src/adam/casadi/computations.py +++ b/src/adam/casadi/computations.py @@ -2,9 +2,10 @@ # This software may be modified and distributed under the terms of the # GNU Lesser General Public License v2.1 or any later version. +from typing import Union + import casadi as cs import numpy as np -from typing import Union from adam.casadi.casadi_like import SpatialMath from adam.core import RBDAlgorithms diff --git a/src/adam/model/__init__.py b/src/adam/model/__init__.py index 0426e317..3c23a54a 100644 --- a/src/adam/model/__init__.py +++ b/src/adam/model/__init__.py @@ -1,4 +1,4 @@ -from .abc_factories import Joint, Link, ModelFactory, Inertial, Pose +from .abc_factories import Inertial, Joint, Link, ModelFactory, Pose from .model import Model from .std_factories.std_joint import StdJoint from .std_factories.std_link import StdLink diff --git a/src/adam/model/conversions/idyntree.py b/src/adam/model/conversions/idyntree.py index bbd8fd8e..bf208ce0 100644 --- a/src/adam/model/conversions/idyntree.py +++ b/src/adam/model/conversions/idyntree.py @@ -1,11 +1,11 @@ +from typing import List + import idyntree.bindings import numpy as np import urdf_parser_py.urdf -from typing import List - +from adam.model.abc_factories import Joint, Link from adam.model.model import Model -from adam.model.abc_factories import Link, Joint def to_idyntree_solid_shape( diff --git a/src/adam/model/std_factories/std_link.py b/src/adam/model/std_factories/std_link.py index 7754747d..49475d73 100644 --- a/src/adam/model/std_factories/std_link.py +++ b/src/adam/model/std_factories/std_link.py @@ -2,7 +2,7 @@ import urdf_parser_py.urdf from adam.core.spatial_math import SpatialMath -from adam.model import Link, Inertial, Pose +from adam.model import Inertial, Link, Pose class StdLink(Link): diff --git a/src/adam/model/std_factories/std_model.py b/src/adam/model/std_factories/std_model.py index f82b6d0a..8a720e18 100644 --- a/src/adam/model/std_factories/std_model.py +++ b/src/adam/model/std_factories/std_model.py @@ -1,7 +1,8 @@ +import os import pathlib -from typing import List import xml.etree.ElementTree as ET -import os +from typing import List + import urdf_parser_py.urdf from adam.core.spatial_math import SpatialMath diff --git a/src/adam/parametric/casadi/computations_parametric.py b/src/adam/parametric/casadi/computations_parametric.py index e9c2b77e..f74c873b 100644 --- a/src/adam/parametric/casadi/computations_parametric.py +++ b/src/adam/parametric/casadi/computations_parametric.py @@ -1,7 +1,7 @@ # Copyright (C) 2021 Istituto Italiano di Tecnologia (IIT). All rights reserved. # This software may be modified and distributed under the terms of the # GNU Lesser General Public License v2.1 or any later version. -from typing import List, Union +from typing import List import casadi as cs import numpy as np @@ -10,7 +10,7 @@ from adam.core import RBDAlgorithms from adam.core.constants import Representations from adam.model import Model -from adam.parametric.model import URDFParametricModelFactory, ParametricLink +from adam.parametric.model import ParametricLink, URDFParametricModelFactory class KinDynComputationsParametric: diff --git a/src/adam/parametric/jax/computations_parametric.py b/src/adam/parametric/jax/computations_parametric.py index 3ac9c5f2..63510498 100644 --- a/src/adam/parametric/jax/computations_parametric.py +++ b/src/adam/parametric/jax/computations_parametric.py @@ -6,13 +6,12 @@ import jax.numpy as jnp import numpy as np -from jax import grad, jit, vmap -from adam.core.rbd_algorithms import RBDAlgorithms from adam.core.constants import Representations +from adam.core.rbd_algorithms import RBDAlgorithms from adam.jax.jax_like import SpatialMath from adam.model import Model -from adam.parametric.model import URDFParametricModelFactory, ParametricLink +from adam.parametric.model import ParametricLink, URDFParametricModelFactory class KinDynComputationsParametric: diff --git a/src/adam/parametric/model/parametric_factories/parametric_link.py b/src/adam/parametric/model/parametric_factories/parametric_link.py index 1346f3f8..49402a77 100644 --- a/src/adam/parametric/model/parametric_factories/parametric_link.py +++ b/src/adam/parametric/model/parametric_factories/parametric_link.py @@ -1,12 +1,12 @@ +import copy +import math +from enum import Enum + import numpy.typing as npt import urdf_parser_py.urdf -from enum import Enum -import copy from adam.core.spatial_math import SpatialMath from adam.model import Link - -import math from adam.model.abc_factories import Inertia, Inertial @@ -74,7 +74,7 @@ def get_principal_length(self): elif self.geometry_type == Geometry.BOX: v_l = self.visual_data.size[2] else: - raise Exception(f"THE GEOMETRY IS NOT SPECIFIED") + raise Exception("THE GEOMETRY IS NOT SPECIFIED") return v_l def get_principal_length_parametric(self): @@ -94,7 +94,7 @@ def get_principal_length_parametric(self): elif self.geometry_type == Geometry.BOX: v_l = self.visual_data_new[2] else: - raise Exception(f"THE GEOMETRY IS NOT SPECIFIED") + raise Exception("THE GEOMETRY IS NOT SPECIFIED") return v_l def compute_offset(self): diff --git a/src/adam/parametric/model/parametric_factories/parametric_model.py b/src/adam/parametric/model/parametric_factories/parametric_model.py index 3702735e..f8b4bfac 100644 --- a/src/adam/parametric/model/parametric_factories/parametric_model.py +++ b/src/adam/parametric/model/parametric_factories/parametric_model.py @@ -1,11 +1,10 @@ -import pathlib from typing import List -import os import urdf_parser_py.urdf + from adam.core.spatial_math import SpatialMath -from adam.model import ModelFactory, StdJoint, StdLink, Link, Joint -from adam.model.std_factories.std_model import urdf_remove_sensors_tags, get_xml_string +from adam.model import Joint, Link, ModelFactory, StdJoint, StdLink +from adam.model.std_factories.std_model import get_xml_string, urdf_remove_sensors_tags from adam.parametric.model import ParametricJoint, ParametricLink diff --git a/src/adam/parametric/numpy/computations_parametric.py b/src/adam/parametric/numpy/computations_parametric.py index 7e961467..2aa53785 100644 --- a/src/adam/parametric/numpy/computations_parametric.py +++ b/src/adam/parametric/numpy/computations_parametric.py @@ -2,14 +2,15 @@ # This software may be modified and distributed under the terms of the # GNU Lesser General Public License v2.1 or any later version. -import numpy as np from typing import List -from adam.core.rbd_algorithms import RBDAlgorithms +import numpy as np + from adam.core.constants import Representations +from adam.core.rbd_algorithms import RBDAlgorithms from adam.model import Model -from adam.parametric.model import URDFParametricModelFactory, ParametricLink from adam.numpy.numpy_like import SpatialMath +from adam.parametric.model import ParametricLink, URDFParametricModelFactory class KinDynComputationsParametric: diff --git a/src/adam/parametric/pytorch/computations_parametric.py b/src/adam/parametric/pytorch/computations_parametric.py index 07eb7a78..43cb5748 100644 --- a/src/adam/parametric/pytorch/computations_parametric.py +++ b/src/adam/parametric/pytorch/computations_parametric.py @@ -2,14 +2,15 @@ # This software may be modified and distributed under the terms of the # GNU Lesser General Public License v2.1 or any later version. +from typing import List + import numpy as np import torch -from typing import List -from adam.core.rbd_algorithms import RBDAlgorithms from adam.core.constants import Representations +from adam.core.rbd_algorithms import RBDAlgorithms from adam.model import Model -from adam.parametric.model import URDFParametricModelFactory, ParametricLink +from adam.parametric.model import ParametricLink, URDFParametricModelFactory from adam.pytorch.torch_like import SpatialMath diff --git a/src/adam/pytorch/__init__.py b/src/adam/pytorch/__init__.py index 7a33bea1..0e52c9ef 100644 --- a/src/adam/pytorch/__init__.py +++ b/src/adam/pytorch/__init__.py @@ -2,6 +2,6 @@ # This software may be modified and distributed under the terms of the # GNU Lesser General Public License v2.1 or any later version. -from .computations import KinDynComputations +from .computations import KinDynComputations # isort:skip from .computation_batch import KinDynComputationsBatch from .torch_like import TorchLike diff --git a/src/adam/pytorch/torch_like.py b/src/adam/pytorch/torch_like.py index 71962f65..b9e456ef 100644 --- a/src/adam/pytorch/torch_like.py +++ b/src/adam/pytorch/torch_like.py @@ -7,7 +7,6 @@ import numpy.typing as ntp import torch -import numpy as np from adam.core.spatial_math import ArrayLike, ArrayLikeFactory, SpatialMath diff --git a/tests/body_fixed/test_Jax_body_fixed.py b/tests/body_fixed/test_Jax_body_fixed.py index 10330947..a41b2892 100644 --- a/tests/body_fixed/test_Jax_body_fixed.py +++ b/tests/body_fixed/test_Jax_body_fixed.py @@ -6,7 +6,6 @@ import icub_models import idyntree.swig as idyntree -import jax.numpy as jnp import numpy as np import pytest from jax import config diff --git a/tests/body_fixed/test_pytorch_body_fixed.py b/tests/body_fixed/test_pytorch_body_fixed.py index daa3a142..63a90ac8 100644 --- a/tests/body_fixed/test_pytorch_body_fixed.py +++ b/tests/body_fixed/test_pytorch_body_fixed.py @@ -11,7 +11,6 @@ import torch from adam import Representations -from adam.geometry import utils from adam.pytorch import KinDynComputations from adam.pytorch.torch_like import SpatialMath diff --git a/tests/mixed/test_Jax_mixed.py b/tests/mixed/test_Jax_mixed.py index 636a3391..ca4ceeba 100644 --- a/tests/mixed/test_Jax_mixed.py +++ b/tests/mixed/test_Jax_mixed.py @@ -6,7 +6,6 @@ import icub_models import idyntree.swig as idyntree -import jax.numpy as jnp import numpy as np import pytest from jax import config diff --git a/tests/mixed/test_NumPy_mixed.py b/tests/mixed/test_NumPy_mixed.py index d4710441..8a5fb963 100644 --- a/tests/mixed/test_NumPy_mixed.py +++ b/tests/mixed/test_NumPy_mixed.py @@ -9,7 +9,6 @@ import numpy as np import pytest -from adam import Representations from adam.geometry import utils from adam.numpy import KinDynComputations diff --git a/tests/mixed/test_pytorch_mixed.py b/tests/mixed/test_pytorch_mixed.py index 32a72702..612768b5 100644 --- a/tests/mixed/test_pytorch_mixed.py +++ b/tests/mixed/test_pytorch_mixed.py @@ -11,7 +11,6 @@ import torch from adam import Representations -from adam.geometry import utils from adam.pytorch import KinDynComputations from adam.pytorch.torch_like import SpatialMath diff --git a/tests/parametric/test_CasADi_computations_parametric.py b/tests/parametric/test_CasADi_computations_parametric.py index b36d9961..66f46f8e 100644 --- a/tests/parametric/test_CasADi_computations_parametric.py +++ b/tests/parametric/test_CasADi_computations_parametric.py @@ -3,18 +3,15 @@ # GNU Lesser General Public License v2.1 or any later version. import logging -from os import link import casadi as cs import numpy as np import pytest -import math from adam.parametric.casadi import KinDynComputationsParametric from adam.casadi import KinDynComputations from adam.geometry import utils import tempfile from git import Repo -from adam import Representations # Getting stickbot urdf file temp_dir = tempfile.TemporaryDirectory() diff --git a/tests/parametric/test_Jax_computations_parametric.py b/tests/parametric/test_Jax_computations_parametric.py index aec6ee87..9734bf87 100644 --- a/tests/parametric/test_Jax_computations_parametric.py +++ b/tests/parametric/test_Jax_computations_parametric.py @@ -3,20 +3,16 @@ # GNU Lesser General Public License v2.1 or any later version. import logging -from os import link -import urdf_parser_py.urdf -import jax.numpy as jnp from jax import config import numpy as np import pytest -import math +import casadi as cs from adam.parametric.jax import KinDynComputationsParametric from adam.jax import KinDynComputations 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) diff --git a/tests/parametric/test_NumPy_computations_parametric.py b/tests/parametric/test_NumPy_computations_parametric.py index 42b51c9d..a05ecda9 100644 --- a/tests/parametric/test_NumPy_computations_parametric.py +++ b/tests/parametric/test_NumPy_computations_parametric.py @@ -3,10 +3,8 @@ # GNU Lesser General Public License v2.1 or any later version. import logging -from os import link -import urdf_parser_py.urdf import pytest -import math +import casadi as cs import numpy as np from adam.parametric.numpy import KinDynComputationsParametric from adam.numpy import KinDynComputations @@ -14,7 +12,6 @@ from adam.geometry import utils import tempfile from git import Repo -from adam import Representations np.random.seed(42) diff --git a/tests/parametric/test_pytorch_computations_parametric.py b/tests/parametric/test_pytorch_computations_parametric.py index f2a18963..2d080260 100644 --- a/tests/parametric/test_pytorch_computations_parametric.py +++ b/tests/parametric/test_pytorch_computations_parametric.py @@ -3,20 +3,15 @@ # GNU Lesser General Public License v2.1 or any later version. import logging -from os import link -import urdf_parser_py.urdf import pytest -import math import torch import numpy as np from adam.parametric.pytorch import KinDynComputationsParametric from adam.pytorch import KinDynComputations from adam.pytorch.torch_like import SpatialMath -from adam.geometry import utils import tempfile from git import Repo -from adam import Representations np.random.seed(42) torch.set_default_dtype(torch.float64) diff --git a/tests/pytorch_batch/test_pytorch_batch.py b/tests/pytorch_batch/test_pytorch_batch.py index 44b3a33d..e4795621 100644 --- a/tests/pytorch_batch/test_pytorch_batch.py +++ b/tests/pytorch_batch/test_pytorch_batch.py @@ -1,10 +1,5 @@ -import logging - import icub_models -import idyntree.swig as idyntree -import jax.numpy as jnp import numpy as np -import pytest from jax import config import adam