From 80ee05e818f42995fa37f5669dc3f1fc7075f1da Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Thu, 20 Jul 2023 17:37:04 -0700 Subject: [PATCH] Fix ROSSerialization example. --- examples/CCpp/src/ROS/ROSSerialization.lf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/CCpp/src/ROS/ROSSerialization.lf b/examples/CCpp/src/ROS/ROSSerialization.lf index 35657b16..c5324a82 100644 --- a/examples/CCpp/src/ROS/ROSSerialization.lf +++ b/examples/CCpp/src/ROS/ROSSerialization.lf @@ -33,7 +33,7 @@ reactor Clock(offset: time = 0, period: time = 1 sec) { timer t(0, period) state count: int = 0 - state serialized_msg: rclcpp::SerializedMessage = {= rclcpp::SerializedMessage(0u) =} + state serialized_msg: rclcpp::SerializedMessage* = {= new rclcpp::SerializedMessage(0u) =} reaction(t) -> y {= (self->count)++; @@ -45,13 +45,13 @@ reactor Clock(offset: time = 0, period: time = 1 sec) { auto message_header_length = 8u; auto message_payload_length = 10u; - self->serialized_msg.reserve(message_header_length + message_payload_length); + self->serialized_msg->reserve(message_header_length + message_payload_length); static rclcpp::Serialization serializer_obj; - serializer_obj.serialize_message(msg.get(), &self->serialized_msg); + serializer_obj.serialize_message(msg.get(), self->serialized_msg); - SET_NEW_ARRAY(y, self->serialized_msg.size()); - y->value = self->serialized_msg.get_rcl_serialized_message().buffer; + SET_NEW_ARRAY(y, self->serialized_msg->size()); + y->value = self->serialized_msg->get_rcl_serialized_message().buffer; =} }