Skip to content

Commit 95f042f

Browse files
Final minor improvements, moved the demo to 'experimental' directory
Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com> Add README for future information Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
1 parent ef2299d commit 95f042f

18 files changed

Lines changed: 53 additions & 39 deletions
File renamed without changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Beluga Multi-Hypotheses AMCL demo
2+
3+
## How the algorithm work
4+
5+
Traditional AMCL is extended by managing multiple populations of particles (each population is a hypothesis). Particles are created, destroyed, or merged based on their consistency with sensory data, choosing the best fitting hypothesis in each iteration.
6+
7+
The observation model is based on geometric transformations and projections (using the tf2 library to compute the map → odom → base_link → base_scan transformations), supporting both 2D (cells in a costmap) and 3D environments (voxels from an octree for example, or elevation costmaps, no evidence about this functionality).
8+
9+
Instead of relying on traditional uncertainty measures from the covariance matrix, the authors propose a new metric (Novel metric) that compares sensory measurements with expected values to assess consistency.
10+
11+
The particle update process is divided into prediction, correction, and reseeding, optimizing computational cost. The prediction phase happens frequently (100Hz), correction less so (10Hz), and reseeding rarely (0.3Hz):
12+
- The prediction phase remains the same as the typical particle filter.
13+
- The correction phase applies the new observation model to update the weights of the particles, using the ‘hits field’ (h) instead of the covariance matrix to compute the quality of the hypothesis.
14+
- In the reseed phase particles with less weight (losers) are replaced by particles close to those with more weight (winners). If the distribution’s covariance is high, the number of particles is increased. If it’s low, it’s decreased to save computational cost.
15+
16+
A quality value is computed (value between 0 and 1) for every set of particles (every hypothesis) and a weight is computed for every particle (this remains the same). Some hypotheses can be merged if they converge to the same pose.
17+
18+
The output of the localization system is still a mean value and a covariance calculated from the highest quality particle set.
19+
20+
The number of hypotheses is parametrized, along with other new concepts like the quality thresholds or the reseeding percentage for winners.
21+
22+
The map-matching is done with 4 levels of resolution to improve computational cost, because the next level is only computed on those cells that are candidates from the previous level. The result is a list with the candidates sorted by quality.
23+
24+
### Steps for managing the hypotheses
25+
26+
1. Start: At the start of the robot operation, P(0,t0) (first set of particles, hypothesis) is started at the robot’s initial position, if known.
27+
2. Creation: Periodically, a cascade map matching algorithm is used to determine which map positions the latest sensory readings could be obtained. If a position with a high match is found (high hit field), a new P(k,t) is started at this position.
28+
3. Destruction: If Quality(P(k,t)) is less than some threshold and |Pt| > 0, then P(k,t) is considered to be wrong, and it is removed.
29+
4. Merge: Even if two P(i,t) and P(j,t), start at different positions, they could end up converging to the same position. In this case, they are mixed in a P(k,t) containing the particles with more weight.
30+
31+
## Useful links
32+
33+
[Original Paper](https://arxiv.org/pdf/2209.07586)

localization/beluga_demo_mh_amcl/config/mh_amcl_params.yaml renamed to experimental/beluga_demo_mh_amcl/config/mh_amcl_params.yaml

File renamed without changes.

localization/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/map_matcher.hpp renamed to experimental/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/map_matcher.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ namespace mh_amcl
9292
std::vector<std::shared_ptr<beluga_ros::OccupancyGrid>> costmaps_;
9393
};
9494

95-
/**
96-
* @brief wrapper to transform the costmap to ROS Occupancy grid message
97-
*/
98-
nav_msgs::msg::OccupancyGrid
99-
toMsg(std::shared_ptr<beluga_ros::OccupancyGrid> costmap);
100-
10195
} // namespace mh_amcl
10296

10397
#endif // MH_AMCL__MAPMATCHER_HPP_

localization/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/mh_amcl.hpp renamed to experimental/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/mh_amcl.hpp

File renamed without changes.

localization/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/particles_distribution.hpp renamed to experimental/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/particles_distribution.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace mh_amcl
7676
* the particles. It's only done if laser data and costmap information are
7777
* present.
7878
*/
79-
void correct_once(const sensor_msgs::msg::LaserScan &scan);
79+
void correct(const sensor_msgs::msg::LaserScan &scan);
8080

8181
/**
8282
* @brief Particles are ordered by probability, winners and losers are

localization/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/reweight_and_update_hits_action.hpp renamed to experimental/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/reweight_and_update_hits_action.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ namespace mh_amcl::actions
7373
if (valid_beams > 0)
7474
{
7575
particle.weight += total_prob;
76+
// TODO: Review if hits should be computed like this
7677
particle.hits = total_prob / static_cast<float>(scan.ranges.size());
7778
}
7879
else

localization/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/utils.hpp renamed to experimental/beluga_demo_mh_amcl/include/beluga_demo_mh_amcl/utils.hpp

File renamed without changes.

localization/beluga_demo_mh_amcl/launch/bringup.launch.py renamed to experimental/beluga_demo_mh_amcl/launch/bringup.launch.py

File renamed without changes.

localization/beluga_demo_mh_amcl/maps/hq4_office/hq4_office.pgm renamed to experimental/beluga_demo_mh_amcl/maps/hq4_office/hq4_office.pgm

File renamed without changes.

0 commit comments

Comments
 (0)