File tree Expand file tree Collapse file tree 3 files changed +41
-22
lines changed
Expand file tree Collapse file tree 3 files changed +41
-22
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ # -*- coding: utf-8 -*-
3+ #
4+ # Copyright 2022 Giulio Romualdi
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 os .path
19+ from typing import List
20+
21+ def get_package_dirs (module ) -> List [str ]:
22+ """
23+ Get package directories for a given module.
24+
25+ Args:
26+ module: Robot description module.
27+
28+ Returns:
29+ Package directories.
30+ """
31+ return [
32+ module .PACKAGE_PATH ,
33+ module .REPOSITORY_PATH ,
34+ os .path .dirname (module .PACKAGE_PATH ),
35+ os .path .dirname (module .REPOSITORY_PATH ),
36+ os .path .dirname (module .URDF_PATH ), # e.g. laikago_description
37+ ]
Original file line number Diff line number Diff line change 2121
2222from importlib import import_module # type: ignore
2323from typing import List , Optional
24- from .pinocchio import get_package_dirs
24+ from .. _package_dirs import get_package_dirs
2525
2626import idyntree .swig as idyn
2727
Original file line number Diff line number Diff line change 1919Load a robot description in Pinocchio.
2020"""
2121
22- import os .path
2322from importlib import import_module # type: ignore
24- from typing import List , Optional , Union
23+ from typing import Optional , Union
24+ from .._package_dirs import get_package_dirs
25+
2526
2627import pinocchio as pin
2728
4041]
4142
4243
43- def get_package_dirs (module ) -> List [str ]:
44- """
45- Get package directories for a given module.
46-
47- Args:
48- module: Robot description module.
49-
50- Returns:
51- Package directories.
52- """
53- return [
54- module .PACKAGE_PATH ,
55- module .REPOSITORY_PATH ,
56- os .path .dirname (module .PACKAGE_PATH ),
57- os .path .dirname (module .REPOSITORY_PATH ),
58- os .path .dirname (module .URDF_PATH ), # e.g. laikago_description
59- ]
60-
61-
6244def load_robot_description (
6345 description_name : str ,
6446 root_joint : Optional [PinocchioJoint ] = None ,
You can’t perform that action at this time.
0 commit comments