Browse Source

review fixes

Signed-off-by: Adam Dabrowski <[email protected]>
Adam Dabrowski 2 years ago
parent
commit
6ab21fd243

+ 4 - 4
Project/Gem/Source/ApplePicker/GatheringRowComponent.cpp

@@ -81,13 +81,13 @@ namespace AppleKraken
         AZ::TransformBus::EventResult(endPose, m_end, &AZ::TransformBus::Events::GetWorldTM);
 
         // Simplification - we assume same orientations along the way
-        auto rowVector = endPose.GetTranslation() - startPose.GetTranslation();
+        const auto rowVector = endPose.GetTranslation() - startPose.GetTranslation();
         for (int i = 0; i < m_appleTreeCount; ++i)
         {
             AZ::Transform gatheringPoint = startPose;
-            float scale = i / (m_appleTreeCount - 1);
-            gatheringPoint.SetTranslation(gatheringPoint.GetTranslation() + rowVector * scale);
-            m_gatheringPoses.push_back(gatheringPoint);
+            const float scale = static_cast<float>(i) / (m_appleTreeCount - 1);
+            gatheringPoint.SetTranslation(gatheringPoint.GetTranslation() + m_poseOffset + rowVector * scale);
+            m_gatheringPoses.emplace_back(gatheringPoint);
         }
     }
 } // namespace AppleKraken

+ 1 - 1
Project/Gem/Source/ROSConDemoSystemComponent.h

@@ -43,7 +43,7 @@ namespace ROSConDemo
     private:
         void ProcessGetPlanServiceCall(const GetPlanRequestPtr req, GetPlanResponsePtr resp);
 
-        AZStd::string m_planTopic = "get_gathering_plan";
+        const AZStd::string m_planTopic = "get_gathering_plan";
         rclcpp::Service<nav_msgs::srv::GetPlan>::SharedPtr m_pathPlanService;
     };
 } // namespace ROSConDemo