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

Test MJCF descriptions with Pinocchio #103

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
34 changes: 33 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9"]
loader: ["idyntree", "mujoco", "pinocchio", "pybullet", "robomeshcat", "yourdfpy"]
loader: ["idyntree", "mujoco", "pybullet", "robomeshcat", "yourdfpy"]

steps:
- name: "Checkout sources"
Expand All @@ -85,6 +85,38 @@ jobs:
run: |
tox -e loader-${{ matrix.loader }}

loader-pinocchio:
name: "Loader: pinocchio with Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.9"]

defaults:
run:
# See https://github.com/mamba-org/setup-micromamba?tab=readme-ov-file#about-login-shells
shell: bash -leo pipefail {0}

steps:
- name: "Checkout sources"
uses: actions/checkout@v4

- name: "Install Conda environment with Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0'
environment-name: pinocchio_test_env
create-args: >-
python=${{ matrix.python-version }}
pinocchio>=3.1.0
cache-environment: true
post-cleanup: 'all'

- name: "Run loader tests"
run: |
python -m unittest tests/loaders/test_pinocchio.py --failfast

ci_success:
name: "CI success"
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ keywords = ["robot", "description", "urdf", "mjcf"]
opts = [
"idyntree >= 8.0.0",
"mujoco >=3.2.0",
"pin >=2.6.10",
"pin >= 3.1.0",
"pybullet >=3.2.6",
"robomeshcat >=1.0.4",
"yourdfpy >=0.0.56",
Expand Down
14 changes: 6 additions & 8 deletions tests/loaders/test_pinocchio.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class TestPinocchio(unittest.TestCase):

"""
Check that all descriptions are loaded properly in Pinocchio.
"""
Expand All @@ -34,11 +33,10 @@ def test(self):
return test


# Add a test function for each URDF description
# Add a test function for each description
for name, description in DESCRIPTIONS.items():
if description.has_urdf:
setattr(
TestPinocchio,
f"test_{name}",
TestPinocchio.get_test_for_description(name),
)
setattr(
TestPinocchio,
f"test_{name}",
TestPinocchio.get_test_for_description(name),
)
23 changes: 8 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ deps =
idyntree >= 8.0.0
mujoco >=2.3.5
numpy >=1.23.4,<2
pin >=2.6.14
pin >= 3.1.0
pybullet >=3.2.5
robomeshcat >= 1.0.4
yourdfpy >=0.0.56
commands =
coverage erase
coverage run -m unittest tests
coverage run -m unittest tests --failfast
coverage report --include="robot_descriptions/**"

[testenv:lint]
Expand All @@ -32,7 +32,7 @@ deps =
mujoco >=2.3.5
mypy
numpy >=1.23.4,<2
pin >=2.6.14
pin >= 3.1.0
pybullet >=3.2.5
pylint
robomeshcat >= 1.0.4
Expand All @@ -50,37 +50,30 @@ changedir = {toxinidir}/tests/loaders
deps =
idyntree >= 8.0.0
commands =
python -m unittest test_idyntree.py
python -m unittest test_idyntree.py --failfast

[testenv:loader-mujoco]
changedir = {toxinidir}/tests/loaders
deps =
mujoco >=2.3.5
commands =
python -m unittest test_mujoco.py

[testenv:loader-pinocchio]
changedir = {toxinidir}/tests/loaders
deps =
pin >=2.6.14
commands =
python -m unittest test_pinocchio.py
python -m unittest test_mujoco.py --failfast

[testenv:loader-pybullet]
changedir = {toxinidir}/tests/loaders
deps =
numpy >=1.23.4,<2
pybullet >=3.2.5
commands =
python -m unittest test_pybullet.py
python -m unittest test_pybullet.py --failfast

[testenv:loader-robomeshcat]
changedir = {toxinidir}/tests/loaders
deps =
pycollada >=0.6
robomeshcat >= 1.0.4
commands =
python -m unittest test_robomeshcat.py
python -m unittest test_robomeshcat.py --failfast

[testenv:loader-yourdfpy]
changedir = {toxinidir}/tests/loaders
Expand All @@ -90,7 +83,7 @@ deps =
trimesh ~=3.16.0
yourdfpy >=0.0.56
commands =
python -m unittest test_yourdfpy.py
python -m unittest test_yourdfpy.py --failfast

[pylint]
generated-members=mujoco.MjModel, pin.JointModelFreeFlyer, pin.JointModelPX, pin.JointModelPY, pin.JointModelPZ, pin.JointModelPlanar, pin.JointModelRX, pin.JointModelRY, pin.JointModelRZ, pin.JointModelSpherical, pin.JointModelSphericalZYX, pin.JointModelTranslation, pin.Model, pybullet.loadURDF, pybullet.setAdditionalSearchPath
Loading