Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
slam_node.cpp
Go to the documentation of this file.
2
3#include <tf2/LinearMath/Quaternion.h>
4
5#include <fstream>
6#include <geometry_msgs/msg/transform_stamped.hpp>
7
17#include "slam_solver/map.hpp"
18
19/*---------------------- Constructor --------------------*/
20
21SLAMNode::SLAMNode(const SLAMParameters &params) : Node("slam"), _params_(params) {
22 // Print parameters
23 RCLCPP_INFO_STREAM(this->get_logger(), "SLAM Node parameters:" << params);
24 // Initialize the models
25 std::shared_ptr<V2PMotionModel> motion_model = v2p_models_map.at(params.motion_model_name_)();
26 std::shared_ptr<DataAssociationModel> data_association =
30 params.observation_y_noise_));
31 std::shared_ptr<LandmarkFilter> landmark_filter =
35 data_association);
36
37 this->_execution_times_ = std::make_shared<std::vector<double>>(20, 0.0);
38 std::shared_ptr<LoopClosure> loop_closure = std::make_shared<LapCounter>(15, 20, 10, 2);
39
40 // Initialize SLAM solver object
42 params, data_association, motion_model, landmark_filter, this->_execution_times_,
43 loop_closure);
44
45 _perception_map_ = std::vector<common_lib::structures::Cone>();
47 _track_map_ = std::vector<common_lib::structures::Cone>();
49
50 // Subscriptions
51 if (!params.use_simulated_perception_) {
52 if (params.slam_optimization_mode_ != "sync") {
54 this->create_callback_group(rclcpp::CallbackGroupType::Reentrant);
55 rclcpp::SubscriptionOptions parallel_opts;
56 parallel_opts.callback_group = _parallel_callback_group_;
58 this->create_subscription<custom_interfaces::msg::PerceptionOutput>(
59 "/perception/cones", 1,
60 std::bind(&SLAMNode::_perception_subscription_callback, this, std::placeholders::_1),
61 parallel_opts);
62 } else {
63 this->_callback_group_ = this->create_callback_group(
64 rclcpp::CallbackGroupType::MutuallyExclusive); // Default callback group
66 this->create_subscription<custom_interfaces::msg::PerceptionOutput>(
67 "/perception/cones", 1,
68 std::bind(&SLAMNode::_perception_subscription_callback, this, std::placeholders::_1));
69 }
70 }
71 if (!params.use_simulated_velocities_) {
72 rclcpp::SubscriptionOptions subscription_options;
73 subscription_options.callback_group = this->_callback_group_;
74 this->_velocities_subscription_ = this->create_subscription<custom_interfaces::msg::Velocities>(
75 "/state_estimation/velocities", 50,
76 std::bind(&SLAMNode::_velocities_subscription_callback, this, std::placeholders::_1),
77 subscription_options);
78 }
79
80 // Publishers
81 this->_map_publisher_ =
82 this->create_publisher<custom_interfaces::msg::ConeArray>("/state_estimation/map", 10);
84 this->create_publisher<custom_interfaces::msg::Pose>("/state_estimation/vehicle_pose", 10);
86 this->create_publisher<visualization_msgs::msg::MarkerArray>(
87 "/state_estimation/visualization_map", 10);
89 this->create_publisher<visualization_msgs::msg::MarkerArray>(
90 "/state_estimation/visualization_associations", 10);
92 this->create_publisher<visualization_msgs::msg::Marker>(
93 "/state_estimation/visualization/position", 10);
95 this->create_publisher<visualization_msgs::msg::MarkerArray>(
96 "/state_estimation/visualization/trajectory", 10);
97 this->_execution_time_publisher_ = this->create_publisher<std_msgs::msg::Float64MultiArray>(
98 "/state_estimation/slam_execution_time", 10);
99 this->_covariance_publisher_ = this->create_publisher<std_msgs::msg::Float64MultiArray>(
100 "/state_estimation/slam_covariance", 10);
102 this->create_publisher<std_msgs::msg::Float64>("/state_estimation/lap_counter", 10);
103 this->_tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(this);
104
105 RCLCPP_INFO(this->get_logger(), "SLAM Node has been initialized using %s solver.",
106 params.slam_solver_name_.c_str());
107}
108
110 if (auto solver_ptr = std::dynamic_pointer_cast<NodeControllerTrait>(this->_slam_solver_)) {
111 solver_ptr->init(this->weak_from_this());
112 }
113}
114
115/*---------------------- Subscriptions --------------------*/
116
118 const custom_interfaces::msg::PerceptionOutput &msg) {
119 RCLCPP_INFO(this->get_logger(), "SLAMNode::_perception_subscription_callback called");
120 auto const &cone_array = msg.cones.cone_array;
121 double perception_exec_time = msg.exec_time;
122
123 RCLCPP_DEBUG(this->get_logger(), "SUB - Perception: %ld cones. Mission: %d", cone_array.size(),
124 static_cast<int>(this->_mission_));
125
126 {
127 std::unique_lock lock(this->mutex_);
128 if (!this->_go_ || this->_mission_ == common_lib::competition_logic::Mission::NONE) {
129 return;
130 }
131 } // Decide if start on mission or go etc...
132
133 rclcpp::Time start_time = this->get_clock()->now();
134 rclcpp::Time const cones_time =
136 ? rclcpp::Time(msg.header.stamp)
137 : start_time - rclcpp::Duration::from_seconds(perception_exec_time);
138
139 // No need for mutex because no other function uses _perception_map_
140 this->_perception_map_.clear();
141
142 if (this->_params_.slam_solver_name_ == "ekf_slam") {
143 // Needs mutex for vehicle_state_velocities
144 Eigen::Vector3d velocities;
145 {
146 std::unique_lock lock(this->mutex_);
147 velocities = Eigen::Vector3d(this->_vehicle_state_velocities_.velocity_x,
148 this->_vehicle_state_velocities_.velocity_y,
149 this->_vehicle_state_velocities_.rotational_velocity);
150 }
151
152 double theta = -velocities(2) * perception_exec_time;
153 double cos_theta = std::cos(theta);
154 double sin_theta = std::sin(theta);
155 for (auto &cone : cone_array) {
156 double x_linear_compensated = cone.position.x - velocities(0) * perception_exec_time;
157 double y_linear_compensated = cone.position.y - velocities(1) * perception_exec_time;
158 double x_compensated = cos_theta * x_linear_compensated - sin_theta * y_linear_compensated;
159 double y_compensated = sin_theta * x_linear_compensated + cos_theta * y_linear_compensated;
161 x_compensated, y_compensated, cone.color, cone.confidence, msg.header.stamp));
162 }
163 } else {
164 for (auto &cone : cone_array) {
166 cone.position.x, cone.position.y, cone.color, cone.confidence, msg.header.stamp));
167 }
168 }
169 RCLCPP_INFO(this->get_logger(), "ATTR - Perception map size: %ld", _perception_map_.size());
170
171 if (this->_slam_solver_ == nullptr) {
172 RCLCPP_WARN(this->get_logger(), "ATTR - Slam Solver object is null");
173 return;
174 }
175
176 this->_slam_solver_->add_observations(this->_perception_map_, cones_time);
177 RCLCPP_INFO(this->get_logger(), "ATTR - Observations added to SLAM solver");
178
179 std::vector<common_lib::structures::Cone> track_map;
180 common_lib::structures::Pose vehicle_pose;
181 track_map = this->_slam_solver_->get_map_estimate();
182 vehicle_pose = this->_slam_solver_->get_pose_estimate();
183 {
184 std::unique_lock lock(this->mutex_);
185 this->_track_map_ = track_map;
186 this->_vehicle_pose_ = vehicle_pose;
187 }
188
189 // Only this thread accesses _associations_, _observations_global_ and _map_coordinates_ (through
190 // _publish_associations_)
191 this->_associations_ = this->_slam_solver_->get_associations();
192 this->_observations_global_ = this->_slam_solver_->get_observations_global();
193 this->_map_coordinates_ = this->_slam_solver_->get_map_coordinates();
194
195 if (this->_is_mission_finished()) {
196 this->finish();
197 }
198 RCLCPP_INFO(this->get_logger(), "ATTR - Mission finished check done");
199
200 // this->_publish_covariance(); // TODO: get covariance to work fast. If uncommented -> update
201 // mutex logics
202
203 this->_publish_vehicle_pose();
204 this->_publish_map();
205 this->_publish_lap_counter();
206 this->_publish_associations();
207
208 // Timekeeping
209 rclcpp::Time end_time = this->get_clock()->now();
210 std_msgs::msg::Float64MultiArray execution_time_msg;
211 {
212 std::unique_lock lock(this->mutex_);
213 this->_execution_times_->at(1) = (end_time - start_time).seconds() * 1000.0;
214 execution_time_msg.data = *this->_execution_times_;
215 }
216 this->_execution_time_publisher_->publish(execution_time_msg);
217 RCLCPP_INFO(this->get_logger(), "ATTR - Perception callback finished");
218}
219
220void SLAMNode::_velocities_subscription_callback(const custom_interfaces::msg::Velocities &msg) {
221 if (this->_mission_ == common_lib::competition_logic::Mission::NONE) {
222 return;
223 }
224
225 rclcpp::Time start_time = this->get_clock()->now();
226
227 rclcpp::Time const velocities_time =
228 _params_.synchronized_timestamps ? rclcpp::Time(msg.header.stamp) : start_time;
229 if (auto solver_ptr = std::dynamic_pointer_cast<VelocitiesIntegratorTrait>(this->_slam_solver_)) {
231 msg.velocity_x, msg.velocity_y, msg.angular_velocity, msg.covariance[0], msg.covariance[4],
232 msg.covariance[8], velocities_time);
233
235 {
236 std::unique_lock lock(this->mutex_);
237 velocities = this->_vehicle_state_velocities_;
238 }
239 solver_ptr->add_velocities(velocities);
240 }
241
242 common_lib::structures::Pose vehicle_pose = this->_slam_solver_->get_pose_estimate();
243 {
244 std::unique_lock lock(this->mutex_);
245 this->_vehicle_pose_ = vehicle_pose;
246 }
247
248 // this->_publish_covariance(); // TODO: get covariance to work fast
249 this->_publish_vehicle_pose();
250
251 rclcpp::Time end_time = this->get_clock()->now();
252 std_msgs::msg::Float64MultiArray execution_time_msg;
253 {
254 std::unique_lock lock(this->mutex_);
255 this->_execution_times_->at(0) = (end_time - start_time).seconds() * 1000.0;
256 execution_time_msg.data = *this->_execution_times_;
257 }
258 this->_execution_time_publisher_->publish(execution_time_msg);
259}
260
261void SLAMNode::_imu_subscription_callback(const sensor_msgs::msg::Imu &msg) {
262 if (this->_mission_ == common_lib::competition_logic::Mission::NONE) {
263 return;
264 }
265 RCLCPP_DEBUG(this->get_logger(), "SUB - IMU data received");
266 if (auto solver_ptr = std::dynamic_pointer_cast<ImuIntegratorTrait>(this->_slam_solver_)) {
267 auto imu_data = common_lib::sensor_data::ImuData(
268 msg.angular_velocity.z, msg.linear_acceleration.x, msg.linear_acceleration.y,
269 msg.header.stamp, msg.angular_velocity_covariance[8], msg.linear_acceleration_covariance[0],
270 msg.linear_acceleration_covariance[4]);
271
272 imu_data.timestamp_ = this->get_clock()->now();
273
274 solver_ptr->add_imu_data(imu_data);
275 }
276}
277
278/*---------------------- Publications --------------------*/
279
281 auto message = custom_interfaces::msg::Pose();
282 auto tf_message = geometry_msgs::msg::TransformStamped();
283 {
284 std::unique_lock lock(this->mutex_);
285 message.x = this->_vehicle_pose_.position.x;
286 message.y = this->_vehicle_pose_.position.y;
287 message.theta = this->_vehicle_pose_.orientation;
288 }
289 // TODO(marhcouto): add covariance
290 message.header.stamp = this->get_clock()->now();
291
292 RCLCPP_DEBUG(this->get_logger(), "PUB - Pose: (%f, %f, %f)", message.x, message.y, message.theta);
293 this->_vehicle_pose_publisher_->publish(message);
294
295 // Publish the transform
296 tf_message.header.stamp = message.header.stamp;
297 tf_message.header.frame_id = "map";
298 tf_message.child_frame_id = this->_vehicle_frame_id_;
299
300 tf2::Quaternion q;
301 q.setRPY(0.0, 0.0, message.theta);
302 tf_message.transform.translation.x = message.x;
303 tf_message.transform.translation.y = message.y;
304 tf_message.transform.translation.z = 0.0;
305 tf_message.transform.rotation.x = q.x();
306 tf_message.transform.rotation.y = q.y();
307 tf_message.transform.rotation.z = q.z();
308 tf_message.transform.rotation.w = q.w();
309 this->_tf_broadcaster_->sendTransform(tf_message);
310
311 // Publish trajectory marker
312 if (this->_params_.publish_trajectory_) {
313 if (auto solver_ptr = std::dynamic_pointer_cast<TrajectoryCalculator>(this->_slam_solver_)) {
314 std::vector<common_lib::structures::Pose> trajectory = solver_ptr->get_trajectory_estimate();
315 auto marker_array_msg = visualization_msgs::msg::MarkerArray();
317 trajectory, "vehicle_trajectory", "map", "blue", "sphere");
318 this->_trajectory_visualization_publisher_->publish(marker_array_msg);
319 }
320 }
321 // Publish position marker
323 common_lib::structures::Position(message.x, message.y), "vehicle_position", 1);
324 this->_position_visualization_publisher_->publish(position_marker);
325}
326
328 auto cone_array_msg = custom_interfaces::msg::ConeArray();
329 auto marker_array_msg = visualization_msgs::msg::MarkerArray();
330 auto marker_array_msg_perception = visualization_msgs::msg::MarkerArray();
331 std::vector<common_lib::structures::Cone> track_map;
332 {
333 std::unique_lock lock(this->mutex_);
334 track_map = this->_track_map_;
335 }
336 for (common_lib::structures::Cone const &cone : track_map) {
337 auto cone_message = custom_interfaces::msg::Cone();
338 cone_message.position.x = cone.position.x;
339 cone_message.position.y = cone.position.y;
340 // TODO: add covariance & large cones & confidence
341 cone_message.color = common_lib::competition_logic::get_color_string(cone.color);
342 cone_array_msg.cone_array.push_back(cone_message);
343 // RCLCPP_DEBUG(this->get_logger(), "(%f\t%f)\t%s", cone_message.position.x,
344 // cone_message.position.y, cone_message.color.c_str());
345 }
346 // RCLCPP_DEBUG(this->get_logger(), "--------------------------------------");
347 cone_array_msg.header.stamp = this->get_clock()->now();
348 this->_map_publisher_->publish(cone_array_msg);
349 marker_array_msg =
351 this->_visualization_map_publisher_->publish(marker_array_msg);
352}
353
355 // Publish the covariance
356 std_msgs::msg::Float64MultiArray covariance_msg;
357 covariance_msg.layout = std_msgs::msg::MultiArrayLayout();
358 covariance_msg.layout.dim.push_back(std_msgs::msg::MultiArrayDimension());
359 covariance_msg.layout.dim[0].size = this->_slam_solver_->get_covariance().rows();
360 covariance_msg.layout.dim[0].stride =
361 this->_slam_solver_->get_covariance().rows() * this->_slam_solver_->get_covariance().cols();
362 covariance_msg.layout.dim[0].label = "rows";
363 covariance_msg.layout.dim.push_back(std_msgs::msg::MultiArrayDimension());
364 covariance_msg.layout.dim[1].size = this->_slam_solver_->get_covariance().cols();
365 covariance_msg.layout.dim[1].stride = this->_slam_solver_->get_covariance().cols();
366 covariance_msg.layout.dim[1].label = "cols";
367 Eigen::MatrixXd covariance_matrix = this->_slam_solver_->get_covariance();
368 for (unsigned int i = 0; i < covariance_matrix.rows(); i++) {
369 for (unsigned int j = 0; j < covariance_matrix.cols(); j++) {
370 covariance_msg.data.push_back(covariance_matrix(i, j));
371 }
372 }
373 this->_covariance_publisher_->publish(covariance_msg);
374}
375
377 std_msgs::msg::Float64 lap_counter_msg;
378 lap_counter_msg.data = this->_slam_solver_->get_lap_counter();
379 this->_lap_counter_publisher_->publish(lap_counter_msg);
380}
381
383 auto marker_array_msg = visualization_msgs::msg::MarkerArray();
384 RCLCPP_DEBUG(this->get_logger(), "PUB - Associations %ld", this->_associations_.size());
385 // Add a DELETE_ALL marker to clear previous markers
386 visualization_msgs::msg::Marker clear_marker;
387 clear_marker.header.frame_id = "map";
388 clear_marker.header.stamp = this->now();
389 clear_marker.ns = "associations";
390 clear_marker.id = 0;
391 clear_marker.action = visualization_msgs::msg::Marker::DELETEALL;
392 marker_array_msg.markers.push_back(clear_marker);
393
394 for (int i = 0; i < this->_associations_.size(); i++) {
395 if (this->_associations_[i] >= 0) {
396 double observation_x = this->_observations_global_[i * 2];
397 double observation_y = this->_observations_global_[i * 2 + 1];
398 double map_x = this->_map_coordinates_[this->_associations_[i]];
399 double map_y = this->_map_coordinates_[this->_associations_[i] + 1];
400
401 visualization_msgs::msg::Marker marker;
402 marker.header.frame_id = "map"; // change frame_id if needed
403 marker.header.stamp = this->now();
404 marker.ns = "associations";
405 marker.id = i;
406 marker.type = visualization_msgs::msg::Marker::ARROW;
407 marker.action = visualization_msgs::msg::Marker::ADD;
408
409 geometry_msgs::msg::Point start, end;
410 start.x = observation_x;
411 start.y = observation_y;
412 start.z = 0.0;
413 end.x = map_x;
414 end.y = map_y;
415 end.z = 0.0;
416
417 marker.points.push_back(start);
418 marker.points.push_back(end);
419
420 marker.scale.x = 0.15; // shaft diameter
421 marker.scale.y = 0.04; // head diameter
422 marker.scale.z = 0.01; // head length
423
424 marker.color.r = 1.0;
425 marker.color.g = 1.0;
426 marker.color.b = 1.0;
427 marker.color.a = 1.0;
428
429 marker_array_msg.markers.push_back(marker);
430 }
431 }
432 this->_associations_visualization_publisher_->publish(marker_array_msg);
433}
434
435/* -------------- Checks if the mission is finished --------*/
437 {
438 std::unique_lock lock(this->mutex_);
439 if (this->_vehicle_state_velocities_.velocity_x > 0.1 ||
440 this->_vehicle_state_velocities_.velocity_y > 0.1 ||
441 this->_vehicle_state_velocities_.rotational_velocity > 0.05) {
442 return false;
443 }
444
445 if (this->_mission_ == common_lib::competition_logic::Mission::ACCELERATION &&
446 this->_vehicle_pose_.position.x > 75.0) {
447 return true;
448 }
449 if (this->_mission_ == common_lib::competition_logic::Mission::SKIDPAD &&
450 this->_vehicle_pose_.position.x > 22.0) {
451 return true;
452 }
453 }
454 if (this->_mission_ == common_lib::competition_logic::Mission::AUTOCROSS &&
455 this->_slam_solver_->get_lap_counter() >= 1) {
456 return true;
457 }
458 if (this->_mission_ == common_lib::competition_logic::Mission::TRACKDRIVE &&
459 this->_slam_solver_->get_lap_counter() >= 10) {
460 return true;
461 }
462 return false;
463}
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr _visualization_map_publisher_
Definition slam_node.hpp:44
Eigen::VectorXd _map_coordinates_
Coordinates of the cones in the map.
Definition slam_node.hpp:71
common_lib::structures::Velocities _vehicle_state_velocities_
Definition slam_node.hpp:67
std::shared_mutex mutex_
Definition slam_node.hpp:61
std::vector< common_lib::structures::Cone > _perception_map_
Definition slam_node.hpp:66
rclcpp::Subscription< custom_interfaces::msg::PerceptionOutput >::SharedPtr _perception_subscription_
Definition slam_node.hpp:40
SLAMParameters _params_
Definition slam_node.hpp:80
std::string _vehicle_frame_id_
Frame id of the vehicle for the transform.
Definition slam_node.hpp:79
rclcpp::CallbackGroup::SharedPtr _callback_group_
Callback group for subscriptions, used to control if they are concurrent or not.
Definition slam_node.hpp:37
std::shared_ptr< std::vector< double > > _execution_times_
Definition slam_node.hpp:74
void _publish_lap_counter()
publishes the lap counter
rclcpp::Subscription< custom_interfaces::msg::Velocities >::SharedPtr _velocities_subscription_
Definition slam_node.hpp:41
virtual void finish()=0
Finish the mission.
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr _trajectory_visualization_publisher_
Publishes full vehicle trajectory.
Definition slam_node.hpp:48
std::shared_ptr< tf2_ros::TransformBroadcaster > _tf_broadcaster_
Definition slam_node.hpp:63
rclcpp::Publisher< visualization_msgs::msg::Marker >::SharedPtr _position_visualization_publisher_
Publishes the vehicle position.
Definition slam_node.hpp:46
void _publish_vehicle_pose()
publishes the localization ('vehicle_pose') to the topic vehicle_pose
common_lib::competition_logic::Mission _mission_
Definition slam_node.hpp:76
void _velocities_subscription_callback(const custom_interfaces::msg::Velocities &msg)
Callback that updates everytime information is received from velocity estimation node.
rclcpp::Publisher< custom_interfaces::msg::Pose >::SharedPtr _vehicle_pose_publisher_
Definition slam_node.hpp:42
void _publish_covariance()
publishes the covariance of the state
Eigen::VectorXd _observations_global_
Global observations of the cones.
Definition slam_node.hpp:70
bool _go_
Definition slam_node.hpp:77
Eigen::VectorXi _associations_
Definition slam_node.hpp:69
SLAMNode(const SLAMParameters &params)
Constructor that uses the parameters structure.
Definition slam_node.cpp:21
rclcpp::CallbackGroup::SharedPtr _parallel_callback_group_
Definition slam_node.hpp:59
void _publish_associations()
Publishes the visualization of the associations by data association.
rclcpp::Publisher< std_msgs::msg::Float64MultiArray >::SharedPtr _covariance_publisher_
Publishes the covariance of the pose.
Definition slam_node.hpp:53
void _publish_map()
publishes the map ('track_map') to the topic track_map
void _perception_subscription_callback(const custom_interfaces::msg::PerceptionOutput &msg)
Callback that updates everytime information is received from the perception module.
rclcpp::Publisher< std_msgs::msg::Float64MultiArray >::SharedPtr _execution_time_publisher_
Definition slam_node.hpp:51
rclcpp::Publisher< std_msgs::msg::Float64 >::SharedPtr _lap_counter_publisher_
Definition slam_node.hpp:55
common_lib::structures::Pose _vehicle_pose_
Definition slam_node.hpp:72
rclcpp::Publisher< custom_interfaces::msg::ConeArray >::SharedPtr _map_publisher_
Definition slam_node.hpp:43
bool _is_mission_finished()
Checks if the mission is finished.
void _imu_subscription_callback(const sensor_msgs::msg::Imu &msg)
Callback that updates everytime information is received from the IMU.
std::vector< common_lib::structures::Cone > _track_map_
Definition slam_node.hpp:68
std::shared_ptr< SLAMSolver > _slam_solver_
SLAM solver object.
Definition slam_node.hpp:65
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr _associations_visualization_publisher_
Definition slam_node.hpp:50
void init()
Initialize functions @description This method is used to initialize things that require the construct...
const std::map< std::string, std::function< std::shared_ptr< V2PMotionModel >()>, std::less<> > v2p_models_map
Definition map.hpp:17
visualization_msgs::msg::MarkerArray marker_array_from_structure_array(const std::vector< T > &structure_array, const std::string &name_space, const std::string &frame_id, const std::string &color="red", const std::string &shape="cylinder", float scale=0.5, int action=visualization_msgs::msg::Marker::MODIFY)
Converts a vector of cones to a marker array.
Definition marker.hpp:79
visualization_msgs::msg::Marker marker_from_position(const common_lib::structures::Position &position, const std::string &name_space, const int id, const std::string &color="red", float scale=0.5, const std::string &frame_id="map", const std::string &shape="sphere", int action=visualization_msgs::msg::Marker::ADD)
Converts a position to a marker.
Definition marker.cpp:5
std::string get_color_string(int color)
Definition color.cpp:16
const std::map< std::string, std::function< std::shared_ptr< DataAssociationModel >(const DataAssociationParameters &)>, std::less<> > data_association_models_map
Map of data association models, with the key being the name of the data association model and the val...
Definition map.hpp:21
const std::map< std::string, std::function< std::shared_ptr< LandmarkFilter >(const LandmarkFilterParameters &, std::shared_ptr< DataAssociationModel >)>, std::less<> > landmark_filters_map
Map of landmark filters, with the key being the name of the landmark filter and the value being a lam...
Definition map.hpp:19
const std::map< std::string, std::function< std::shared_ptr< SLAMSolver >(const SLAMParameters &, std::shared_ptr< DataAssociationModel >, std::shared_ptr< V2PMotionModel >, std::shared_ptr< LandmarkFilter >, std::shared_ptr< std::vector< double > >, std::shared_ptr< LoopClosure >)>, std::less<> > slam_solver_constructors_map
Definition map.hpp:20
Parameters for the SLAM node.
double data_association_gate_
double minimum_frequency_of_detections_
float data_association_limit_distance_
std::string motion_model_name_
std::string slam_optimization_mode_
std::string slam_solver_name_
std::string landmark_filter_name_
double new_landmark_confidence_gate_
std::string data_association_model_name_
Struct for pose representation.
Definition pose.hpp:13