瀏覽代碼

Code Cleanup Pass 1 (#22)

- Add copyright headers to nav stack python files
- Delete the DELETE_ME* files
- Remove template comment instructions
- Renamed all instances of ROS2_Gem_Demo to RobotVacuumSample
- Renamed PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED to PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED
- Updated trait to match platform support of the ROS2 Gem
- Update comments and strings

Signed-off-by: Steve Pham <[email protected]>
Steve Pham 2 年之前
父節點
當前提交
af8ad03d88

+ 5 - 4
Gem/CMakeLists.txt

@@ -10,12 +10,12 @@ set(gem_path ${CMAKE_CURRENT_LIST_DIR})
 set(gem_json ${gem_path}/gem.json)
 o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path)
 
-# Currently we are in the ROS2-Gem-Demo/Code folder: ${CMAKE_CURRENT_LIST_DIR}
+# Currently we are in the ROS2-Gem-Demo/Gem folder: ${CMAKE_CURRENT_LIST_DIR}
 # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}
 # Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform
 #       in which case it will see if that platform is present here or in the restricted folder.
-#       i.e. It could here : ROS2-Gem-Demo/Code/Platform/<platform_name>  or
-#            <restricted_folder>/<platform_name>/ROS2-Gem-Demo/Code
+#       i.e. It could here : ROS2-Gem-Demo/Gem/Platform/<platform_name>  or
+#            <restricted_folder>/<platform_name>/ROS2-Gem-Demo/Gem
 o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
 
 # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the
@@ -25,7 +25,8 @@ include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
 
 # Now that we have loaded our project traits for this platform, see if this project is even supported on this platform.
 # If its not supported we just return after including the unsupported.
-if(NOT PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED)
+if(NOT PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED)
+    message(FATAL_ERROR "The Robot Vacuum Sample application is not supported on this platform")
     return()
 endif()
 

+ 8 - 9
Gem/Include/ROS2-Gem-Demo/ROS2-Gem-DemoBus.h

@@ -10,17 +10,16 @@
 #include <AzCore/EBus/EBus.h>
 #include <AzCore/Interface/Interface.h>
 
-namespace ROS2_Gem_Demo
+namespace RobotVacuumSample
 {
-    class ROS2_Gem_DemoRequests
+    class RobotVacuumSampleRequests
     {
     public:
-        AZ_RTTI(ROS2_Gem_DemoRequests, "{16673c77-215c-41c6-8bbf-6cd2412568e9}");
-        virtual ~ROS2_Gem_DemoRequests() = default;
-        // Put your public methods here
+        AZ_RTTI(RobotVacuumSampleRequests, "{16673c77-215c-41c6-8bbf-6cd2412568e9}");
+        virtual ~RobotVacuumSampleRequests() = default;
     };
 
-    class ROS2_Gem_DemoBusTraits
+    class RobotVacuumSampleBusTraits
         : public AZ::EBusTraits
     {
     public:
@@ -31,7 +30,7 @@ namespace ROS2_Gem_Demo
         //////////////////////////////////////////////////////////////////////////
     };
 
-    using ROS2_Gem_DemoRequestBus = AZ::EBus<ROS2_Gem_DemoRequests, ROS2_Gem_DemoBusTraits>;
-    using ROS2_Gem_DemoInterface = AZ::Interface<ROS2_Gem_DemoRequests>;
+    using RobotVacuumSampleRequestBus = AZ::EBus<RobotVacuumSampleRequests, RobotVacuumSampleBusTraits>;
+    using RobotVacuumSampleInterface = AZ::Interface<RobotVacuumSampleRequests>;
 
-} // namespace ROS2_Gem_Demo
+} // namespace RobotVacuumSample

+ 1 - 1
Gem/Platform/Android/PAL_android.cmake

@@ -6,4 +6,4 @@
 #
 #
 
-set(PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED TRUE)
+set(PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED FALSE)

+ 1 - 1
Gem/Platform/Linux/PAL_linux.cmake

@@ -6,4 +6,4 @@
 #
 #
 
-set(PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED TRUE)
+set(PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED TRUE)

+ 1 - 1
Gem/Platform/Mac/PAL_mac.cmake

@@ -6,4 +6,4 @@
 #
 #
 
-set(PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED TRUE)
+set(PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED FALSE)

+ 1 - 1
Gem/Platform/Windows/PAL_windows.cmake

@@ -6,4 +6,4 @@
 #
 #
 
-set(PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED TRUE)
+set(PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED FALSE)

+ 1 - 1
Gem/Platform/iOS/PAL_ios.cmake

@@ -6,4 +6,4 @@
 #
 #
 
-set(PAL_TRAIT_ROS2-GEM-DEMO_SUPPORTED TRUE)
+set(PAL_TRAIT_ROBOT_VACUUM_SAMPLE_SUPPORTED FALSE)

+ 10 - 10
Gem/Source/ROS2-Gem-DemoModule.cpp

@@ -11,21 +11,21 @@
 
 #include "ROS2-Gem-DemoSystemComponent.h"
 
-namespace ROS2_Gem_Demo
+namespace RobotVacuumSample
 {
-    class ROS2_Gem_DemoModule
+    class RobotVacuumSampleModule
         : public AZ::Module
     {
     public:
-        AZ_RTTI(ROS2_Gem_DemoModule, "{0ea31247-8ee5-491d-93cb-296a6c91c995}", AZ::Module);
-        AZ_CLASS_ALLOCATOR(ROS2_Gem_DemoModule, AZ::SystemAllocator, 0);
+        AZ_RTTI(RobotVacuumSampleModule, "{0ea31247-8ee5-491d-93cb-296a6c91c995}", AZ::Module);
+        AZ_CLASS_ALLOCATOR(RobotVacuumSampleModule, AZ::SystemAllocator, 0);
 
-        ROS2_Gem_DemoModule()
+        RobotVacuumSampleModule()
             : AZ::Module()
         {
-            // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
+            // Push results of RobotVacuumSampleSystemComponent::CreateDescriptor() into m_descriptors here.
             m_descriptors.insert(m_descriptors.end(), {
-                ROS2_Gem_DemoSystemComponent::CreateDescriptor(),
+                RobotVacuumSampleSystemComponent::CreateDescriptor(),
             });
         }
 
@@ -35,10 +35,10 @@ namespace ROS2_Gem_Demo
         AZ::ComponentTypeList GetRequiredSystemComponents() const override
         {
             return AZ::ComponentTypeList{
-                azrtti_typeid<ROS2_Gem_DemoSystemComponent>(),
+                azrtti_typeid<RobotVacuumSampleSystemComponent>(),
             };
         }
     };
-}// namespace ROS2_Gem_Demo
+}// namespace RobotVacuumSample
 
-AZ_DECLARE_MODULE_CLASS(Gem_ROS2_Gem_Demo, ROS2_Gem_Demo::ROS2_Gem_DemoModule)
+AZ_DECLARE_MODULE_CLASS(Gem_RobotVacuumSample, RobotVacuumSample::RobotVacuumSampleModule)

+ 21 - 21
Gem/Source/ROS2-Gem-DemoSystemComponent.cpp

@@ -12,19 +12,19 @@
 
 #include "ROS2-Gem-DemoSystemComponent.h"
 
