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
def __init__(self, rel_fn, file_path)
Definition: urdf.py:8


ros_introspection
Author(s):
autogenerated on Wed Mar 3 2021 03:56:00