From 1afd3d1f4d1937cece059562a71ec7f24cfd86c4 Mon Sep 17 00:00:00 2001 From: Jonathan Challinger Date: Wed, 9 Aug 2023 16:48:29 -0400 Subject: [PATCH] add vesc top level namespace --- dronecan/__init__.py | 5 +++-- dronecan/dsdl/parser.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dronecan/__init__.py b/dronecan/__init__.py index b5ed506..f5b4032 100644 --- a/dronecan/__init__.py +++ b/dronecan/__init__.py @@ -140,7 +140,8 @@ def load_dsdl(*paths, **args): os.path.join(dsdl_path, "dronecan"), os.path.join(dsdl_path, "ardupilot"), os.path.join(dsdl_path, "com"), - os.path.join(dsdl_path, "cuav")] + paths + os.path.join(dsdl_path, "cuav"), + os.path.join(dsdl_path, "vesc")] + paths custom_path = os.path.join(os.path.expanduser("~"), "uavcan_vendor_specific_types") if os.path.isdir(custom_path): paths += [f for f in [os.path.join(custom_path, f) for f in os.listdir(custom_path)] @@ -182,7 +183,7 @@ def create_instance(*args, **kwargs): dtype.Request = create_instance_closure(dtype, _mode='request') dtype.Response = create_instance_closure(dtype, _mode='response') - toplevel = ['dronecan', 'uavcan', 'ardupilot', 'com', 'cuav'] + toplevel = ['dronecan', 'uavcan', 'ardupilot', 'com', 'cuav', 'vesc'] for n in toplevel: namespace = root_namespace._path(n) MODULE.__dict__[n] = Namespace() diff --git a/dronecan/dsdl/parser.py b/dronecan/dsdl/parser.py index 509660f..16df6c2 100644 --- a/dronecan/dsdl/parser.py +++ b/dronecan/dsdl/parser.py @@ -841,6 +841,8 @@ def parse_namespaces(source_dirs, search_dirs=None): [saturated uint48 UNKNOWN = 0, saturated uint48 USEC_PER_LSB = 100] """ + print('parse_namespaces source_dirs=\'%s\' search_dirs=\'%s\'' % (source_dirs, search_dirs)) + # noinspection PyShadowingNames def walk(walk_dirs): import fnmatch