From a6ec20e279720c8928b5ae64e3c2d99a6ad24ebe Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Sat, 5 Jul 2025 12:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=88=B0ros=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=97=B6=EF=BC=8C=E8=A6=81=E8=BF=9B=E8=A1=8C=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unilabos/ros/msgs/message_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):