Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
general_config.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <rclcpp/rclcpp.hpp>
5#include <string>
6
8
15 std::string motion_model_name_ = "constant_velocity";
16 std::string pose_updater_name_ = "base_pose_updater"; // Name of the pose updater object,
17 // responsible for keeping pose estimate
18 int max_pose_history_updater = 30; // Maximum number of poses to keep in the pose buffer
19 int max_pose_history_graph = 50; // Maximum number of graphed poses to keep in the graph buffer
21 true; // Whether motion and observation data are synchronized timestamps or not
22 std::string data_association_model_name_ = "nearest_neighbor";
23 std::string lidar_odometry_topic_ = "/fast_limo/state"; // Topic for pose from lidar odometry
24 bool receive_lidar_odometry_ = false; // Whether to use lidar odometry topic or not
25 std::string slam_solver_name_ = "graph_slam";
26 std::string landmark_filter_name_ = "consecutive_count";
27 std::string frame_id_ = "map"; // Frame for the map
29 70; // maximum distance to consider a cone for data association
31 0.01; // standard deviation of the observation noise in x (range in Graph SLAM)
33 0.01; // standard deviation of the observation noise in y (bearing in Graph SLAM)
34 float velocity_x_noise_ = 0.1;
35 float velocity_y_noise_ = 0.1;
38 double pose_x_initial_noise_ = 0.1; // Initial noise for the pose x
39 double pose_y_initial_noise_ = 0.1; // Initial noise for the pose y
40 double pose_theta_initial_noise_ = 0.1; // Initial noise for the pose theta
41 double preloaded_map_noise_ = 0.1; // Noise for preloaded map landmarks
44 bool using_preloaded_map_ = false; // Use preloaded map for SLAM
46 0.3; //< Minimum pose difference to add a new pose to the graph
47 double slam_optimization_period_ = 0.0; //< Period for running optimization of the graph (s),
48 // 0.0 means optimization on observations receival
49 std::string slam_optimization_type_ = "normal_levenberg";
50 std::string slam_optimization_mode_ = "sync";
51 bool slam_optimization_in_poses_ = false; // Whether to optimize when adding poses or not
52
55 std::string slam_isam2_factorization_ = "QR";
56 unsigned int sliding_window_size_ = 5;
57 bool publish_trajectory_ = false; // Whether to publish the trajectory of the graph SLAM
58
59 // Loop closure parameters
60 double threshold_dist = 4.0; // Distance around origin to trigger loop closure
61 int first_x_cones = 10; // consider a loop if you see any of these first X cones
62 int border_width = 5; // distance to givve to start searching for loop closure again
63 int minimum_confidence = 3; // minimum number of observations to confirm loop closure
64
65 // Perception filter parameters
66 SLAMParameters() = default;
68 3; // Minimum number of times a landmark must be observed to be added to the map
70 5; // Minimum frequency of the detections of a landmark to add it to the map
71
72 SLAMParameters(const SLAMParameters &params);
73
79 std::string load_config();
80
90
97 friend std::ostream &operator<<(std::ostream &os, const SLAMParameters &params) {
98 os << "SLAMParameters: {"
99 << ", frame_id_: " << params.frame_id_
100 << "use_simulated_perception_: " << params.use_simulated_perception_
101 << ", use_simulated_velocities_: " << params.use_simulated_velocities_
102 << ", motion_model_name_: " << params.motion_model_name_
103 << ", pose_updater_name_: " << params.pose_updater_name_
104 << ", landmark_filter_name_: " << params.landmark_filter_name_
105 << ", lidar_odometry_topic_: " << params.lidar_odometry_topic_
106 << ", receive_lidar_odometry_: " << params.receive_lidar_odometry_
107 << ", data_association_model_name_: " << params.data_association_model_name_
108 << ", data_association_limit_distance_: " << params.data_association_limit_distance_
109 << ", data_association_gate_: " << params.data_association_gate_
110 << ", new_landmark_confidence_gate_: " << params.new_landmark_confidence_gate_
111 << ", observation_x_noise_: " << params.observation_x_noise_
112 << ", observation_y_noise_: " << params.observation_y_noise_
113 << ", velocity_x_noise_: " << params.velocity_x_noise_
114 << ", velocity_y_noise_: " << params.velocity_y_noise_
115 << ", imu_acceleration_x_noise_: " << params.imu_acceleration_x_noise_
116 << ", pose_x_initial_noise_: " << params.pose_x_initial_noise_
117 << ", pose_y_initial_noise_: " << params.pose_y_initial_noise_
118 << ", pose_theta_initial_noise_: " << params.pose_theta_initial_noise_
119 << ", angular_velocity_noise_: " << params.angular_velocity_noise_
120 << ", using_preloaded_map_: " << params.using_preloaded_map_
121 << ", slam_solver_name_: " << params.slam_solver_name_
122 << ", slam_min_pose_difference_: " << params.slam_min_pose_difference_
123 << ", slam_optimization_mode_: " << params.slam_optimization_mode_
124 << ", slam_optimization_type_: " << params.slam_optimization_type_
125 << ", slam_optimization_in_poses_: " << params.slam_optimization_in_poses_
126 << ", slam_optimization_period_: " << params.slam_optimization_period_
127 << ", preloaded_map_noise_: " << params.preloaded_map_noise_
128 << ", sliding_window_size_: " << params.sliding_window_size_
129 << ", slam_isam2_relinearize_threshold_: " << params.slam_isam2_relinearize_threshold_
130 << ", slam_isam2_relinearize_skip_: " << params.slam_isam2_relinearize_skip_
131 << ", slam_isam2_factorization_: " << params.slam_isam2_factorization_
132 << ", minimum_observation_count_: " << params.minimum_observation_count_
133 << ", minimum_frequency_of_detections_: " << params.minimum_frequency_of_detections_
134 << ", threshold_dist: " << params.threshold_dist
135 << ", first_x_cones: " << params.first_x_cones << ", border_width: " << params.border_width
136 << ", synchronized_timestamps: " << params.synchronized_timestamps
137 << ", max_pose_history_updater: " << params.max_pose_history_updater
138 << ", max_pose_history_graph: " << params.max_pose_history_graph
139 << ", minimum_confidence: " << params.minimum_confidence << "}";
140 return os;
141 }
142
149};
Parameters for the SLAM node.
double data_association_gate_
friend std::ostream & operator<<(std::ostream &os, const SLAMParameters &params)
Overload the output stream operator for SLAMParameters.
double minimum_frequency_of_detections_
float data_association_limit_distance_
float imu_acceleration_x_noise_
double slam_isam2_relinearize_skip_
std::string motion_model_name_
std::string slam_optimization_mode_
unsigned int sliding_window_size_
SLAMParameters & operator=(const SLAMParameters &other)
Overload the assignment operator for SLAMParameters.
std::string slam_solver_name_
double slam_isam2_relinearize_threshold_
double pose_x_initial_noise_
float angular_velocity_noise_
std::string landmark_filter_name_
std::string slam_isam2_factorization_
double pose_y_initial_noise_
bool slam_optimization_in_poses_
double slam_optimization_period_
std::string frame_id_
SLAMParameters()=default
double pose_theta_initial_noise_
double preloaded_map_noise_
DataAssociationParameters get_data_association_parameters()
Get data association parameters.
double new_landmark_confidence_gate_
std::string slam_optimization_type_
double slam_min_pose_difference_
std::string data_association_model_name_
std::string pose_updater_name_
std::string load_config()
Load the configuration for the SLAM node from YAML file.
std::string lidar_odometry_topic_