Skip to content
Snippets Groups Projects
Commit 7186f758 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Improve creator macros and constructor API

parent 7313164c
No related branches found
No related tags found
1 merge request!313WIP: Resolve "Processor constructors and creators requiring a sensor pointer?"
...@@ -22,15 +22,13 @@ namespace wolf { ...@@ -22,15 +22,13 @@ namespace wolf {
/* /*
* Macro for defining Autoconf processor creator. * Macro for defining Autoconf processor creator.
* *
* Place a call to this macro inside your class declaration (in the processor_class.h file),
* preferably just after the constructors.
*
* In order to use this macro, the derived processor class, ProcessorClass, * In order to use this macro, the derived processor class, ProcessorClass,
* must have a constructor available with one of the following APIs: * must have a constructor available with the API:
* *
* ProcessorClass(const SensorClassPtr _sensor, const ProcessorParamsClassPtr _params); * ProcessorClass(const SensorClassPtr _sensor, const ProcessorParamsClassPtr _params);
* ProcessorClass(const SensorClassPtr _sensor, const ProcessorParamsBasePtr _params);
* ProcessorClass(const SensorBasePtr _sensor, const ProcessorParamsClassPtr _params);
* ProcessorClass(const SensorBasePtr _sensor, const ProcessorParamsBasePtr _params);
*
* We recommend writing one of such constructors in your derived processors.
*/ */
#define WOLF_CREATE_PROCESSOR_AUTO(ProcessorClass, ProcessorParamsClass, SensorClass) \ #define WOLF_CREATE_PROCESSOR_AUTO(ProcessorClass, ProcessorParamsClass, SensorClass) \
static ProcessorBasePtr createAutoConf(const std::string& _unique_name, \ static ProcessorBasePtr createAutoConf(const std::string& _unique_name, \
......
...@@ -22,11 +22,13 @@ namespace wolf { ...@@ -22,11 +22,13 @@ namespace wolf {
/* /*
* Macro for defining Autoconf sensor creator. * Macro for defining Autoconf sensor creator.
* *
* Place a call to this macro inside your class declaration (in the sensor_class.h file),
* preferably just after the constructors.
*
* In order to use this macro, the derived sensor class, SensorClass, * In order to use this macro, the derived sensor class, SensorClass,
* must have a constructor available with one of the following APIs: * must have a constructor available with the API:
* *
* SensorClass(const VectorXs & _extrinsics, const IntrinsicsClassPtr _intrinsics); * SensorClass(const VectorXs & _extrinsics, const IntrinsicsClassPtr _intrinsics);
* SensorClass(const VectorXs & _extrinsics, const IntrinsicsBasePtr _intrinsics);
* *
* We recommend writing one of such constructors in your derived sensors. * We recommend writing one of such constructors in your derived sensors.
*/ */
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace wolf namespace wolf
{ {
ProcessorDiffDrive::ProcessorDiffDrive(ProcessorParamsDiffDrivePtr _params) : ProcessorDiffDrive::ProcessorDiffDrive(const ProcessorParamsDiffDrivePtr _params) :
ProcessorOdom2D(_params), ProcessorOdom2D(_params),
params_prc_diff_drv_selfcal_(_params), params_prc_diff_drv_selfcal_(_params),
radians_per_tick_(0.0) // This params needs further initialization. See this->configure(sensor). radians_per_tick_(0.0) // This params needs further initialization. See this->configure(sensor).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment