NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
graph_localizer.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef GRAPH_LOCALIZER_GRAPH_LOCALIZER_H_
20 #define GRAPH_LOCALIZER_GRAPH_LOCALIZER_H_
21 
29 
30 #include <boost/serialization/serialization.hpp>
31 
32 namespace graph_localizer {
33 // Siding window graph optimizer that uses matched projections and odomery poses to perform localization.
34 // Uses the PoseNodeAdder to add relative odometry pose factors between graph nodes.
35 // Matched projections typically come from matching images to a map of image
36 // features.
38  public:
40 
41  // For Serialization Only
43 
44  // Adds pose measurement to the pose node adder.
46 
47  // Adds sparse map matched projections measurement to loc factor adder.
49  const localization_measurements::MatchedProjectionsMeasurement& matched_projections_measurement);
50 
51  // Adds AR tag matched projections measurement to loc factor adder.
53  const localization_measurements::MatchedProjectionsMeasurement& matched_projections_measurement);
54 
55  // Returns a const reference to pose nodes.
57 
58  // Sets pose covariance interpolater for relative odometry pose node creation
61  pose_covariance_interpolater);
62 
63  private:
64  // bool ValidGraph() const final;
65 
66  // Serialization function
68  template <class Archive>
69  void serialize(Archive& ar, const unsigned int file_version) {
70  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(sliding_window_graph_optimizer::SlidingWindowGraphOptimizer);
71  ar& BOOST_SERIALIZATION_NVP(params_);
72  ar& BOOST_SERIALIZATION_NVP(sparse_map_loc_factor_adder_);
73  ar& BOOST_SERIALIZATION_NVP(ar_tag_loc_factor_adder_);
74  ar& BOOST_SERIALIZATION_NVP(pose_node_adder_);
75  }
76 
77  GraphLocalizerParams params_;
78 
79  // Factor Adders
80  std::shared_ptr<factor_adders::LocFactorAdder<node_adders::PoseNodeAdder>> sparse_map_loc_factor_adder_;
81  std::shared_ptr<factor_adders::LocFactorAdder<node_adders::PoseNodeAdder>> ar_tag_loc_factor_adder_;
82 
83  // Node Adders
84  std::shared_ptr<node_adders::PoseNodeAdder> pose_node_adder_;
85 };
86 } // namespace graph_localizer
87 
88 #endif // GRAPH_LOCALIZER_GRAPH_LOCALIZER_H_
graph_localizer::GraphLocalizer::AddPoseMeasurement
void AddPoseMeasurement(const localization_measurements::PoseWithCovarianceMeasurement &pose_measurement)
Definition: graph_localizer.cc:46
graph_localizer::GraphLocalizer::AddArTagMatchedProjectionsMeasurement
void AddArTagMatchedProjectionsMeasurement(const localization_measurements::MatchedProjectionsMeasurement &matched_projections_measurement)
Definition: graph_localizer.cc:56
graph_localizer::GraphLocalizer::pose_nodes
const nodes::TimestampedNodes< gtsam::Pose3 > & pose_nodes() const
Definition: graph_localizer.cc:62
sliding_window_graph_optimizer.h
graph_localizer::GraphLocalizer::SetPoseCovarianceInterpolater
void SetPoseCovarianceInterpolater(const std::shared_ptr< localization_common::MarginalsPoseCovarianceInterpolater< nodes::CombinedNavStateNodes >> &pose_covariance_interpolater)
Definition: graph_localizer.cc:64
graph_localizer::GraphLocalizer::GraphLocalizer
GraphLocalizer()
Definition: graph_localizer.h:42
matched_projections_measurement.h
pose_measurement.h
graph_localizer_params.h
graph_localizer::GraphLocalizer
Definition: graph_localizer.h:37
graph_localizer::GraphLocalizer::AddSparseMapMatchedProjectionsMeasurement
void AddSparseMapMatchedProjectionsMeasurement(const localization_measurements::MatchedProjectionsMeasurement &matched_projections_measurement)
Definition: graph_localizer.cc:50
timestamped_nodes.h
nodes::TimestampedNodes
Definition: timestamped_nodes.h:28
graph_localizer::GraphLocalizerParams
Definition: graph_localizer_params.h:31
graph_optimizer::GraphOptimizer::params
const GraphOptimizerParams & params() const
Definition: graph_optimizer.cc:96
graph_localizer
Definition: graph_localizer.h:32
loc_factor_adder.h
graph_localizer::GraphLocalizer::access
friend class boost::serialization::access
Definition: graph_localizer.h:67
sliding_window_graph_optimizer::SlidingWindowGraphOptimizer
Definition: sliding_window_graph_optimizer.h:41
localization_measurements::PoseWithCovarianceMeasurement
Definition: pose_with_covariance_measurement.h:31
localization_measurements::MatchedProjectionsMeasurement
Definition: matched_projections_measurement.h:29
localization_common::MarginalsPoseCovarianceInterpolater
Definition: marginals_pose_covariance_interpolater.h:30
pose_node_adder.h