src
ros_introspection
urdf.py
Go to the documentation of this file.
1
import
re
2
3
FIND_PATTERN = re.compile(
r'\$\(find ([^\)]+)\)'
)
4
PACKAGE_PATTERN = re.compile(
r'package://([^/]+)/'
)
5
6
7
class
UrdfFile
:
8
def
__init__
(self, rel_fn, file_path):
9
self.
rel_fn
= rel_fn
10
self.
file_path
= file_path
11
self.
contents
= open(file_path).read()
12
13
def
get_dependencies
(self):
14
s = set()
15
for
pattern
in
[FIND_PATTERN, PACKAGE_PATTERN]:
16
for
match
in
pattern.findall(self.
contents
):
17
s.add(match)
18
return
sorted(s)
19
20
def
__repr__
(self):
21
return
self.
rel_fn
ros_introspection.urdf.UrdfFile.__init__
def __init__(self, rel_fn, file_path)
Definition:
urdf.py:8
ros_introspection.urdf.UrdfFile
Definition:
urdf.py:7
ros_introspection.urdf.UrdfFile.get_dependencies
def get_dependencies(self)
Definition:
urdf.py:13
ros_introspection.urdf.UrdfFile.rel_fn
rel_fn
Definition:
urdf.py:9
ros_introspection.urdf.UrdfFile.file_path
file_path
Definition:
urdf.py:10
ros_introspection.urdf.UrdfFile.__repr__
def __repr__(self)
Definition:
urdf.py:20
ros_introspection.urdf.UrdfFile.contents
contents
Definition:
urdf.py:11
ros_introspection
Author(s):
autogenerated on Tue Jun 21 2022 03:01:38