diff --git a/Perception.cpp b/Perception.cpp index 530937b..67b3a30 100644 --- a/Perception.cpp +++ b/Perception.cpp @@ -6,7 +6,7 @@ Perception::Perception() {} Perception::Perception(Placement* sensors, unsigned int sensorCount) { this->sensorCount = sensorCount; - this->sensorPlacements = sensors; + this->sensorPlacements = (Placement*)sensors; } void Perception::AddSensors(Placement* things, unsigned int thingCount) { diff --git a/Perception.h b/Perception.h index 4f848b3..cf5b7b8 100644 --- a/Perception.h +++ b/Perception.h @@ -10,9 +10,16 @@ class Perception { public: /// @brief Setup perception Perception(); + + /// @brief Template to make it possible to leave out ths sensorCount + /// @tparam sensorCount + /// @param sensors An array of sensor placements + template + inline Perception(Placement (&sensors)[sensorCount]) { + Perception(sensors, sensorCount); + } Perception(Placement* sensors, unsigned int sensorCount); - // void AddSensors(SensorPlacement* sensors, unsigned int sensorCount); void AddSensors(Placement* sensors, unsigned int sensorCount); unsigned int GetSensorCount();