17 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_CONSTRAINTS_CONSTRAINT_BUILDER_2D_H_ 18 #define CARTOGRAPHER_MAPPING_INTERNAL_CONSTRAINTS_CONSTRAINT_BUILDER_2D_H_ 27 #include "Eigen/Geometry" 38 #include "cartographer/mapping/proto/pose_graph/constraint_builder_options.pb.h" 45 namespace constraints {
62 using Result = std::vector<Constraint>;
111 std::unique_ptr<scan_matching::FastCorrelativeScanMatcher2D>
125 const NodeId& node_id,
bool match_full_submap,
129 std::unique_ptr<Constraint>* constraint)
134 const constraints::proto::ConstraintBuilderOptions
options_;
136 common::Mutex mutex_;
139 std::unique_ptr<std::function<
void(const
Result&)>> when_done_
146 int num_started_nodes_
GUARDED_BY(mutex_) = 0;
148 int num_finished_nodes_
GUARDED_BY(mutex_) = 0;
150 std::unique_ptr<common::Task> finish_node_task_
GUARDED_BY(mutex_);
152 std::unique_ptr<common::Task> when_done_task_
GUARDED_BY(mutex_);
167 common::Histogram score_histogram_
GUARDED_BY(mutex_);
174 #endif // CARTOGRAPHER_MAPPING_INTERNAL_CONSTRAINTS_CONSTRAINT_BUILDER_2D_H_
void DeleteScanMatcher(const SubmapId &submap_id)
const SubmapScanMatcher * DispatchScanMatcherConstruction(const SubmapId &submap_id, const Grid2D *grid) REQUIRES(mutex_)
std::vector< Constraint > Result
std::unique_ptr< scan_matching::FastCorrelativeScanMatcher2D > fast_correlative_scan_matcher
static void RegisterMetrics(metrics::FamilyFactory *family_factory)
std::weak_ptr< common::Task > creation_task_handle
const constraints::proto::ConstraintBuilderOptions options_
void RunWhenDoneCallback() EXCLUDES(mutex_)
common::FixedRatioSampler sampler_
ConstraintBuilder2D & operator=(const ConstraintBuilder2D &)=delete
transform::Rigid2d ComputeSubmapPose(const Submap2D &submap)
void MaybeAddConstraint(const SubmapId &submap_id, const Submap2D *submap, const NodeId &node_id, const TrajectoryNode::Data *const constant_data, const transform::Rigid2d &initial_relative_pose)
common::ThreadPoolInterface * thread_pool_
ConstraintBuilder2D(const proto::ConstraintBuilderOptions &options, common::ThreadPoolInterface *thread_pool)
void MaybeAddGlobalConstraint(const SubmapId &submap_id, const Submap2D *submap, const NodeId &node_id, const TrajectoryNode::Data *const constant_data)
int GetNumFinishedNodes()
void ComputeConstraint(const SubmapId &submap_id, const Submap2D *submap, const NodeId &node_id, bool match_full_submap, const TrajectoryNode::Data *const constant_data, const transform::Rigid2d &initial_relative_pose, const SubmapScanMatcher &submap_scan_matcher, std::unique_ptr< Constraint > *constraint) EXCLUDES(mutex_)
scan_matching::CeresScanMatcher2D ceres_scan_matcher_
std::unique_ptr< std::function< void(const Result &)> > when_done_ GUARDED_BY(mutex_)
void WhenDone(const std::function< void(const Result &)> &callback)