diff --git a/include/core/common/factory.h b/include/core/common/factory.h index 8152d007c9e8113580ae37e7b33debbf5b30127d..4a760ddc025c4ee68c48d7da03c50efae4a58ccd 100644 --- a/include/core/common/factory.h +++ b/include/core/common/factory.h @@ -314,26 +314,6 @@ namespace wolf // Some specializations //====================== -// Intrinsics -struct IntrinsicsBase; -typedef Factory<IntrinsicsBase, - const std::string&> IntrinsicsFactory; -template<> -inline std::string IntrinsicsFactory::getClass() -{ - return "IntrinsicsFactory"; -} - -// ProcessorParams -struct ProcessorParamsBase; -typedef Factory<ProcessorParamsBase, - const std::string&> ProcessorParamsFactory; -template<> -inline std::string ProcessorParamsFactory::getClass() -{ - return "ProcessorParamsFactory"; -} - // Landmarks from YAML class LandmarkBase; typedef Factory<LandmarkBase, @@ -344,20 +324,6 @@ inline std::string LandmarkFactory::getClass() return "LandmarkFactory"; } -// Frames -class TimeStamp; -} // namespace wolf -#include "core/frame/frame_base.h" -namespace wolf{ -typedef Factory<FrameBase, const FrameType&, const TimeStamp&, const Eigen::VectorXs&> FrameFactory; -template<> -inline std::string FrameFactory::getClass() -{ - return "FrameFactory"; -} - -//#define UNUSED(x) (void)x; -//#define UNUSED(x) (void)(sizeof((x), 0)); #ifdef __GNUC__ #define WOLF_UNUSED __attribute__((used)) @@ -372,10 +338,6 @@ inline std::string FrameFactory::getClass() # define UNUSED(x) x #endif -#define WOLF_REGISTER_FRAME(FrameType, FrameName) \ - namespace{ const bool WOLF_UNUSED FrameName##Registered = \ - wolf::FrameFactory::get().registerCreator(FrameType, FrameName::create); }\ - } /* namespace wolf */ #endif /* FACTORY_H_ */ diff --git a/include/core/processor/processor_factory.h b/include/core/processor/processor_factory.h index c5068dc0e17833b372c38b37b9dd35bafb4671ad..1f1d8606c449f9b57625bac9c12f8f9207322d0b 100644 --- a/include/core/processor/processor_factory.h +++ b/include/core/processor/processor_factory.h @@ -165,6 +165,17 @@ namespace wolf * You can also check the code in the example file ````src/examples/test_wolf_factories.cpp````. */ +// ProcessorParams factory +struct ProcessorParamsBase; +typedef Factory<ProcessorParamsBase, + const std::string&> ProcessorParamsFactory; +template<> +inline std::string ProcessorParamsFactory::getClass() +{ + return "ProcessorParamsFactory"; +} + +// Processor factory typedef Factory<ProcessorBase, const std::string&, const ProcessorParamsBasePtr> ProcessorFactory; diff --git a/include/core/sensor/sensor_factory.h b/include/core/sensor/sensor_factory.h index 1cd72622721bf8584d61d9140f037c31383b0749..3c74b0fd7ad1d32d5b3d8dc8cf867699ea832f80 100644 --- a/include/core/sensor/sensor_factory.h +++ b/include/core/sensor/sensor_factory.h @@ -16,6 +16,7 @@ struct IntrinsicsBase; // wolf #include "core/common/factory.h" +#include "core/utils/params_server.hpp" namespace wolf { @@ -208,6 +209,17 @@ namespace wolf * You can also check the code in the example file ````src/examples/test_wolf_factories.cpp````. */ +// Intrinsics factory +struct IntrinsicsBase; +typedef Factory<IntrinsicsBase, + const std::string&> IntrinsicsFactory; +template<> +inline std::string IntrinsicsFactory::getClass() +{ + return "IntrinsicsFactory"; +} + +// Sensor factory typedef Factory<SensorBase, const std::string&, const Eigen::VectorXs&, const IntrinsicsBasePtr> SensorFactory; diff --git a/src/landmark/landmark_base.cpp b/src/landmark/landmark_base.cpp index 83712a918793e83945ae9909000a9748b9b1b28e..5f245efc3e416c82d796f8fcd45a84a3d5444773 100644 --- a/src/landmark/landmark_base.cpp +++ b/src/landmark/landmark_base.cpp @@ -3,6 +3,7 @@ #include "core/factor/factor_base.h" #include "core/map/map_base.h" #include "core/state_block/state_block.h" +#include "core/state_block/state_angle.h" #include "core/state_block/state_quaternion.h" #include "core/common/factory.h" #include "core/yaml/yaml_conversion.h" @@ -217,7 +218,7 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node) if (ori.size() == 4) ori_sb = std::make_shared<StateQuaternion>(ori, ori_fixed); else - ori_sb = std::make_shared<StateBlock>(ori, ori_fixed); + ori_sb = std::make_shared<StateAngle>(ori(0), ori_fixed); } LandmarkBasePtr lmk = std::make_shared<LandmarkBase>("BASE", pos_sb, ori_sb); @@ -229,7 +230,7 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node) // Register landmark creator namespace { -const bool WOLF_UNUSED registered_lmk_ahp = LandmarkFactory::get().registerCreator("BASE", LandmarkBase::create); +const bool WOLF_UNUSED registered_lmk_base = LandmarkFactory::get().registerCreator("BASE", LandmarkBase::create); } } // namespace wolf