17 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_CONSTRAINTS_CONSTRAINT_BUILDER_3D_H_ 18 #define CARTOGRAPHER_MAPPING_INTERNAL_CONSTRAINTS_CONSTRAINT_BUILDER_3D_H_ 27 #include "Eigen/Geometry" 39 #include "cartographer/mapping/proto/pose_graph/constraint_builder_options.pb.h" 48 namespace constraints {
61 using Result = std::vector<Constraint>;
81 const std::vector<TrajectoryNode>& submap_nodes,
97 const std::vector<TrajectoryNode>& submap_nodes,
98 const Eigen::Quaterniond& global_node_rotation,
99 const Eigen::Quaterniond& global_submap_rotation);
107 void WhenDone(
const std::function<
void(
const Result&)>& callback);
121 std::unique_ptr<scan_matching::FastCorrelativeScanMatcher3D>
130 const std::vector<TrajectoryNode>& submap_nodes,
const Submap3D* submap)
137 bool match_full_submap,
142 std::unique_ptr<Constraint>* constraint)
149 common::Mutex mutex_;
152 std::unique_ptr<std::function<
void(const
Result&)>> when_done_
159 int num_started_nodes_
GUARDED_BY(mutex_) = 0;
161 int num_finished_nodes_
GUARDED_BY(mutex_) = 0;
163 std::unique_ptr<common::Task> finish_node_task_
GUARDED_BY(mutex_);
165 std::unique_ptr<common::Task> when_done_task_
GUARDED_BY(mutex_);
180 common::Histogram score_histogram_
GUARDED_BY(mutex_);
181 common::Histogram rotational_score_histogram_
GUARDED_BY(mutex_);
182 common::Histogram low_resolution_score_histogram_
GUARDED_BY(mutex_);
189 #endif // CARTOGRAPHER_MAPPING_INTERNAL_CONSTRAINTS_CONSTRAINT_BUILDER_3D_H_
static void RegisterMetrics(metrics::FamilyFactory *family_factory)
const HybridGrid * low_resolution_hybrid_grid
std::vector< Constraint > Result
std::unique_ptr< scan_matching::FastCorrelativeScanMatcher3D > fast_correlative_scan_matcher
const HybridGrid * high_resolution_hybrid_grid
int GetNumFinishedNodes()
const proto::ConstraintBuilderOptions options_
void RunWhenDoneCallback() EXCLUDES(mutex_)
void DeleteScanMatcher(const SubmapId &submap_id)
scan_matching::CeresScanMatcher3D ceres_scan_matcher_
ConstraintBuilder3D & operator=(const ConstraintBuilder3D &)=delete
void WhenDone(const std::function< void(const Result &)> &callback)
std::weak_ptr< common::Task > creation_task_handle
const SubmapScanMatcher * DispatchScanMatcherConstruction(const SubmapId &submap_id, const std::vector< TrajectoryNode > &submap_nodes, const Submap3D *submap) REQUIRES(mutex_)
void MaybeAddGlobalConstraint(const SubmapId &submap_id, const Submap3D *submap, const NodeId &node_id, const TrajectoryNode::Data *const constant_data, const std::vector< TrajectoryNode > &submap_nodes, const Eigen::Quaterniond &global_node_rotation, const Eigen::Quaterniond &global_submap_rotation)
void MaybeAddConstraint(const SubmapId &submap_id, const Submap3D *submap, const NodeId &node_id, const TrajectoryNode::Data *const constant_data, const std::vector< TrajectoryNode > &submap_nodes, const transform::Rigid3d &global_node_pose, const transform::Rigid3d &global_submap_pose)
common::ThreadPoolInterface * thread_pool_
void ComputeConstraint(const SubmapId &submap_id, const NodeId &node_id, bool match_full_submap, const TrajectoryNode::Data *const constant_data, const transform::Rigid3d &global_node_pose, const transform::Rigid3d &global_submap_pose, const SubmapScanMatcher &submap_scan_matcher, std::unique_ptr< Constraint > *constraint) EXCLUDES(mutex_)
std::unique_ptr< std::function< void(const Result &)> > when_done_ GUARDED_BY(mutex_)
ConstraintBuilder3D(const proto::ConstraintBuilderOptions &options, common::ThreadPoolInterface *thread_pool)
common::FixedRatioSampler sampler_