17 #ifndef CARTOGRAPHER_MAPPING_3D_SPARSE_POSE_GRAPH_CONSTRAINT_BUILDER_H_ 18 #define CARTOGRAPHER_MAPPING_3D_SPARSE_POSE_GRAPH_CONSTRAINT_BUILDER_H_ 27 #include "Eigen/Geometry" 45 namespace mapping_3d {
46 namespace sparse_pose_graph {
59 using Result = std::vector<Constraint>;
62 const mapping::sparse_pose_graph::proto::ConstraintBuilderOptions&
80 const std::vector<mapping::TrajectoryNode>& submap_nodes,
97 const std::vector<mapping::TrajectoryNode>& submap_nodes,
98 const Eigen::Quaterniond& gravity_alignment,
114 std::unique_ptr<scan_matching::FastCorrelativeScanMatcher>
122 const std::vector<mapping::TrajectoryNode>& submap_nodes,
123 const HybridGrid* submap, std::function<
void()> work_item)
128 const mapping::SubmapId& submap_id,
129 const std::vector<mapping::TrajectoryNode>& submap_nodes,
134 const mapping::SubmapId& submap_id)
EXCLUDES(mutex_);
143 const mapping::SubmapId& submap_id, const
Submap* submap,
144 const mapping::NodeId& node_id,
bool match_full_submap,
145 mapping::TrajectoryConnectivity* trajectory_connectivity,
146 const sensor::CompressedPointCloud* compressed_point_cloud,
147 const transform::
Rigid3d& initial_pose,
154 const mapping::sparse_pose_graph::proto::ConstraintBuilderOptions
options_;
156 common::Mutex mutex_;
159 std::unique_ptr<std::function<
void(const
Result&)>> when_done_
165 int current_computation_
GUARDED_BY(mutex_) = 0;
169 std::map<
int,
int> pending_computations_
GUARDED_BY(mutex_);
181 std::map<mapping::SubmapId, std::vector<std::function<
void()>>>
189 common::Histogram score_histogram_
GUARDED_BY(mutex_);
196 #endif // CARTOGRAPHER_MAPPING_3D_SPARSE_POSE_GRAPH_CONSTRAINT_BUILDER_H_
scan_matching::CeresScanMatcher ceres_scan_matcher_
void MaybeAddGlobalConstraint(const mapping::SubmapId &submap_id, const Submap *submap, const mapping::NodeId &node_id, const sensor::CompressedPointCloud *compressed_point_cloud, const std::vector< mapping::TrajectoryNode > &submap_nodes, const Eigen::Quaterniond &gravity_alignment, mapping::TrajectoryConnectivity *trajectory_connectivity)
const SubmapScanMatcher * GetSubmapScanMatcher(const mapping::SubmapId &submap_id) EXCLUDES(mutex_)
std::vector< Constraint > Result
void ComputeConstraint(const mapping::SubmapId &submap_id, const Submap *submap, const mapping::NodeId &node_id, bool match_full_submap, mapping::TrajectoryConnectivity *trajectory_connectivity, const sensor::CompressedPointCloud *compressed_point_cloud, const transform::Rigid3d &initial_pose, std::unique_ptr< Constraint > *constraint) EXCLUDES(mutex_)
const sensor::AdaptiveVoxelFilter adaptive_voxel_filter_
std::unique_ptr< scan_matching::FastCorrelativeScanMatcher > fast_correlative_scan_matcher
const mapping::sparse_pose_graph::proto::ConstraintBuilderOptions options_
void MaybeAddConstraint(const mapping::SubmapId &submap_id, const Submap *submap, const mapping::NodeId &node_id, const sensor::CompressedPointCloud *compressed_point_cloud, const std::vector< mapping::TrajectoryNode > &submap_nodes, const transform::Rigid3d &initial_pose)
common::ThreadPool * thread_pool_
int GetNumFinishedScans()
void WhenDone(std::function< void(const Result &)> callback)
void ConstructSubmapScanMatcher(const mapping::SubmapId &submap_id, const std::vector< mapping::TrajectoryNode > &submap_nodes, const HybridGrid *submap) EXCLUDES(mutex_)
ConstraintBuilder(const mapping::sparse_pose_graph::proto::ConstraintBuilderOptions &options, common::ThreadPool *thread_pool)
common::FixedRatioSampler sampler_
void ScheduleSubmapScanMatcherConstructionAndQueueWorkItem(const mapping::SubmapId &submap_id, const std::vector< mapping::TrajectoryNode > &submap_nodes, const HybridGrid *submap, std::function< void()> work_item) REQUIRES(mutex_)
const HybridGrid * hybrid_grid
void FinishComputation(int computation_index) EXCLUDES(mutex_)
std::unique_ptr< std::function< void(const Result &)> > when_done_ GUARDED_BY(mutex_)
ConstraintBuilder & operator=(const ConstraintBuilder &)=delete