util.py
Go to the documentation of this file.
1 from importlib import import_module
2 from typing import Any, Callable, Dict
3 
4 import rospy
5 from rosbridge_library.internal import message_conversion
6 
7 def lookup_object(object_path: str, package: str='mqtt_bridge') -> Any:
8  """ lookup object from a some.module:object_name specification. """
9  module_name, obj_name = object_path.split(":")
10  module = import_module(module_name, package)
11  obj = getattr(module, obj_name)
12  return obj
13 
14 
15 extract_values = message_conversion.extract_values # type: Callable[[rospy.Message], Dict]
16 populate_instance = message_conversion.populate_instance # type: Callable[[Dict, rospy.Message], rospy.Message]
17 
18 
19 __all__ = ['lookup_object', 'extract_values', 'populate_instance']
def lookup_object
Definition: util.py:7


mqtt_bridge
Author(s): Junya Hayashi
autogenerated on Mon Feb 15 2021 03:57:51