Skip to content
Snippets Groups Projects
Commit ada46702 authored by Víctor Sainz Ubide's avatar Víctor Sainz Ubide
Browse files

test added & factory registered

parent 368c75a3
No related branches found
No related tags found
1 merge request!41Draft: Resolve "New branch laser 3d"
...@@ -233,8 +233,11 @@ if(PCL_FOUND) ...@@ -233,8 +233,11 @@ if(PCL_FOUND)
SET(SRCS_CAPTURE ${SRCS_CAPTURE} SET(SRCS_CAPTURE ${SRCS_CAPTURE}
src/capture/capture_laser_3d.cpp src/capture/capture_laser_3d.cpp
) )
SET(SRCS_PROCESSOR ${SRCS_PROCESSOR}
src/processor/processor_odom_icp_3d.cpp
)
SET(SRCS_PROCESSOR ${SRCS_PROCESSOR} SET(SRCS_PROCESSOR ${SRCS_PROCESSOR}
src/processor/processor_odom_icp_3d.cpp src/sensor/sensor_laser_3d.cpp
) )
endif(PCL_FOUND) endif(PCL_FOUND)
......
...@@ -33,7 +33,7 @@ WOLF_STRUCT_PTR_TYPEDEFS(ParamsSensorLaser3d); ...@@ -33,7 +33,7 @@ WOLF_STRUCT_PTR_TYPEDEFS(ParamsSensorLaser3d);
struct ParamsSensorLaser3d : public ParamsSensorBase struct ParamsSensorLaser3d : public ParamsSensorBase
{ {
ParamsSensorLaser3d() = default; ParamsSensorLaser3d() = default;
ParamsSensorLaser3d(std::string _unique_name, const wolf::ParamsServer& _server) ParamsSensorLaser3d(std::string _unique_name, const ParamsServer& _server)
: ParamsSensorBase(_unique_name, _server) : ParamsSensorBase(_unique_name, _server)
{ {
} }
...@@ -46,7 +46,7 @@ class SensorLaser3d : public SensorBase ...@@ -46,7 +46,7 @@ class SensorLaser3d : public SensorBase
{ {
public: public:
SensorLaser3d(StateBlockPtr _p_ptr, StateBlockPtr _o_ptr); SensorLaser3d(StateBlockPtr _p_ptr, StateBlockPtr _o_ptr);
SensorLaser3d(const Eigen::VectorXd& _extrinsics, const std::shared_ptr<ParamsSensorLaser3d> _params); SensorLaser3d(const Eigen::VectorXd& _extrinsics, ParamsSensorLaser3dPtr _params);
~SensorLaser3d(); ~SensorLaser3d();
WOLF_SENSOR_CREATE(SensorLaser3d, ParamsSensorLaser3d, 7); WOLF_SENSOR_CREATE(SensorLaser3d, ParamsSensorLaser3d, 7);
ParamsSensorLaser3dPtr params_laser3d_; ParamsSensorLaser3dPtr params_laser3d_;
......
...@@ -86,11 +86,14 @@ void ProcessorOdomIcp3d::preProcess() ...@@ -86,11 +86,14 @@ void ProcessorOdomIcp3d::preProcess()
*/ */
unsigned int ProcessorOdomIcp3d::processKnown() unsigned int ProcessorOdomIcp3d::processKnown()
{ {
pairAlign(origin_laser_->getPointCloud(), if (origin_ptr_ && (incoming_ptr_ != origin_ptr_))
incoming_laser_->getPointCloud(), {
T_origin_last_, pairAlign(origin_laser_->getPointCloud(),
T_origin_incoming_, incoming_laser_->getPointCloud(),
registration_solver_); T_origin_last_,
T_origin_incoming_,
registration_solver_);
}
return 0; return 0;
}; };
...@@ -186,4 +189,10 @@ void ProcessorOdomIcp3d::establishFactors() ...@@ -186,4 +189,10 @@ void ProcessorOdomIcp3d::establishFactors()
feature, feature, origin_laser_->getFrame(), shared_from_this(), false, TOP_MOTION); feature, feature, origin_laser_->getFrame(), shared_from_this(), false, TOP_MOTION);
}; };
} // namespace wolf } // namespace wolf
\ No newline at end of file #include "core/processor/factory_processor.h"
namespace wolf
{
WOLF_REGISTER_PROCESSOR(ProcessorOdomIcp3d);
WOLF_REGISTER_PROCESSOR_AUTO(ProcessorOdomIcp3d);
} // namespace wolf
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
//--------LICENSE_END-------- //--------LICENSE_END--------
#include "laser/sensor/sensor_laser_3d.h" #include "laser/sensor/sensor_laser_3d.h"
#include <core/state_block/state_block_derived.h>
#include <core/state_block/state_quaternion.h>
namespace wolf namespace wolf
{ {
...@@ -29,17 +32,25 @@ SensorLaser3d::SensorLaser3d(StateBlockPtr _p_ptr, StateBlockPtr _o_ptr) ...@@ -29,17 +32,25 @@ SensorLaser3d::SensorLaser3d(StateBlockPtr _p_ptr, StateBlockPtr _o_ptr)
{ {
} }
SensorLaser3d::SensorLaser3d(const Eigen::VectorXd& _extrinsics, const std::shared_ptr<ParamsSensorLaser3d> _params); SensorLaser3d::SensorLaser3d(const Eigen::VectorXd& _extrinsics, ParamsSensorLaser3dPtr _params)
SensorBase("SensorLaser3d", : SensorBase("SensorLaser3d",
std::make_shared<StatePoint3d>(_extrinsics.head(3), true), std::make_shared<StatePoint3d>(_extrinsics.head(3), true),
std::make_shared<StateQuaternion>(_extrinsics.tail(4), true), std::make_shared<StateQuaternion>(_extrinsics.tail(4), true),
nullptr, nullptr,
0), 0),
params_laser3d_(_params) params_laser3d_(_params)
{ {
// //
} }
SensorLaser3d::~SensorLaser3d() {} SensorLaser3d::~SensorLaser3d() {}
} // namespace wolf } // namespace wolf
\ No newline at end of file
// Register in the FactorySensor and the ParameterFactory
#include "core/sensor/factory_sensor.h"
namespace wolf {
WOLF_REGISTER_SENSOR(SensorLaser3d)
WOLF_REGISTER_SENSOR_AUTO(SensorLaser3d)
} // namespace wolf
This diff is collapsed.
...@@ -7,6 +7,9 @@ config: ...@@ -7,6 +7,9 @@ config:
$state: $state:
P: [0,0,0] P: [0,0,0]
O: [0,0,0,1] O: [0,0,0,1]
$sigma:
P: [.1,.1,.1]
O: [.1,.1,.1]
time_tolerance: 0.05 time_tolerance: 0.05
tree_manager: tree_manager:
type: "None" type: "None"
...@@ -31,4 +34,15 @@ config: ...@@ -31,4 +34,15 @@ config:
icp_max_iterations: 20 icp_max_iterations: 20
icp_transformation_rotation_epsilon: 0.99 icp_transformation_rotation_epsilon: 0.99
icp_transformation_translation_epsilon: 1e-6 icp_transformation_translation_epsilon: 1e-6
icp_max_correspondence_distance: 0.5 icp_max_correspondence_distance: 0.5
\ No newline at end of file keyframe_vote:
voting_active: false
min_features_for_keyframe : 0
apply_loss_function: false
max_new_features: 0
state_getter: true
state_priority: 1
pcl_downsample: true
vote_elapsed_time: 0.99
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