slam_toolbox_lifelong.hpp
Go to the documentation of this file.
1 /*
2  * slam_toolbox
3  * Copyright (c) 2019, Samsung Research America
4  *
5  * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
6  * COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
7  * COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
8  * AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
9  *
10  * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO
11  * BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS
12  * CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
13  * CONDITIONS.
14  *
15  */
16 
17 /* Author: Steven Macenski */
18 
19 #ifndef SLAM_TOOLBOX_SLAM_TOOLBOX_LIFELONG_H_
20 #define SLAM_TOOLBOX_SLAM_TOOLBOX_LIFELONG_H_
21 
23 
24 namespace slam_toolbox
25 {
26 
27 using namespace ::karto;
28 
30 {
31 public:
34 
35  // computation metrics
36  double computeObjectiveScore(const double& intersect_over_union, const double& area_overlap, const double& reading_overlap, const int& num_constraints, const double& initial_score, const int& num_candidates) const;
37  static double computeIntersect(LocalizedRangeScan* s1, LocalizedRangeScan* s2);
38  static double computeIntersectOverUnion(LocalizedRangeScan* s1, LocalizedRangeScan* s2);
39  static double computeAreaOverlapRatio(LocalizedRangeScan* ref_scan, LocalizedRangeScan* candidate_scan);
40  static double computeReadingOverlapRatio(LocalizedRangeScan* ref_scan, LocalizedRangeScan* candidate_scan);
41  static void computeIntersectBounds(LocalizedRangeScan* s1, LocalizedRangeScan* s2, double& x_l, double& x_u, double& y_l, double& y_u);
42 
43 protected:
44  virtual void laserCallback(
45  const sensor_msgs::LaserScan::ConstPtr& scan) override final;
46  virtual bool deserializePoseGraphCallback(
47  slam_toolbox_msgs::DeserializePoseGraph::Request& req,
48  slam_toolbox_msgs::DeserializePoseGraph::Response& resp) override final;
49 
50  void evaluateNodeDepreciation(LocalizedRangeScan* range_scan);
51  void removeFromSlamGraph(Vertex<LocalizedRangeScan>* vertex);
52  double computeScore(LocalizedRangeScan* reference_scan, Vertex<LocalizedRangeScan>* candidate, const double& initial_score, const int& num_candidates);
53  ScoredVertices computeScores(Vertices& near_scans, LocalizedRangeScan* range_scan);
54  Vertices FindScansWithinRadius(LocalizedRangeScan* scan, const double& radius);
55  void updateScoresSlamGraph(const double& score, Vertex<LocalizedRangeScan>* vertex);
56  void checkIsNotNormalized(const double& value);
57 
58  bool use_tree_;
59  double iou_thresh_;
64  double iou_match_;
66 };
67 
68 }
69 
70 #endif //SLAM_TOOLBOX_SLAM_TOOLBOX_LIFELONG_H_
slam_toolbox::SlamToolbox
Definition: slam_toolbox_common.hpp:55
slam_toolbox::LifelongSlamToolbox::nearby_penalty_
double nearby_penalty_
Definition: slam_toolbox_lifelong.hpp:65
slam_toolbox::LifelongSlamToolbox::computeScores
ScoredVertices computeScores(Vertices &near_scans, LocalizedRangeScan *range_scan)
Definition: slam_toolbox_lifelong.cpp:255
slam_toolbox::LifelongSlamToolbox::deserializePoseGraphCallback
virtual bool deserializePoseGraphCallback(slam_toolbox_msgs::DeserializePoseGraph::Request &req, slam_toolbox_msgs::DeserializePoseGraph::Response &resp) override final
Definition: slam_toolbox_lifelong.cpp:320
slam_toolbox_common.hpp
slam_toolbox::LifelongSlamToolbox::~LifelongSlamToolbox
~LifelongSlamToolbox()
Definition: slam_toolbox_lifelong.hpp:33
slam_toolbox::LifelongSlamToolbox::candidates_scale_
double candidates_scale_
Definition: slam_toolbox_lifelong.hpp:63
slam_toolbox::LifelongSlamToolbox::FindScansWithinRadius
Vertices FindScansWithinRadius(LocalizedRangeScan *scan, const double &radius)
Definition: slam_toolbox_lifelong.cpp:137
toolbox_types::ScoredVertices
std::vector< ScoredVertex > ScoredVertices
Definition: toolbox_types.hpp:72
slam_toolbox::LifelongSlamToolbox::use_tree_
bool use_tree_
Definition: slam_toolbox_lifelong.hpp:58
toolbox_types::Vertices
std::vector< karto::Vertex< karto::LocalizedRangeScan > * > Vertices
Definition: toolbox_types.hpp:73
slam_toolbox::LifelongSlamToolbox::checkIsNotNormalized
void checkIsNotNormalized(const double &value)
Definition: slam_toolbox_lifelong.cpp:25
slam_toolbox::LifelongSlamToolbox::computeIntersectOverUnion
static double computeIntersectOverUnion(LocalizedRangeScan *s1, LocalizedRangeScan *s2)
Definition: slam_toolbox_lifelong.cpp:381
slam_toolbox::LifelongSlamToolbox::evaluateNodeDepreciation
void evaluateNodeDepreciation(LocalizedRangeScan *range_scan)
Definition: slam_toolbox_lifelong.cpp:99
slam_toolbox::LifelongSlamToolbox::LifelongSlamToolbox
LifelongSlamToolbox(ros::NodeHandle &nh)
Definition: slam_toolbox_lifelong.cpp:36
slam_toolbox::LifelongSlamToolbox::laserCallback
virtual void laserCallback(const sensor_msgs::LaserScan::ConstPtr &scan) override final
Definition: slam_toolbox_lifelong.cpp:68
slam_toolbox::LifelongSlamToolbox::computeScore
double computeScore(LocalizedRangeScan *reference_scan, Vertex< LocalizedRangeScan > *candidate, const double &initial_score, const int &num_candidates)
Definition: slam_toolbox_lifelong.cpp:216
slam_toolbox::LifelongSlamToolbox::computeAreaOverlapRatio
static double computeAreaOverlapRatio(LocalizedRangeScan *ref_scan, LocalizedRangeScan *candidate_scan)
Definition: slam_toolbox_lifelong.cpp:400
slam_toolbox::LifelongSlamToolbox::iou_thresh_
double iou_thresh_
Definition: slam_toolbox_lifelong.hpp:59
slam_toolbox::LifelongSlamToolbox::removal_score_
double removal_score_
Definition: slam_toolbox_lifelong.hpp:60
slam_toolbox::LifelongSlamToolbox
Definition: slam_toolbox_lifelong.hpp:29
slam_toolbox::LifelongSlamToolbox::computeIntersectBounds
static void computeIntersectBounds(LocalizedRangeScan *s1, LocalizedRangeScan *s2, double &x_l, double &x_u, double &y_l, double &y_u)
Definition: slam_toolbox_lifelong.cpp:336
slam_toolbox
Definition: slam_toolbox_lifelong.hpp:24
slam_toolbox::LifelongSlamToolbox::overlap_scale_
double overlap_scale_
Definition: slam_toolbox_lifelong.hpp:61
slam_toolbox::LifelongSlamToolbox::computeReadingOverlapRatio
static double computeReadingOverlapRatio(LocalizedRangeScan *ref_scan, LocalizedRangeScan *candidate_scan)
Definition: slam_toolbox_lifelong.cpp:418
slam_toolbox::LifelongSlamToolbox::constraint_scale_
double constraint_scale_
Definition: slam_toolbox_lifelong.hpp:62
slam_toolbox::LifelongSlamToolbox::iou_match_
double iou_match_
Definition: slam_toolbox_lifelong.hpp:64
slam_toolbox::LifelongSlamToolbox::removeFromSlamGraph
void removeFromSlamGraph(Vertex< LocalizedRangeScan > *vertex)
Definition: slam_toolbox_lifelong.cpp:296
slam_toolbox::LifelongSlamToolbox::computeIntersect
static double computeIntersect(LocalizedRangeScan *s1, LocalizedRangeScan *s2)
Definition: slam_toolbox_lifelong.cpp:364
slam_toolbox::LifelongSlamToolbox::updateScoresSlamGraph
void updateScoresSlamGraph(const double &score, Vertex< LocalizedRangeScan > *vertex)
Definition: slam_toolbox_lifelong.cpp:311
ros::NodeHandle
slam_toolbox::LifelongSlamToolbox::computeObjectiveScore
double computeObjectiveScore(const double &intersect_over_union, const double &area_overlap, const double &reading_overlap, const int &num_constraints, const double &initial_score, const int &num_candidates) const
Definition: slam_toolbox_lifelong.cpp:160
karto
Definition: Karto.h:88


slam_toolbox
Author(s): Steve Macenski
autogenerated on Thu Jan 11 2024 03:37:56