diff --git a/prover_rclpy/setup.py b/prover_rclpy/setup.py index b13dbc4..a05a13d 100644 --- a/prover_rclpy/setup.py +++ b/prover_rclpy/setup.py @@ -74,6 +74,7 @@ 'rclpy_1163_pub = src.rclpy_1163_pub:main', 'rclpy_1163_sub = src.rclpy_1163_sub:main', 'rclpy_1199 = src.rclpy_1199:main', + 'rclpy_1273 = src.rclpy_1273:main', 'ros2cli_818 = src.ros2cli_818:main', 'ros2cli_862 = src.ros2cli_862:main', 'ros2cli_885 = src.ros2cli_885:main', diff --git a/prover_rclpy/src/rclpy_1273.py b/prover_rclpy/src/rclpy_1273.py new file mode 100644 index 0000000..b0097cb --- /dev/null +++ b/prover_rclpy/src/rclpy_1273.py @@ -0,0 +1,20 @@ +from std_msgs.msg import String +from rclpy.serialization import deserialize_message, serialize_message + +# Serialized message data +#serialized_data = b'\x01\x03\x00\x00\x00\xb3\xa8\xbfFb\x89\xc8\x17\x00\x01\x00\x00I\x00\x00\x00Hello, world! Time(nanoseconds=1713770713401001821, clock_type=ROS_TIME)\x00\x00\x00\x00' + +def main(): + msg = String() + msg.data = 'Hello, world!' + msg_serialized = serialize_message(msg) + print(msg_serialized) + msg_deserialized = deserialize_message(msg_serialized, String) + print(msg_deserialized) + + #message_type = String() + #decoded_data = deserialize_message(serialized_data, String) + #print(decoded_data) + +if __name__ == "__main__": + main()