-namespace ROS2_Gem_Demo
+namespace RobotVacuumSample
 {
-    void ROS2_Gem_DemoSystemComponent::Reflect(AZ::ReflectContext* context)
+    void RobotVacuumSampleSystemComponent::Reflect(AZ::ReflectContext* context)
     {
         if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
         {
-            serialize->Class<ROS2_Gem_DemoSystemComponent, AZ::Component>()
+            serialize->Class<RobotVacuumSampleSystemComponent, AZ::Component>()
                 ->Version(0)
                 ;
 
             if (AZ::EditContext* ec = serialize->GetEditContext())
             {
-                ec->Class<ROS2_Gem_DemoSystemComponent>("ROS2_Gem_Demo", "[Description of functionality provided by this System Component]")
+                ec->Class<RobotVacuumSampleSystemComponent>("RobotVacuumSample", "The base Robot Vacuum Sample component.")
                     ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
                         ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System"))
                         ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
@@ -33,51 +33,51 @@ namespace ROS2_Gem_Demo
         }
     }
 
-    void ROS2_Gem_DemoSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
+    void RobotVacuumSampleSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
     {
-        provided.push_back(AZ_CRC("ROS2_Gem_DemoService"));
+        provided.push_back(AZ_CRC("RobotVacuumSampleService"));
     }
 
-    void ROS2_Gem_DemoSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
+    void RobotVacuumSampleSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
     {
-        incompatible.push_back(AZ_CRC("ROS2_Gem_DemoService"));
+        incompatible.push_back(AZ_CRC("RobotVacuumSampleService"));
     }
 
-    void ROS2_Gem_DemoSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
+    void RobotVacuumSampleSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
     {
     }
 
-    void ROS2_Gem_DemoSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
+    void RobotVacuumSampleSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
     {
     }
 
-    ROS2_Gem_DemoSystemComponent::ROS2_Gem_DemoSystemComponent()
+    RobotVacuumSampleSystemComponent::RobotVacuumSampleSystemComponent()
     {
-        if (ROS2_Gem_DemoInterface::Get() == nullptr)
+        if (RobotVacuumSampleInterface::Get() == nullptr)
         {
-            ROS2_Gem_DemoInterface::Register(this);
+            RobotVacuumSampleInterface::Register(this);
         }
     }
 
-    ROS2_Gem_DemoSystemComponent::~ROS2_Gem_DemoSystemComponent()
+    RobotVacuumSampleSystemComponent::~RobotVacuumSampleSystemComponent()
     {
-        if (ROS2_Gem_DemoInterface::Get() == this)
+        if (RobotVacuumSampleInterface::Get() == this)
         {
-            ROS2_Gem_DemoInterface::Unregister(this);
+            RobotVacuumSampleInterface::Unregister(this);
         }
     }
 
-    void ROS2_Gem_DemoSystemComponent::Init()
+    void RobotVacuumSampleSystemComponent::Init()
     {
     }
 
-    void ROS2_Gem_DemoSystemComponent::Activate()
+    void RobotVacuumSampleSystemComponent::Activate()
     {
-        ROS2_Gem_DemoRequestBus::Handler::BusConnect();
+        RobotVacuumSampleRequestBus::Handler::BusConnect();
     }
 
-    void ROS2_Gem_DemoSystemComponent::Deactivate()
+    void RobotVacuumSampleSystemComponent::Deactivate()
     {
-        ROS2_Gem_DemoRequestBus::Handler::BusDisconnect();
+        RobotVacuumSampleRequestBus::Handler::BusDisconnect();
     }
 }

+ 7 - 7
Gem/Source/ROS2-Gem-DemoSystemComponent.h

@@ -12,14 +12,14 @@
 
 #include <ROS2-Gem-Demo/ROS2-Gem-DemoBus.h>
 
-namespace ROS2_Gem_Demo
+namespace RobotVacuumSample
 {
-    class ROS2_Gem_DemoSystemComponent
+    class RobotVacuumSampleSystemComponent
         : public AZ::Component
-        , protected ROS2_Gem_DemoRequestBus::Handler
+        , protected RobotVacuumSampleRequestBus::Handler
     {
     public:
-        AZ_COMPONENT(ROS2_Gem_DemoSystemComponent, "{c5c1e616-e0bd-4b49-afd0-053756e0f455}");
+        AZ_COMPONENT(RobotVacuumSampleSystemComponent, "{c5c1e616-e0bd-4b49-afd0-053756e0f455}");
 
         static void Reflect(AZ::ReflectContext* context);
 
@@ -28,12 +28,12 @@ namespace ROS2_Gem_Demo
         static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
         static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
 
-        ROS2_Gem_DemoSystemComponent();
-        ~ROS2_Gem_DemoSystemComponent();
+        RobotVacuumSampleSystemComponent();
+        ~RobotVacuumSampleSystemComponent();
 
     protected:
         ////////////////////////////////////////////////////////////////////////
-        // ROS2_Gem_DemoRequestBus interface implementation
+        // RobotVacuumSampleRequestBus interface implementation
 
         ////////////////////////////////////////////////////////////////////////
 

+ 0 - 3
Levels/Loft/DeleteMe_GI_TEST.fbx

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7173d8133329041c5ad7857adc55cc6e389d525028c973c61d9544675725b335
-size 36316

+ 0 - 25
Levels/Loft/DeleteMe_GI_TEST_testMAT.material

@@ -1,25 +0,0 @@
-{
-    "materialType": "Materials/Types/StandardPBR.materialtype",
-    "materialTypeVersion": 4,
-    "propertyValues": {
-        "baseColor.color": [
-            0.8000000715255737,
-            0.0,
-            0.009302900172770023,
-            1.0
-        ],
-        "emissive.color": [
-            0.0,
-            0.0,
-            0.0,
-            1.0
-        ],
-        "irradiance.color": [
-            1.0,
-            0.0,
-            0.0,
-            1.0
-        ],
-        "opacity.factor": 1.0
-    }
-}

+ 6 - 0
launch/navigation.launch.py

@@ -1,3 +1,9 @@
+"""
+Copyright (c) Contributors to the Open 3D Engine Project.
+For complete copyright and license terms please see the LICENSE at the root of this distribution.
+
+SPDX-License-Identifier: Apache-2.0 OR MIT
+"""
 import pathlib
 
 from ament_index_python.packages import get_package_share_directory

+ 6 - 0
launch/slam.launch.py

@@ -1,3 +1,9 @@
+"""
+Copyright (c) Contributors to the Open 3D Engine Project.
+For complete copyright and license terms please see the LICENSE at the root of this distribution.
+
+SPDX-License-Identifier: Apache-2.0 OR MIT
+"""
 import pathlib
 
 from ament_index_python.packages import get_package_share_directory