structPoseGraphData { /* struct InternalSubmapData { std::shared_ptr<const Submap> submap; SubmapState state = SubmapState::kNoConstraintSearch; // IDs of the nodes that were inserted into this map together with // constraints for them. They are not to be matched again when this submap // becomes 'kFinished'. std::set<NodeId> node_ids; }; */
// Submaps get assigned an ID and state as soon as they are seen, even // before they take part in the background computations. MapById<SubmapId, InternalSubmapData> submap_data;
// Global submap poses currently used for displaying data. MapById<SubmapId, optimization::SubmapSpec2D> global_submap_poses_2d; MapById<SubmapId, optimization::SubmapSpec3D> global_submap_poses_3d;
// Data that are currently being shown. MapById<NodeId, TrajectoryNode> trajectory_nodes;
// Global landmark poses with all observations. std::map<std::string /* landmark ID */, PoseGraphInterface::LandmarkNode> landmark_nodes; // How our various trajectories are related. TrajectoryConnectivityState trajectory_connectivity_state; int num_trajectory_nodes = 0; std::map<int, InternalTrajectoryState> trajectories_state;
// Set of all initial trajectory poses. std::map<int, PoseGraph::InitialTrajectoryPose> initial_trajectory_poses;
structInternalSubmapData { std::shared_ptr<const Submap> submap; SubmapState state = SubmapState::kNoConstraintSearch; // IDs of the nodes that were inserted into this map together with // constraints for them. They are not to be matched again when this submap // becomes 'kFinished'. std::set<NodeId> node_ids; };
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
structConstraint { structPose { transform::Rigid3d zbar_ij; double translation_weight; double rotation_weight; }; SubmapId submap_id; // 'i' in the paper. NodeId node_id; // 'j' in the paper. // Pose of the node 'j' relative to submap 'i'. Pose pose; /* Differentiates between intra-submap (where node 'j' was inserted into submap 'i') and inter-submap constraints (where node 'j' was not inserted into submap 'i').*/ enumTag { INTRA_SUBMAP, INTER_SUBMAP } tag; };
// Rays begin at 'origin'. 'returns' are the points where obstructions were // detected. 'misses' are points in the direction of rays for which no return // was detected, and were inserted at a configured distance // It is assumed that between the 'origin' and 'misses' is free space structRangeData { Eigen::Vector3f origin; PointCloud returns; PointCloud misses; };
using PointCloud = std::vector<RangefinderPoint>; // Stores 3D position of a point observed by a rangefinder sensor. structRangefinderPoint { Eigen::Vector3f position; };
structTrajectoryNode { structData { common::Time time; // Transform to approximately gravity align the tracking frame as // determined by local SLAM. Eigen::Quaterniond gravity_alignment; // Used for loop closure in 2D: voxel filtered returns in the // 'gravity_alignment' frame. sensor::PointCloud filtered_gravity_aligned_point_cloud; // 省略 3D.
// The node pose in the local SLAM frame. transform::Rigid3d local_pose; }; common::Time time()const{ return constant_data->time; } // This must be a shared_ptr. If the data is used for visualization while the // node is being trimmed, it must survive until all use finishes. std::shared_ptr<const Data> constant_data; // The node pose in the global SLAM frame. transform::Rigid3d global_pose; };
// An individual submap, which has a 'local_pose' in the local map frame, // keeps track of how many range data were inserted into it // and sets 'insertion_finished' when the map no longer changes // and is ready for loop closing classSubmap { public: Submap(const transform::Rigid3d& local_submap_pose) : local_pose_(local_submap_pose) {}
private: // Pose of this submap in the local map frame const transform::Rigid3d local_pose_; // Number of RangeData inserted. int num_range_data_ = 0; bool insertion_finished_ = false; };