Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksander Kamiński <[email protected]>
  • Loading branch information
alek-kam-robotec-ai committed Aug 26, 2024
1 parent 929629f commit 4911c8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
9 changes: 0 additions & 9 deletions Gems/ROS2/Code/Include/ROS2/Lidar/RaycastResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ namespace ROS2
RaycastResults(RaycastResults&& other);

[[nodiscard]] bool IsEmpty() const;
template<RaycastResultFlags F>
[[nodiscard]] bool IsFlagSatisfied(RaycastResultFlags requestedFlags) const;
[[nodiscard]] bool SatisfiesResultFlags(RaycastResultFlags flags) const;

template<RaycastResultFlags F>
[[nodiscard]] bool IsFieldPresent() const;
Expand Down Expand Up @@ -109,12 +106,6 @@ namespace ROS2
FieldInternal<RaycastResultFlags::Intensity> m_intensities;
};

template<RaycastResultFlags F>
bool RaycastResults::IsFlagSatisfied(RaycastResultFlags requestedFlags) const
{
return !IsFlagEnabled(F, requestedFlags) || IsFieldPresent<F>();
}

template<RaycastResultFlags F>
bool RaycastResults::IsFieldPresent() const
{
Expand Down
2 changes: 1 addition & 1 deletion Gems/ROS2/Code/Source/Lidar/LidarCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace ROS2
AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, m_entityId);
const auto entityTransform = entity->FindComponent<AzFramework::TransformComponent>();

AZ::Outcome<RaycastResults, const char*> results = AZ::Failure("EBus failure occured.");
AZ::Outcome<RaycastResults, const char*> results = AZ::Failure("EBus failure occurred.");
LidarRaycasterRequestBus::EventResult(
results, m_lidarRaycasterId, &LidarRaycasterRequestBus::Events::PerformRaycast, entityTransform->GetWorldTM());
if (!results.IsSuccess())
Expand Down
12 changes: 5 additions & 7 deletions Gems/ROS2/Code/Source/Lidar/RaycastResults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ namespace ROS2
}

RaycastResults::RaycastResults(RaycastResults&& other)
: m_count{ other.m_count }
, m_points{ AZStd::move(other.m_points) }
, m_ranges{ AZStd::move(other.m_ranges) }
, m_intensities{ AZStd::move(other.m_intensities) }
{
*this = other;
other.m_count = 0U;
}

void RaycastResults::Clear()
Expand Down Expand Up @@ -60,12 +64,6 @@ namespace ROS2
return GetCount() == 0U;
}

bool RaycastResults::SatisfiesResultFlags(RaycastResultFlags flags) const
{
return IsFlagSatisfied<RaycastResultFlags::Point>(flags) && IsFlagSatisfied<RaycastResultFlags::Range>(flags) &&
IsFlagSatisfied<RaycastResultFlags::Intensity>(flags);
}

size_t RaycastResults::GetCount() const
{
return m_count;
Expand Down

0 comments on commit 4911c8a

Please sign in to comment.