From 2cd7525861e59aaeeb0ba880cff6622ba07912f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pe=C5=82ka?= Date: Tue, 23 Sep 2025 17:11:29 +0200 Subject: [PATCH] Cherry-pick from: Adjust code of ROS2ScriptIntegration to 2510. (#144) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Pełka Signed-off-by: Jan Hanca Co-authored-by: Jan Hanca (cherry picked from commit 709829adc92550035fcd236612f428173d15abb9) Signed-off-by: Piotr Jaroszek --- .../Code/Source/Clients/PublisherSystemComponent.cpp | 5 ++++- .../Code/Source/Clients/PublisherSystemComponent.h | 1 - .../Source/Clients/ROS2ScriptIntegrationSystemComponent.h | 2 +- .../Code/Source/Clients/SubscriberSystemComponent.cpp | 7 ++++--- .../Code/Source/Clients/SubscriberSystemComponent.h | 3 --- Gems/ROS2ScriptIntegration/gem.json | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.cpp b/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.cpp index 51c0d39c..2c92c893 100644 --- a/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.cpp +++ b/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.cpp @@ -1,4 +1,7 @@ #include "PublisherSystemComponent.h" + +#include + #include #include @@ -184,7 +187,7 @@ namespace ROS2ScriptIntegration const AZStd::string& topicName, const AZStd::string& frame, const AZ::Transform& transform) { geometry_msgs::msg::PoseStamped message; - message.header.stamp = ROS2::ROS2Interface::Get()->GetROSTimestamp(); + message.header.stamp = ROS2::ROS2ClockInterface::Get()->GetROSTimestamp(); message.header.frame_id = std::string(frame.c_str()); message.pose.position.x = transform.GetTranslation().GetX(); message.pose.position.y = transform.GetTranslation().GetY(); diff --git a/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.h b/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.h index 073262e3..4fc69f9b 100644 --- a/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.h +++ b/Gems/ROS2ScriptIntegration/Code/Source/Clients/PublisherSystemComponent.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ROS2ScriptIntegration/Code/Source/Clients/ROS2ScriptIntegrationSystemComponent.h b/Gems/ROS2ScriptIntegration/Code/Source/Clients/ROS2ScriptIntegrationSystemComponent.h index 45451592..abc1a76b 100644 --- a/Gems/ROS2ScriptIntegration/Code/Source/Clients/ROS2ScriptIntegrationSystemComponent.h +++ b/Gems/ROS2ScriptIntegration/Code/Source/Clients/ROS2ScriptIntegrationSystemComponent.h @@ -7,7 +7,7 @@ #include #include #include -#include + #include #include #include diff --git a/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.cpp b/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.cpp index aa0f7f4d..6dd46c3c 100644 --- a/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.cpp +++ b/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.cpp @@ -1,10 +1,11 @@ #include "SubscriberSystemComponent.h" -#include -#include - #include #include +#include +#include +#include +#include #include #include diff --git a/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.h b/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.h index 89c3fb92..c2f35aee 100644 --- a/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.h +++ b/Gems/ROS2ScriptIntegration/Code/Source/Clients/SubscriberSystemComponent.h @@ -6,9 +6,6 @@ #include #include #include -#include -#include -#include #include #include #include diff --git a/Gems/ROS2ScriptIntegration/gem.json b/Gems/ROS2ScriptIntegration/gem.json index dc72c208..d90b4c72 100644 --- a/Gems/ROS2ScriptIntegration/gem.json +++ b/Gems/ROS2ScriptIntegration/gem.json @@ -1,6 +1,6 @@ { "gem_name": "ROS2ScriptIntegration", - "version": "1.0.0", + "version": "2.0.0", "display_name": "ROS2ScriptIntegration", "license": "Apache-2.0", "license_url": "https://opensource.org/licenses/Apache-2.0", @@ -21,7 +21,7 @@ "requirements": "This gem requires ROS2 to be installed and running and ROS 2 Gem", "documentation_url": "", "dependencies": [ - "ROS2" + "ROS2>=4.0.0" ], "repo_uri": "https://github.com/RobotecAI/robotec-o3de-tools", "compatible_engines": [],