-
Notifications
You must be signed in to change notification settings - Fork 0
/
belief_road_map_planner.hh
97 lines (78 loc) · 3.57 KB
/
belief_road_map_planner.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#pragma once
#include <optional>
#include "common/liegroups/se2.hh"
#include "common/time/robot_time.hh"
#include "experimental/beacon_sim/beacon_potential.hh"
#include "experimental/beacon_sim/ekf_slam.hh"
#include "experimental/beacon_sim/robot_belief.hh"
#include "planning/belief_road_map.hh"
#include "planning/probabilistic_road_map.hh"
namespace robot::experimental::beacon_sim {
struct BeliefRoadMapOptions {
double max_sensor_range_m;
std::optional<double> uncertainty_tolerance;
// This config controls when we switch from exact to approximate edge transforms.
// If the number of landmark presence configurations is less than or equal this amount,
// we compute the expectation exactly. If the number of configurations are greater than this,
// we sample up to this many configurations and compute the sample expectation. Note that once
// we sample the configurations for an edge, they are reused for all future edge traversals.
int max_num_edge_transforms;
std::optional<time::RobotTimestamp::duration> timeout;
};
struct PathConstrainedBeliefRoadMapOptions {
// The algorithm requires looking over all possible paths from the start to the goal. To make
// the problem tractable, we wil only consider paths that are within a multiplicative factor
// of the shortest path.
double max_path_length_ratio;
double max_sensor_range_m;
};
struct LandmarkBeliefRoadMapOptions {
struct SampledBeliefOptions {
int max_num_components;
int seed;
};
// Evaluate using expected determinant
struct ExpectedDeterminant {};
// Use the determinant at the given percentile to evaluate uncertainty
struct ValueAtRiskDeterminant {
double percentile;
};
// Compute the probability mass inside of the region as a measure of uncertainty
struct ProbMassInRegion {
double position_x_half_width_m;
double position_y_half_width_m;
double heading_half_width_rad;
};
using UncertaintySizeOptions =
std::variant<ExpectedDeterminant, ValueAtRiskDeterminant, ProbMassInRegion>;
double max_sensor_range_m;
UncertaintySizeOptions uncertainty_size_options;
std::optional<SampledBeliefOptions> sampled_belief_options;
std::optional<time::RobotTimestamp::duration> timeout;
};
struct PathConstrainedBeliefPlanResult {
std::vector<int> plan;
Eigen::Matrix3d expected_cov;
};
struct ExpectedBeliefPlanResult {
std::vector<int> nodes;
double log_probability_mass_tracked;
};
struct ExpectedBeliefRoadMapOptions {
int num_configuration_samples;
int seed;
BeliefRoadMapOptions brm_options;
};
std::optional<planning::BRMPlan<LandmarkRobotBelief>> compute_landmark_belief_road_map_plan(
const planning::RoadMap &road_map, const EkfSlam &ekf, const BeaconPotential &beacon_potential,
const LandmarkBeliefRoadMapOptions &options);
std::optional<planning::BRMPlan<RobotBelief>> compute_belief_road_map_plan(
const planning::RoadMap &road_map, const EkfSlam &ekf, const BeaconPotential &beacon_potential,
const BeliefRoadMapOptions &options);
PathConstrainedBeliefPlanResult compute_path_constrained_belief_road_map_plan(
const planning::RoadMap &road_map, const EkfSlam &ekf, const BeaconPotential &beacon_potential,
const PathConstrainedBeliefRoadMapOptions &options);
std::optional<ExpectedBeliefPlanResult> compute_expected_belief_road_map_plan(
const planning::RoadMap &road_map, const EkfSlam &ekf, const BeaconPotential &beacon_potential,
const ExpectedBeliefRoadMapOptions &options);
} // namespace robot::experimental::beacon_sim