From 4e186b875aee2f48ce846827a6f908f93d5f20b1 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 8 Dec 2023 17:51:22 +0100 Subject: [PATCH] Add GetPerceivedObjects --- Perception.cpp | 2 ++ Perception.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Perception.cpp b/Perception.cpp index c5d225d..4cd4a8a 100644 --- a/Perception.cpp +++ b/Perception.cpp @@ -201,6 +201,8 @@ unsigned char Perception::PerceivedObjectCount() { return objectCount; } +PerceivedObject **Perception::GetPerceivedObjects() { return perceivedObjects; } + void Perception::Update(float currentTimeMs) { float deltaTime = currentTimeMs - lastUpdateTimeMs; if (deltaTime <= 0) diff --git a/Perception.h b/Perception.h index 115bf92..d66aa4c 100644 --- a/Perception.h +++ b/Perception.h @@ -16,7 +16,7 @@ public: static constexpr float equalityAngle = 5.0F; bool IsTheSameAs(PerceivedObject *otherObj); - int id; + char id; Polar position; float radius; @@ -96,6 +96,7 @@ public: void AddPerceivedObject(PerceivedObject *obj); unsigned char PerceivedObjectCount(); + PerceivedObject **GetPerceivedObjects(); // mainly used for confidence update void Update(float currentTimeMs);