-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path__init__.py
More file actions
32 lines (25 loc) · 1.04 KB
/
__init__.py
File metadata and controls
32 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
dimos_utils - Utility tools for dimensional robotics
This package provides utility tools for dimensional robotics projects,
including LCM-Foxglove bridge functionality and LCM message definitions.
"""
__version__ = "0.1.0"
import os
import sys
# Setup lcm_msgs path for backwards compatibility with seperate python_lcm_msgs package
def _setup_lcm_msgs_path():
"""Setup lcm_msgs path so internal imports work correctly"""
try:
# Try to import lcm_msgs to see if it's already installed
import lcm_msgs
except ImportError:
# If import fails, add the local python_lcm_msgs to path
# ensures internal imports like "from lcm_msgs import std_msgs" work
current_dir = os.path.dirname(os.path.abspath(__file__))
lcm_module_dir = os.path.join(current_dir, "python_lcm_msgs")
if os.path.exists(lcm_module_dir):
if lcm_module_dir not in sys.path:
sys.path.insert(0, lcm_module_dir)
_setup_lcm_msgs_path()
from . import lcm_foxglove_bridge
__all__ = ["lcm_foxglove_bridge"]