diff --git a/unilabos/ros/msgs/message_converter.py b/unilabos/ros/msgs/message_converter.py index 940c481..f0e9468 100644 --- a/unilabos/ros/msgs/message_converter.py +++ b/unilabos/ros/msgs/message_converter.py @@ -343,7 +343,7 @@ def convert_to_ros_msg(ros_msg_type: Union[Type, Any], obj: Any) -> Any: if hasattr(ros_msg, key): attr = getattr(ros_msg, key) if isinstance(attr, (float, int, str, bool)): - setattr(ros_msg, key, value) + setattr(ros_msg, key, type(attr)(value)) elif isinstance(attr, (list, tuple)) and isinstance(value, Iterable): td = ros_msg.SLOT_TYPES[ind].value_type if isinstance(td, NamespacedType):