Percpetion constructor without sensorCount

This commit is contained in:
Pascal Serrarens 2023-12-05 09:43:36 +01:00
parent 5e057710b4
commit 8e432e4ef9
2 changed files with 9 additions and 2 deletions

View File

@ -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) {

View File

@ -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 <size_t sensorCount>
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();