mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 04:51:10 +00:00
fix: unit conversion
feat: better attr publisher log
This commit is contained in:
@@ -342,9 +342,15 @@ class BaseROS2DeviceNode(Node, Generic[T]):
|
||||
else:
|
||||
return getattr(self.driver_instance, attr_name)
|
||||
except AttributeError as ex:
|
||||
self.lab_logger().error(
|
||||
f"publish error, {str(type(self.driver_instance))[8:-2]} has no attribute '{attr_name}'"
|
||||
)
|
||||
if ex.args[0].startswith(f"AttributeError: '{self.driver_instance.__class__.__name__}' object"):
|
||||
self.lab_logger().error(
|
||||
f"publish error, {str(type(self.driver_instance))[8:-2]} has no attribute '{attr_name}'"
|
||||
)
|
||||
else:
|
||||
self.lab_logger().error(
|
||||
f"publish error, when {str(type(self.driver_instance))[8:-2]} getting attribute '{attr_name}'"
|
||||
)
|
||||
self.lab_logger().error(traceback.format_exc())
|
||||
|
||||
self._property_publishers[attr_name] = PropertyPublisher(
|
||||
self, attr_name, get_device_attr, msg_type, initial_period, self._print_publish
|
||||
|
||||
Reference in New Issue
Block a user