-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
252 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (c) Meta Platforms, Inc. and its affiliates. | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
#ifndef ESP_SENSOR_MANAGEDCAMERASENSOR_H_ | ||
#define ESP_SENSOR_MANAGEDCAMERASENSOR_H_ | ||
|
||
#include "ManagedVisualSensorBase.h" | ||
#include "esp/sensor/CameraSensor.h" | ||
|
||
namespace esp { | ||
namespace sensor { | ||
|
||
/** | ||
* @brief Class for wrapper for camera sensor objects | ||
*/ | ||
class ManagedCameraSensor : public AbstractManagedVisualSensor<CameraSensor> { | ||
public: | ||
explicit ManagedCameraSensor( | ||
const std::string& classKey = "ManagedCameraSensor") | ||
: AbstractManagedVisualSensor<CameraSensor>::AbstractManagedVisualSensor( | ||
classKey) {} | ||
|
||
// TODO Add appropriate camera sensor getters/setters here | ||
|
||
protected: | ||
/** | ||
* @brief Retrieve a comma-separated string holding the header values for | ||
* the info returned for this managed visual sensor, type-specific. | ||
*/ | ||
std::string getVisualSensorObjInfoHeaderInternal() const override { | ||
return ""; | ||
} | ||
|
||
/** | ||
* @brief Specialization-specific extension of getObjectInfo, comma | ||
* separated info ideal for saving to csv | ||
*/ | ||
|
||
std::string getVisualSensorObjInfoInternal( | ||
CORRADE_UNUSED std::shared_ptr<esp::sensor::CameraSensor>& sp) | ||
const override { | ||
// TODO provide info stream for sensors | ||
return ""; | ||
} | ||
|
||
public: | ||
ESP_SMART_POINTERS(ManagedCameraSensor) | ||
}; // class ManagedCameraSensor | ||
|
||
} // namespace sensor | ||
} // namespace esp | ||
|
||
#endif // ESP_SENSOR_MANAGEDCAMERASENSOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (c) Meta Platforms, Inc. and its affiliates. | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
#ifndef ESP_SENSOR_MANAGEDCUBEMAPSENSORBASE_H_ | ||
#define ESP_SENSOR_MANAGEDCUBEMAPSENSORBASE_H_ | ||
|
||
#include "ManagedVisualSensorBase.h" | ||
#include "esp/sensor/CubeMapSensorBase.h" | ||
|
||
namespace esp { | ||
namespace sensor { | ||
|
||
/** | ||
* @brief Class Template for wrapper for CubeMap sensor objects | ||
*/ | ||
template <class T> | ||
class AbstractManagedCubeMapSensorBase | ||
: public esp::sensor::AbstractManagedVisualSensor<T> { | ||
public: | ||
static_assert( | ||
std::is_base_of<esp::sensor::CubeMapSensorBase, T>::value, | ||
"AbstractManagedCubeMapSensorBase :: Managed CubeMap sensor object " | ||
"type must be derived from esp::sensor::CubeMapSensorBase"); | ||
|
||
explicit AbstractManagedCubeMapSensorBase(const std::string& classKey) | ||
: AbstractManagedVisualSensor<T>(classKey) {} | ||
|
||
// TODO Add appropriate camera sensor getters/setters here | ||
|
||
protected: | ||
/** | ||
* @brief Retrieve a comma-separated string holding the header values for | ||
* the info returned for this managed visual sensor, type-specific. | ||
*/ | ||
std::string getVisualSensorObjInfoHeaderInternal() const override { | ||
return "" + getCubeMapSensorObjInfoHeaderInternal(); | ||
} | ||
|
||
/** | ||
* @brief Retrieve a comma-separated string holding the header values for | ||
* the info returned for this managed visual sensor, type-specific. | ||
*/ | ||
|
||
virtual std::string getCubeMapSensorObjInfoHeaderInternal() const = 0; | ||
/** | ||
* @brief Specialization-specific extension of getObjectInfo, comma | ||
* separated info ideal for saving to csv | ||
*/ | ||
|
||
std::string getVisualSensorObjInfoInternal( | ||
CORRADE_UNUSED std::shared_ptr<T>& sp) const override { | ||
// TODO provide info stream for sensors | ||
std::string res = | ||
Cr::Utility::formatString("{},", getCubeMapSensorObjInfoInternal()); | ||
|
||
return res; | ||
} | ||
|
||
/** | ||
* @brief Specialization-specific extension of getSensorObjInfoInternal, comma | ||
* separated info ideal for saving to csv | ||
*/ | ||
virtual std::string getCubeMapSensorObjInfoInternal( | ||
std::shared_ptr<T>& sp) const = 0; | ||
|
||
public: | ||
ESP_SMART_POINTERS(AbstractManagedCubeMapSensorBase<T>) | ||
}; // class ManagedCubeMapSensorBase | ||
|
||
} // namespace sensor | ||
} // namespace esp | ||
|
||
#endif // ESP_SENSOR_MANAGEDCUBEMAPSENSORBASE_H_ |
58 changes: 58 additions & 0 deletions
58
src/esp/sensor/sensorWrappers/ManagedEquirectangularSensor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) Meta Platforms, Inc. and its affiliates. | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
#ifndef ESP_SENSOR_MANAGEDEQUIRECTANGULARSENSOR_H_ | ||
#define ESP_SENSOR_MANAGEDEQUIRECTANGULARSENSOR_H_ | ||
|
||
#include "ManagedCubeMapSensorBase.h" | ||
#include "esp/sensor/EquirectangularSensor.h" | ||
|
||
namespace esp { | ||
namespace sensor { | ||
|
||
/** | ||
* @brief Class for wrapper for sensor objects of all kinds to | ||
* enable Managed Container access. | ||
*/ | ||
class ManagedEquirectangularSensor | ||
: public AbstractManagedCubeMapSensorBase<EquirectangularSensor> { | ||
public: | ||
explicit ManagedEquirectangularSensor( | ||
const std::string& classKey = "ManagedEquirectangularSensor") | ||
: AbstractManagedCubeMapSensorBase< | ||
EquirectangularSensor>::AbstractManagedCubeMapSensorBase(classKey) { | ||
} | ||
|
||
// TODO Add appropriate equirectangular sensor getters/setters here | ||
|
||
protected: | ||
/** | ||
* @brief Retrieve a comma-separated string holding the header values for | ||
* the info returned for this managed Equirectangular CubeMap sensor, | ||
* type-specific. | ||
*/ | ||
std::string getCubeMapSensorObjInfoHeaderInternal() const override { | ||
return ""; | ||
} | ||
|
||
/** | ||
* @brief Specialization-specific extension of getObjectInfo, comma | ||
* separated info ideal for saving to csv | ||
*/ | ||
|
||
std::string getCubeMapSensorObjInfoInternal( | ||
CORRADE_UNUSED std::shared_ptr<EquirectangularSensor>& sp) | ||
const override { | ||
// TODO provide info stream for sensors | ||
return ""; | ||
} | ||
|
||
public: | ||
ESP_SMART_POINTERS(ManagedEquirectangularSensor) | ||
}; // namespace sensor | ||
|
||
} // namespace sensor | ||
} // namespace esp | ||
|
||
#endif // ESP_SENSOR_MANAGEDEQUIRECTANGULARSENSOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) Meta Platforms, Inc. and its affiliates. | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
#ifndef ESP_SENSOR_MANAGEDFISHEYESENSOR_H_ | ||
#define ESP_SENSOR_MANAGEDFISHEYESENSOR_H_ | ||
|
||
#include "ManagedCubeMapSensorBase.h" | ||
#include "esp/sensor/FisheyeSensor.h" | ||
|
||
namespace esp { | ||
namespace sensor { | ||
|
||
/** | ||
* @brief Class for wrapper for sensor objects of all kinds to | ||
* enable Managed Container access. | ||
*/ | ||
class ManagedFisheyeSensor | ||
: public AbstractManagedCubeMapSensorBase<FisheyeSensor> { | ||
public: | ||
explicit ManagedFisheyeSensor( | ||
const std::string& classKey = "ManagedFisheyeSensor") | ||
: AbstractManagedCubeMapSensorBase< | ||
FisheyeSensor>::AbstractManagedCubeMapSensorBase(classKey) {} | ||
|
||
// TODO Add appropriate fisheye sensor getters/setters here | ||
|
||
protected: | ||
/** | ||
* @brief Retrieve a comma-separated string holding the header values for | ||
* the info returned for this managed visual sensor, type-specific. | ||
*/ | ||
std::string getCubeMapSensorObjInfoHeaderInternal() const override { | ||
return ""; | ||
} | ||
|
||
/** | ||
* @brief Specialization-specific extension of getObjectInfo, comma | ||
* separated info ideal for saving to csv | ||
*/ | ||
|
||
std::string getCubeMapSensorObjInfoInternal( | ||
CORRADE_UNUSED std::shared_ptr<FisheyeSensor>& sp) const override { | ||
// TODO provide info stream for sensors | ||
return ""; | ||
} | ||
|
||
public: | ||
ESP_SMART_POINTERS(ManagedFisheyeSensor) | ||
}; // namespace sensor | ||
|
||
} // namespace sensor | ||
} // namespace esp | ||
|
||
#endif // ESP_SENSOR_MANAGEDFISHEYESENSOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters