|
| 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 | + |
| 19 | +import unittest |
| 20 | +import pybullet |
| 21 | + |
| 22 | +from robot_descriptions.loaders.mujoco import ( |
| 23 | + load_robot_description as load_mujoco, |
| 24 | +) |
| 25 | +from robot_descriptions.loaders.pinocchio import ( |
| 26 | + load_robot_description as load_pinocchio, |
| 27 | +) |
| 28 | +from robot_descriptions.loaders.pybullet import ( |
| 29 | + load_robot_description as load_pybullet, |
| 30 | +) |
| 31 | +from robot_descriptions.loaders.robomeshcat import ( |
| 32 | + load_robot_description as load_robomeshcat, |
| 33 | +) |
| 34 | +from robot_descriptions.loaders.yourdfpy import ( |
| 35 | + load_robot_description as load_yourdfpy, |
| 36 | +) |
| 37 | + |
| 38 | + |
| 39 | +class TestLoaders(unittest.TestCase): |
| 40 | + |
| 41 | + """ |
| 42 | + Test loaders. |
| 43 | + """ |
| 44 | + |
| 45 | + def test_mujoco(self): |
| 46 | + self.assertIsNotNone(load_mujoco("cassie_mj_description")) |
| 47 | + |
| 48 | + def test_pinocchio(self): |
| 49 | + self.assertIsNotNone(load_pinocchio("upkie_description")) |
| 50 | + |
| 51 | + def test_pybullet(self): |
| 52 | + pybullet.connect(pybullet.DIRECT) |
| 53 | + self.assertIsNotNone(load_pybullet("upkie_description")) |
| 54 | + pybullet.disconnect() |
| 55 | + |
| 56 | + def test_robomeshcat(self): |
| 57 | + self.assertIsNotNone(load_robomeshcat("upkie_description")) |
| 58 | + |
| 59 | + def test_yourdfpy(self): |
| 60 | + self.assertIsNotNone(load_yourdfpy("upkie_description")) |
0 commit comments