Skip to content

Commit ba8e54a

Browse files
stephane-caronStéphane Caron
authored andcommitted
CI: check that all URDF descriptions load in yourdfpy
1 parent cc37a53 commit ba8e54a

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ All notable changes to this project will be documented in this file.
66

77
### Added
88

9+
- CI: check that all URDF descriptions load in yourdfpy
910
- Example: load in yourdfpy
1011
- Loader: yourdfpy
1112

1213
## [0.5.0] - 2022/09/19
1314

1415
### Added
1516

17+
- CI: check that all MJCF descriptions load in MuJoCo
1618
- Description: BarrettHand
1719
- Description: Eve R3
1820
- Description: Robonaut 2
@@ -30,6 +32,7 @@ All notable changes to this project will be documented in this file.
3032

3133
### Added
3234

35+
- CI: check that all URDF descriptions load in PyBullet
3336
- Description: Poppy Ergo Jr
3437
- Description: Poppy Torso
3538
- Loader: PyBullet
@@ -52,6 +55,7 @@ All notable changes to this project will be documented in this file.
5255

5356
### Added
5457

58+
- CI: check that URDF descriptions load in Pinocchio
5559
- Description: ANYmal B MJCF
5660
- Description: ANYmal C MJCF
5761
- Description: Atlas v4

tests/test_yourdfpy.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2022 Stéphane Caron
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
import logging
19+
import unittest
20+
21+
from robot_descriptions._descriptions import DESCRIPTIONS
22+
from robot_descriptions.loaders.yourdfpy import load_robot_description
23+
24+
25+
class TestYourdfpy(unittest.TestCase):
26+
27+
"""
28+
Check that all URDF descriptions are loaded properly in yourdfpy.
29+
"""
30+
31+
def setUp(self):
32+
logging.basicConfig()
33+
logging.getLogger().setLevel(logging.INFO)
34+
35+
@staticmethod
36+
def get_test_for_description(description: str):
37+
"""
38+
Get test function for a given description.
39+
40+
Args:
41+
description: Name of the description.
42+
43+
Returns:
44+
Test function for that description.
45+
"""
46+
47+
def test(self):
48+
logging.info(f"Loading {description} in yourdfpy...")
49+
load_robot_description(description)
50+
51+
return test
52+
53+
54+
for name, description in DESCRIPTIONS.items():
55+
if description.has_urdf:
56+
setattr(
57+
TestYourdfpy,
58+
f"test_{name}",
59+
TestYourdfpy.get_test_for_description(name),
60+
)

0 commit comments

Comments
 (0)