diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h index f52aa0dd87dc0b329585b64536207435ce9d0e91..991aecca35d5cb94ba2411adc4776efbd41ff84f 100644 --- a/include/core/processor/processor_base.h +++ b/include/core/processor/processor_base.h @@ -150,10 +150,10 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce * * \param _type TO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: type name * \param _dim_compatible TO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: - * Which dimension is the sensor compatible (2: 2D, 3: 3D, -1: both) + * Which dimension is the processor compatible (2: 2D, 3: 3D, 0: both) * \param _params params yaml node */ - ProcessorBase(const std::string& _type, int _dim_compatible, const YAML::Node& _params); + ProcessorBase(const std::string& _type, unsigned int _dim_compatible, const YAML::Node& _params); ~ProcessorBase() override; virtual void configure(SensorBasePtr _sensor) = 0; virtual void remove(); diff --git a/include/core/sensor/sensor_base.h b/include/core/sensor/sensor_base.h index 94c6ceef2db8a8e8f7e35d250244805ba8e3e71c..064c16aa209e223d8cd8184d1c9e6ab0ddbf5f5b 100644 --- a/include/core/sensor/sensor_base.h +++ b/include/core/sensor/sensor_base.h @@ -129,22 +129,18 @@ class SensorBase : public NodeStateBlocks std::map<char, Eigen::VectorXd> drifts_std_rate_; ///< std rate of the drift of dynamic state blocks [unit/sqrt(s)] YAML::Node params_; ///< Params yaml node - unsigned int dim_compatible_; ///< Dimension compatibility of the sensor: 2: 2D, 3: 3D, 0: both void setProblem(ProblemPtr _problem) override final; /** \brief Constructor * * \param _type TO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: derived class name - * \param _dim_compatible TO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: Which dimension is the - * sensor compatible with (2: 2D, 3: 3D, -1: both) * \param _state_types TO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: Composite of keys and types of the states * of the sensor. * \param _params params yaml node * **/ SensorBase(const std::string& _type, - const int& _dim_compatible, const TypeComposite& _state_types, const YAML::Node& _params); @@ -152,7 +148,6 @@ class SensorBase : public NodeStateBlocks ~SensorBase() override; unsigned int id() const override; - unsigned int getDimCompatible() const; HardwareBaseConstPtr getHardware() const; HardwareBasePtr getHardware(); @@ -283,11 +278,6 @@ inline unsigned int SensorBase::id() const return sensor_id_; } -inline unsigned int SensorBase::getDimCompatible() const -{ - return dim_compatible_; -} - inline ProcessorBaseConstPtrList SensorBase::getProcessorList() const { ProcessorBaseConstPtrList list_const; diff --git a/include/core/sensor/sensor_odom.h b/include/core/sensor/sensor_odom.h index 78798fd3f74719d53764334e4808a89e2f4d2b23..b1f35aa26a36650de369f91863d5fd150879fad0 100644 --- a/include/core/sensor/sensor_odom.h +++ b/include/core/sensor/sensor_odom.h @@ -33,7 +33,6 @@ class SensorOdom : public SensorBase SensorOdom(const YAML::Node& _params) : SensorBase( "SensorOdom" + std::to_string(DIM) + "d", - DIM, {{'P', DIM == 2 ? "StatePoint2d" : "StatePoint3d"}, {'O', DIM == 2 ? "StateAngle" : "StateQuaternion"}}, _params) { diff --git a/include/core/sensor/sensor_pose.h b/include/core/sensor/sensor_pose.h index 043e0d281c6a58d68052b4f77fda6b13af37c02f..0cee11fe89b28069a781d073a8272183d239ce5a 100644 --- a/include/core/sensor/sensor_pose.h +++ b/include/core/sensor/sensor_pose.h @@ -33,7 +33,6 @@ class SensorPose : public SensorBase SensorPose(const YAML::Node& _params) : SensorBase( "SensorPose" + std::to_string(DIM) + "d", - DIM, {{'P', DIM == 2 ? "StatePoint2d" : "StatePoint3d"}, {'O', DIM == 2 ? "StateAngle" : "StateQuaternion"}}, _params) { diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 457efea2912e26487a8cebc009119038fec32502..766edef8ff256e05c63337a4b6ec537579eee771 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -211,10 +211,6 @@ SensorBasePtr Problem::installSensor(const YAML::Node& _sensor_node, std::vector if (not sen_ptr) throw std::runtime_error("Sensor could not be created."); - // Dimension check - if (sen_ptr->getDimCompatible() != 0 and sen_ptr->getDimCompatible() != this->getDim()) - throw std::runtime_error("Sensor not compatible with the Problem dimension."); - // Link sen_ptr->link(getHardware()); return sen_ptr; @@ -256,10 +252,6 @@ SensorBasePtr Problem::installSensor(const std::string& _params_yaml_filen if (not sen_ptr) throw std::runtime_error("Sensor could not be created."); - // Dimension check - if (sen_ptr->getDimCompatible() != 0 and sen_ptr->getDimCompatible() != this->getDim()) - throw std::runtime_error("Sensor not compatible with the Problem dimension."); - // Link sen_ptr->link(getHardware()); diff --git a/src/processor/processor_base.cpp b/src/processor/processor_base.cpp index d4161696819051fbc3d4b3afb6af1b9e4bb1b7c7..dcfe946e54b331fad4f70a8c77d573032de00833 100644 --- a/src/processor/processor_base.cpp +++ b/src/processor/processor_base.cpp @@ -27,7 +27,7 @@ namespace wolf { unsigned int ProcessorBase::processor_id_count_ = 0; -ProcessorBase::ProcessorBase(const std::string& _type, int _dim_compatible, const YAML::Node& _params) +ProcessorBase::ProcessorBase(const std::string& _type, unsigned int _dim_compatible, const YAML::Node& _params) : NodeBase("PROCESSOR", _type, _params["name"].as<std::string>()), processor_id_(++processor_id_count_), params_(Clone(_params)), diff --git a/src/sensor/sensor_diff_drive.cpp b/src/sensor/sensor_diff_drive.cpp index 05b5455d1278eb88cb3158f331d44f52bdadd933..b02bfa776caad59149ad88feb12fcff8e302b28e 100644 --- a/src/sensor/sensor_diff_drive.cpp +++ b/src/sensor/sensor_diff_drive.cpp @@ -25,7 +25,7 @@ namespace wolf { SensorDiffDrive::SensorDiffDrive(const YAML::Node& _params) - : SensorBase("SensorDiffDrive", 2, {{'P', "StatePoint2d"}, {'O', "StateAngle"}, {'I', "StateParams3"}}, _params), + : SensorBase("SensorDiffDrive", {{'P', "StatePoint2d"}, {'O', "StateAngle"}, {'I', "StateParams3"}}, _params), ticks_per_wheel_revolution_(_params["ticks_per_wheel_revolution"].as<double>()), ticks_std_factor_(_params["ticks_std_factor"].as<double>()) { diff --git a/src/sensor/sensor_motion_model.cpp b/src/sensor/sensor_motion_model.cpp index da0e6f2261687eb3c93e77ce17aec783c846aad8..69273807a0b1ac1c8949adfba07addf86f3677e2 100644 --- a/src/sensor/sensor_motion_model.cpp +++ b/src/sensor/sensor_motion_model.cpp @@ -22,7 +22,7 @@ namespace wolf { -SensorMotionModel::SensorMotionModel(const YAML::Node& _params) : SensorBase("SensorMotionModel", -1, {}, _params) {} +SensorMotionModel::SensorMotionModel(const YAML::Node& _params) : SensorBase("SensorMotionModel", {}, _params) {} SensorMotionModel::~SensorMotionModel() {}