2
0
Эх сурвалжийг харах

Review comments

Signed-off-by: Michał Pełka <[email protected]>
Michał Pełka 3 сар өмнө
parent
commit
f0b2de705b
21 өөрчлөгдсөн 34 нэмэгдсэн , 46 устгасан
  1. 7 0
      Gems/ROS2/Code/CMakeLists.txt
  2. 3 0
      Gems/ROS2/Code/Include/ROS2/Clock/ROS2Clock.h
  3. 3 1
      Gems/ROS2/Code/Include/ROS2/Clock/ROS2TimeSource.h
  4. 3 0
      Gems/ROS2/Code/Include/ROS2/Clock/SimulationTimeSource.h
  5. 1 3
      Gems/ROS2/Code/Source/ContactSensor/ROS2ContactSensorComponent.cpp
  6. 0 3
      Gems/ROS2/Code/Source/ContactSensor/ROS2ContactSensorComponent.h
  7. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponent.cpp
  8. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponent.h
  9. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponentController.cpp
  10. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponentController.h
  11. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointEditorComponent.cpp
  12. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointEditorComponent.h
  13. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponent.cpp
  14. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponent.h
  15. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponentController.cpp
  16. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponentController.h
  17. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnerEditorComponent.cpp
  18. 1 3
      Gems/ROS2/Code/Source/Spawner/ROS2SpawnerEditorComponent.h
  19. 2 1
      Gems/SimulationInterfaces/Code/Include/SimulationInterfaces/SimulationFeaturesAggregatorRequestBus.h
  20. 2 1
      Gems/SimulationInterfaces/Code/Include/SimulationInterfaces/SimulationMangerRequestBus.h
  21. 1 1
      Gems/SimulationInterfaces/Code/Source/Clients/SimulationEntitiesManager.cpp

+ 7 - 0
Gems/ROS2/Code/CMakeLists.txt

@@ -49,6 +49,13 @@ find_package(gazebo_msgs QUIET)
 if (gazebo_msgs_FOUND)
     message(STATUS "Found gazebo_msgs package, enabling legacy features like ContactSensor Component and ROS2 Spawner Component")
     SET (WITH_GAZEBO_MSGS TRUE)
+    if(NOT (ROS_DISTRO STREQUAL "humble" OR ROS_DISTRO STREQUAL "jazzy"))
+        message(WARNING
+                "The support for deprecated gazebo_msgs package is not supported in ROS 2 Kilted or newer. "
+                "Please consider migration to Simulation Interfaces. "
+                "If you do not intend to use Gazebo messages, please make sure that this package is not sourced in your environment." )
+
+    endif()
 else()
     message(STATUS "Could not find gazebo_msgs package, disabling legacy features like ContactSensor Component and ROS2 Spawner Component")
     SET(WITH_GAZEBO_MSGS FALSE)

+ 3 - 0
Gems/ROS2/Code/Include/ROS2/Clock/ROS2Clock.h

@@ -34,6 +34,9 @@ namespace ROS2
 
         builtin_interfaces::msg::Time GetROSTimestamp() const;
 
+        //! Sets the time source to the given time.
+        //! @param time The time to set the time source to.
+        //! @return An outcome indicating success or failure.
         AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time & time) const;
 
         //! Update time in the ROS 2 ecosystem.

+ 3 - 1
Gems/ROS2/Code/Include/ROS2/Clock/ROS2TimeSource.h

@@ -26,7 +26,9 @@ namespace ROS2
         //! @see ROS2Requests::GetROSTimestamp() for more details.
         virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;
 
-
+        //! Sets the time source to the given time.
+        //! @param time The time to set the time source to.
+        //! @return An outcome indicating success or failure.
         virtual AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time& time) override;
 
     };

+ 3 - 0
Gems/ROS2/Code/Include/ROS2/Clock/SimulationTimeSource.h

@@ -30,6 +30,9 @@ namespace ROS2
         virtual void Activate() override;
         virtual void Deactivate() override;
 
+        //! Sets the time source to the given time.
+        //! @param time The time to set the time source to.
+        //! @return An outcome indicating success or failure.
         virtual AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time& time) override;
 
         //! Get ROS 2 time as ROS2 message.

+ 1 - 3
Gems/ROS2/Code/Source/ContactSensor/ROS2ContactSensorComponent.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2ContactSensorComponent.h"
 #include <AzFramework/Physics/Collision/CollisionEvents.h>
 #include <AzFramework/Physics/Common/PhysicsSimulatedBody.h>

+ 0 - 3
Gems/ROS2/Code/Source/ContactSensor/ROS2ContactSensorComponent.h

@@ -7,9 +7,6 @@
  */
 
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
 
 #include <AzCore/Component/EntityId.h>
 #include <AzCore/RTTI/ReflectContext.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponent.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2SpawnPointComponent.h"
 #include "Spawner/ROS2SpawnPointComponentController.h"
 #include <AzCore/Component/Entity.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponent.h

@@ -6,9 +6,7 @@
  *
  */
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "Spawner/ROS2SpawnPointComponentController.h"
 #include <AzCore/Component/Component.h>
 #include <AzCore/Math/Transform.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponentController.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "Spawner/ROS2SpawnPointComponentController.h"
 #include "Spawner/ROS2SpawnerComponentController.h"
 #include <AzCore/Component/TransformBus.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointComponentController.h

@@ -6,9 +6,7 @@
  *
  */
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include <AzCore/Component/Component.h>
 #include <AzCore/Component/ComponentBus.h>
 #include <AzCore/Math/Transform.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointEditorComponent.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2SpawnPointEditorComponent.h"
 #include "Spawner/ROS2SpawnPointComponentController.h"
 #include "Spawner/ROS2SpawnerEditorComponent.h"

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnPointEditorComponent.h

@@ -6,9 +6,7 @@
  *
  */
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "Spawner/ROS2SpawnPointComponent.h"
 #include "Spawner/ROS2SpawnPointComponentController.h"
 #include "Spawner/ROS2SpawnerEditorComponent.h"

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponent.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2SpawnerComponent.h"
 #include "Spawner/ROS2SpawnerComponentController.h"
 #include <AzCore/Component/EntityId.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponent.h

@@ -6,9 +6,7 @@
  *
  */
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2SpawnPointComponent.h"
 #include "Spawner/ROS2SpawnerComponentController.h"
 #include <AzCore/Asset/AssetCommon.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponentController.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2SpawnerComponentController.h"
 #include "Spawner/ROS2SpawnPointComponent.h"
 #include "Spawner/ROS2SpawnerComponent.h"

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponentController.h

@@ -7,9 +7,7 @@
  */
 
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2/Spawner/SpawnerBus.h"
 #include "ROS2SpawnPointComponent.h"
 #include <AzCore/Component/ComponentBus.h>

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnerEditorComponent.cpp

@@ -5,9 +5,7 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "ROS2SpawnerEditorComponent.h"
 #include "AzCore/Debug/Trace.h"
 #include "ROS2SpawnPointEditorComponent.h"

+ 1 - 3
Gems/ROS2/Code/Source/Spawner/ROS2SpawnerEditorComponent.h

@@ -6,9 +6,7 @@
  *
  */
 #pragma once
-#ifndef WITH_GAZEBO_MSGS
-static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
-#endif
+
 #include "Spawner/ROS2SpawnerComponent.h"
 #include "Spawner/ROS2SpawnerComponentController.h"
 #include <AzToolsFramework/ToolsComponents/EditorComponentAdapter.h>

+ 2 - 1
Gems/SimulationInterfaces/Code/Include/SimulationInterfaces/SimulationFeaturesAggregatorRequestBus.h

@@ -13,10 +13,11 @@
 #include <AzCore/EBus/EBus.h>
 #include <AzCore/Interface/Interface.h>
 #include <AzCore/std/containers/unordered_set.h>
+#include <simulation_interfaces/msg/simulator_features.hpp>
 
 namespace SimulationInterfaces
 {
-    using SimulationFeatureType = uint8_t;
+    using SimulationFeatureType = simulation_interfaces::msg::SimulatorFeatures::_features_type::value_type;
 
     class SimulationFeaturesAggregatorRequests
     {

+ 2 - 1
Gems/SimulationInterfaces/Code/Include/SimulationInterfaces/SimulationMangerRequestBus.h

@@ -15,10 +15,11 @@
 #include <AzCore/Interface/Interface.h>
 #include <AzCore/std/smart_ptr/shared_ptr.h>
 #include <AzFramework/Physics/ShapeConfiguration.h>
+#include <simulation_interfaces/msg/simulation_state.hpp>
 
 namespace SimulationInterfaces
 {
-    using SimulationState = uint8_t;
+    using SimulationState = simulation_interfaces::msg::SimulationState::_state_type;
 
     class SimulationManagerRequests
     {

+ 1 - 1
Gems/SimulationInterfaces/Code/Source/Clients/SimulationEntitiesManager.cpp

@@ -382,7 +382,7 @@ namespace SimulationInterfaces
         {
             const AZStd::vector<AZStd::string> prefilteredEntities = AZStd::move(entities);
             entities.clear();
-            const AZStd::regex regex(filter.m_nameFilter);
+            const AZStd::regex regex(filter.m_nameFilter, AZStd::regex::extended);
             if (!regex.Valid())
             {
                 AZ_Warning("SimulationInterfaces", false, "Invalid regex filter");