#include <pose_graph_2d.h>
Classes | |
class | TrimmingHandle |
Public Member Functions | |
void | AddFixedFramePoseData (int trajectory_id, const sensor::FixedFramePoseData &fixed_frame_pose_data) override LOCKS_EXCLUDED(mutex_) |
void | AddImuData (int trajectory_id, const sensor::ImuData &imu_data) override LOCKS_EXCLUDED(mutex_) |
void | AddLandmarkData (int trajectory_id, const sensor::LandmarkData &landmark_data) override LOCKS_EXCLUDED(mutex_) |
NodeId | AddNode (std::shared_ptr< const TrajectoryNode::Data > constant_data, int trajectory_id, const std::vector< std::shared_ptr< const Submap2D >> &insertion_submaps) LOCKS_EXCLUDED(mutex_) |
void | AddNodeFromProto (const transform::Rigid3d &global_pose, const proto::Node &node) override |
void | AddNodeToSubmap (const NodeId &node_id, const SubmapId &submap_id) override |
void | AddOdometryData (int trajectory_id, const sensor::OdometryData &odometry_data) override LOCKS_EXCLUDED(mutex_) |
void | AddSerializedConstraints (const std::vector< Constraint > &constraints) override |
void | AddSubmapFromProto (const transform::Rigid3d &global_submap_pose, const proto::Submap &submap) override |
void | AddTrimmer (std::unique_ptr< PoseGraphTrimmer > trimmer) override |
std::vector< Constraint > | constraints () const override LOCKS_EXCLUDED(mutex_) |
void | DeleteTrajectory (int trajectory_id) override |
void | FinishTrajectory (int trajectory_id) override |
void | FreezeTrajectory (int trajectory_id) override |
MapById< SubmapId, PoseGraphInterface::SubmapData > | GetAllSubmapData () const LOCKS_EXCLUDED(mutex_) override |
MapById< SubmapId, SubmapPose > | GetAllSubmapPoses () const LOCKS_EXCLUDED(mutex_) override |
std::vector< std::vector< int > > | GetConnectedTrajectories () const override LOCKS_EXCLUDED(mutex_) |
sensor::MapByTime < sensor::FixedFramePoseData > | GetFixedFramePoseData () const override LOCKS_EXCLUDED(mutex_) |
sensor::MapByTime < sensor::ImuData > | GetImuData () const override LOCKS_EXCLUDED(mutex_) |
transform::Rigid3d | GetInterpolatedGlobalTrajectoryPose (int trajectory_id, const common::Time time) const EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
std::map< std::string, PoseGraph::LandmarkNode > | GetLandmarkNodes () const override LOCKS_EXCLUDED(mutex_) |
std::map< std::string, transform::Rigid3d > | GetLandmarkPoses () const override LOCKS_EXCLUDED(mutex_) |
transform::Rigid3d | GetLocalToGlobalTransform (int trajectory_id) const LOCKS_EXCLUDED(mutex_) override |
sensor::MapByTime < sensor::OdometryData > | GetOdometryData () const override LOCKS_EXCLUDED(mutex_) |
PoseGraphInterface::SubmapData | GetSubmapData (const SubmapId &submap_id) const LOCKS_EXCLUDED(mutex_) override |
std::map< int, TrajectoryData > | GetTrajectoryData () const override LOCKS_EXCLUDED(mutex_) |
MapById< NodeId, TrajectoryNodePose > | GetTrajectoryNodePoses () const override LOCKS_EXCLUDED(mutex_) |
MapById< NodeId, TrajectoryNode > | GetTrajectoryNodes () const override LOCKS_EXCLUDED(mutex_) |
std::map< int, TrajectoryState > | GetTrajectoryStates () const override LOCKS_EXCLUDED(mutex_) |
bool | IsTrajectoryFinished (int trajectory_id) const override EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
bool | IsTrajectoryFrozen (int trajectory_id) const override EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
PoseGraph2D & | operator= (const PoseGraph2D &) |
PoseGraph2D (const proto::PoseGraphOptions &options, std::unique_ptr< optimization::OptimizationProblem2D > optimization_problem, common::ThreadPool *thread_pool) | |
PoseGraph2D (const PoseGraph2D &) | |
void | RunFinalOptimization () override |
void | SetGlobalSlamOptimizationCallback (PoseGraphInterface::GlobalSlamOptimizationCallback callback) override |
void | SetInitialTrajectoryPose (int from_trajectory_id, int to_trajectory_id, const transform::Rigid3d &pose, const common::Time time) override LOCKS_EXCLUDED(mutex_) |
void | SetLandmarkPose (const std::string &landmark_id, const transform::Rigid3d &global_pose, const bool frozen=false) override LOCKS_EXCLUDED(mutex_) |
void | SetTrajectoryDataFromProto (const proto::TrajectoryData &data) override |
~PoseGraph2D () override | |
Static Public Member Functions | |
static void | RegisterMetrics (metrics::FamilyFactory *family_factory) |
Private Member Functions | |
void | AddTrajectoryIfNeeded (int trajectory_id) EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
void | AddWorkItem (const std::function< WorkItem::Result()> &work_item) LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_) |
NodeId | AppendNode (std::shared_ptr< const TrajectoryNode::Data > constant_data, int trajectory_id, const std::vector< std::shared_ptr< const Submap2D >> &insertion_submaps, const transform::Rigid3d &optimized_pose) LOCKS_EXCLUDED(mutex_) |
bool | CanAddWorkItemModifying (int trajectory_id) EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
void | ComputeConstraint (const NodeId &node_id, const SubmapId &submap_id) LOCKS_EXCLUDED(mutex_) |
WorkItem::Result | ComputeConstraintsForNode (const NodeId &node_id, std::vector< std::shared_ptr< const Submap2D >> insertion_submaps, bool newly_finished_submap) LOCKS_EXCLUDED(mutex_) |
transform::Rigid3d | ComputeLocalToGlobalTransform (const MapById< SubmapId, optimization::SubmapSpec2D > &global_submap_poses, int trajectory_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
void | DeleteTrajectoriesIfNeeded () EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
void | DrainWorkQueue () LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_) |
common::Time | GetLatestNodeTime (const NodeId &node_id, const SubmapId &submap_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
MapById< SubmapId, PoseGraphInterface::SubmapData > | GetSubmapDataUnderLock () const EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
SubmapData | GetSubmapDataUnderLock (const SubmapId &submap_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
std::unique_ptr< WorkQueue > work_queue_ | GUARDED_BY (work_queue_mutex_) |
absl::flat_hash_map< int, std::unique_ptr < common::FixedRatioSampler > > global_localization_samplers_ | GUARDED_BY (mutex_) |
int num_nodes_since_last_loop_closure_ | GUARDED_BY (mutex_)=0 |
std::vector< std::unique_ptr < PoseGraphTrimmer > > trimmers_ | GUARDED_BY (mutex_) |
PoseGraphData data_ | GUARDED_BY (mutex_) |
void | HandleWorkQueue (const constraints::ConstraintBuilder2D::Result &result) LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_) |
std::vector< SubmapId > | InitializeGlobalSubmapPoses (int trajectory_id, const common::Time time, const std::vector< std::shared_ptr< const Submap2D >> &insertion_submaps) EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
void | RunOptimization () LOCKS_EXCLUDED(mutex_) |
void | UpdateTrajectoryConnectivity (const Constraint &constraint) EXCLUSIVE_LOCKS_REQUIRED(mutex_) |
void | WaitForAllComputations () LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_) |
Private Attributes | |
constraints::ConstraintBuilder2D | constraint_builder_ |
ValueConversionTables | conversion_tables_ |
GlobalSlamOptimizationCallback | global_slam_optimization_callback_ |
absl::Mutex | mutex_ |
std::unique_ptr < optimization::OptimizationProblem2D > | optimization_problem_ |
const proto::PoseGraphOptions | options_ |
common::ThreadPool *const | thread_pool_ |
absl::Mutex | work_queue_mutex_ |
Definition at line 64 of file pose_graph_2d.h.
cartographer::mapping::PoseGraph2D::PoseGraph2D | ( | const proto::PoseGraphOptions & | options, |
std::unique_ptr< optimization::OptimizationProblem2D > | optimization_problem, | ||
common::ThreadPool * | thread_pool | ||
) |
Definition at line 51 of file pose_graph_2d.cc.
cartographer::mapping::PoseGraph2D::~PoseGraph2D | ( | ) | [override] |
Definition at line 68 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddFixedFramePoseData | ( | int | trajectory_id, |
const sensor::FixedFramePoseData & | fixed_frame_pose_data | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 229 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddImuData | ( | int | trajectory_id, |
const sensor::ImuData & | imu_data | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 207 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddLandmarkData | ( | int | trajectory_id, |
const sensor::LandmarkData & | landmark_data | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 235 of file pose_graph_2d.cc.
NodeId cartographer::mapping::PoseGraph2D::AddNode | ( | std::shared_ptr< const TrajectoryNode::Data > | constant_data, |
int | trajectory_id, | ||
const std::vector< std::shared_ptr< const Submap2D >> & | insertion_submaps | ||
) |
Definition at line 153 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddNodeFromProto | ( | const transform::Rigid3d & | global_pose, |
const proto::Node & | node | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 705 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddNodeToSubmap | ( | const NodeId & | node_id, |
const SubmapId & | submap_id | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 743 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddOdometryData | ( | int | trajectory_id, |
const sensor::OdometryData & | odometry_data | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 218 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddSerializedConstraints | ( | const std::vector< Constraint > & | constraints | ) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 754 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddSubmapFromProto | ( | const transform::Rigid3d & | global_submap_pose, |
const proto::Submap & | submap | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 663 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddTrajectoryIfNeeded | ( | int | trajectory_id | ) | [private] |
Definition at line 190 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddTrimmer | ( | std::unique_ptr< PoseGraphTrimmer > | trimmer | ) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 788 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::AddWorkItem | ( | const std::function< WorkItem::Result()> & | work_item | ) | [private] |
Definition at line 173 of file pose_graph_2d.cc.
NodeId cartographer::mapping::PoseGraph2D::AppendNode | ( | std::shared_ptr< const TrajectoryNode::Data > | constant_data, |
int | trajectory_id, | ||
const std::vector< std::shared_ptr< const Submap2D >> & | insertion_submaps, | ||
const transform::Rigid3d & | optimized_pose | ||
) | [private] |
Definition at line 125 of file pose_graph_2d.cc.
bool cartographer::mapping::PoseGraph2D::CanAddWorkItemModifying | ( | int | trajectory_id | ) | [private] |
Definition at line 868 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::ComputeConstraint | ( | const NodeId & | node_id, |
const SubmapId & | submap_id | ||
) | [private] |
Definition at line 252 of file pose_graph_2d.cc.
WorkItem::Result cartographer::mapping::PoseGraph2D::ComputeConstraintsForNode | ( | const NodeId & | node_id, |
std::vector< std::shared_ptr< const Submap2D >> | insertion_submaps, | ||
bool | newly_finished_submap | ||
) | [private] |
Definition at line 303 of file pose_graph_2d.cc.
transform::Rigid3d cartographer::mapping::PoseGraph2D::ComputeLocalToGlobalTransform | ( | const MapById< SubmapId, optimization::SubmapSpec2D > & | global_submap_poses, |
int | trajectory_id | ||
) | const [private] |
std::vector< PoseGraphInterface::Constraint > cartographer::mapping::PoseGraph2D::constraints | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 982 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::DeleteTrajectoriesIfNeeded | ( | ) | [private] |
Definition at line 418 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::DeleteTrajectory | ( | int | trajectory_id | ) | [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 599 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::DrainWorkQueue | ( | ) | [private] |
Definition at line 511 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::FinishTrajectory | ( | int | trajectory_id | ) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 625 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::FreezeTrajectory | ( | int | trajectory_id | ) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 644 of file pose_graph_2d.cc.
MapById<SubmapId, PoseGraphInterface::SubmapData> cartographer::mapping::PoseGraph2D::GetAllSubmapData | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
MapById<SubmapId, SubmapPose> cartographer::mapping::PoseGraph2D::GetAllSubmapPoses | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
std::vector<std::vector<int> > cartographer::mapping::PoseGraph2D::GetConnectedTrajectories | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraph.
sensor::MapByTime< sensor::FixedFramePoseData > cartographer::mapping::PoseGraph2D::GetFixedFramePoseData | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 976 of file pose_graph_2d.cc.
sensor::MapByTime< sensor::ImuData > cartographer::mapping::PoseGraph2D::GetImuData | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 953 of file pose_graph_2d.cc.
transform::Rigid3d cartographer::mapping::PoseGraph2D::GetInterpolatedGlobalTrajectoryPose | ( | int | trajectory_id, |
const common::Time | time | ||
) | const |
Definition at line 1008 of file pose_graph_2d.cc.
std::map< std::string, PoseGraphInterface::LandmarkNode > cartographer::mapping::PoseGraph2D::GetLandmarkNodes | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 964 of file pose_graph_2d.cc.
std::map< std::string, transform::Rigid3d > cartographer::mapping::PoseGraph2D::GetLandmarkPoses | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 929 of file pose_graph_2d.cc.
common::Time cartographer::mapping::PoseGraph2D::GetLatestNodeTime | ( | const NodeId & | node_id, |
const SubmapId & | submap_id | ||
) | const [private] |
Definition at line 395 of file pose_graph_2d.cc.
transform::Rigid3d cartographer::mapping::PoseGraph2D::GetLocalToGlobalTransform | ( | int | trajectory_id | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 1029 of file pose_graph_2d.cc.
sensor::MapByTime< sensor::OdometryData > cartographer::mapping::PoseGraph2D::GetOdometryData | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 958 of file pose_graph_2d.cc.
PoseGraphInterface::SubmapData cartographer::mapping::PoseGraph2D::GetSubmapData | ( | const SubmapId & | submap_id | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraph.
MapById< SubmapId, PoseGraphInterface::SubmapData > cartographer::mapping::PoseGraph2D::GetSubmapDataUnderLock | ( | ) | const [private] |
Definition at line 1233 of file pose_graph_2d.cc.
PoseGraphInterface::SubmapData cartographer::mapping::PoseGraph2D::GetSubmapDataUnderLock | ( | const SubmapId & | submap_id | ) | const [private] |
Definition at line 1091 of file pose_graph_2d.cc.
std::map< int, PoseGraphInterface::TrajectoryData > cartographer::mapping::PoseGraph2D::GetTrajectoryData | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 970 of file pose_graph_2d.cc.
MapById< NodeId, TrajectoryNodePose > cartographer::mapping::PoseGraph2D::GetTrajectoryNodePoses | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 901 of file pose_graph_2d.cc.
MapById< NodeId, TrajectoryNode > cartographer::mapping::PoseGraph2D::GetTrajectoryNodes | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 896 of file pose_graph_2d.cc.
std::map< int, PoseGraphInterface::TrajectoryState > cartographer::mapping::PoseGraph2D::GetTrajectoryStates | ( | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 920 of file pose_graph_2d.cc.
std::unique_ptr<WorkQueue> work_queue_ cartographer::mapping::PoseGraph2D::GUARDED_BY | ( | work_queue_mutex_ | ) | [private] |
absl::flat_hash_map<int, std::unique_ptr<common::FixedRatioSampler> > global_localization_samplers_ cartographer::mapping::PoseGraph2D::GUARDED_BY | ( | mutex_ | ) | [private] |
int num_nodes_since_last_loop_closure_ cartographer::mapping::PoseGraph2D::GUARDED_BY | ( | mutex_ | ) | [private, pure virtual] |
std::vector<std::unique_ptr<PoseGraphTrimmer> > trimmers_ cartographer::mapping::PoseGraph2D::GUARDED_BY | ( | mutex_ | ) | [private] |
void cartographer::mapping::PoseGraph2D::HandleWorkQueue | ( | const constraints::ConstraintBuilder2D::Result & | result | ) | [private] |
Definition at line 435 of file pose_graph_2d.cc.
std::vector< SubmapId > cartographer::mapping::PoseGraph2D::InitializeGlobalSubmapPoses | ( | int | trajectory_id, |
const common::Time | time, | ||
const std::vector< std::shared_ptr< const Submap2D >> & | insertion_submaps | ||
) | [private] |
Definition at line 74 of file pose_graph_2d.cc.
bool cartographer::mapping::PoseGraph2D::IsTrajectoryFinished | ( | int | trajectory_id | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 638 of file pose_graph_2d.cc.
bool cartographer::mapping::PoseGraph2D::IsTrajectoryFrozen | ( | int | trajectory_id | ) | const [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 657 of file pose_graph_2d.cc.
PoseGraph2D& cartographer::mapping::PoseGraph2D::operator= | ( | const PoseGraph2D & | ) |
void cartographer::mapping::PoseGraph2D::RegisterMetrics | ( | metrics::FamilyFactory * | family_factory | ) | [static] |
Definition at line 1247 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::RunFinalOptimization | ( | ) | [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 798 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::RunOptimization | ( | ) | [private] |
Definition at line 818 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::SetGlobalSlamOptimizationCallback | ( | PoseGraphInterface::GlobalSlamOptimizationCallback | callback | ) | [override] |
Definition at line 1242 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::SetInitialTrajectoryPose | ( | int | from_trajectory_id, |
int | to_trajectory_id, | ||
const transform::Rigid3d & | pose, | ||
const common::Time | time | ||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraph.
Definition at line 999 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::SetLandmarkPose | ( | const std::string & | landmark_id, |
const transform::Rigid3d & | global_pose, | ||
const bool | frozen = false |
||
) | [override, virtual] |
Implements cartographer::mapping::PoseGraphInterface.
Definition at line 942 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::SetTrajectoryDataFromProto | ( | const proto::TrajectoryData & | data | ) | [override] |
Definition at line 738 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::UpdateTrajectoryConnectivity | ( | const Constraint & | constraint | ) | [private] |
Definition at line 409 of file pose_graph_2d.cc.
void cartographer::mapping::PoseGraph2D::WaitForAllComputations | ( | ) | [private] |
Definition at line 536 of file pose_graph_2d.cc.
Definition at line 259 of file pose_graph_2d.h.
Definition at line 269 of file pose_graph_2d.h.
GlobalSlamOptimizationCallback cartographer::mapping::PoseGraph2D::global_slam_optimization_callback_ [private] |
Definition at line 242 of file pose_graph_2d.h.
absl::Mutex cartographer::mapping::PoseGraph2D::mutex_ [mutable, private] |
Definition at line 243 of file pose_graph_2d.h.
std::unique_ptr<optimization::OptimizationProblem2D> cartographer::mapping::PoseGraph2D::optimization_problem_ [private] |
Definition at line 258 of file pose_graph_2d.h.
const proto::PoseGraphOptions cartographer::mapping::PoseGraph2D::options_ [private] |
Definition at line 241 of file pose_graph_2d.h.
common::ThreadPool* const cartographer::mapping::PoseGraph2D::thread_pool_ [private] |
Definition at line 262 of file pose_graph_2d.h.
absl::Mutex cartographer::mapping::PoseGraph2D::work_queue_mutex_ [private] |
Definition at line 244 of file pose_graph_2d.h.