Swarm-SLAM
1.0.0
C-SLAM Framework
|
#include <decentralized_pgo.h>
Public Member Functions | |
DecentralizedPGO (std::shared_ptr< rclcpp::Node > &node) | |
Initialization of parameters and ROS 2 objects. More... | |
~DecentralizedPGO () | |
void | odometry_callback (const cslam_common_interfaces::msg::KeyframeOdom::ConstSharedPtr msg) |
Receives odometry msg + keyframe id. More... | |
void | inter_robot_loop_closure_callback (const cslam_common_interfaces::msg::InterRobotLoopClosure::ConstSharedPtr msg) |
Receives inter-robot loop closures. More... | |
void | intra_robot_loop_closure_callback (const cslam_common_interfaces::msg::IntraRobotLoopClosure::ConstSharedPtr msg) |
Receives intra-robot loop closures. More... | |
void | current_neighbors_callback (const cslam_common_interfaces::msg::RobotIdsAndOrigin::ConstSharedPtr msg) |
Receives current neighbors. More... | |
cslam_common_interfaces::msg::PoseGraph | fill_pose_graph_msg () |
Fill a PoseGraph message with the local data. More... | |
cslam_common_interfaces::msg::PoseGraph | fill_pose_graph_msg (const cslam_common_interfaces::msg::RobotIds &msg) |
Fill a PoseGraph message with the local data. More... | |
void | get_pose_graph_callback (const cslam_common_interfaces::msg::RobotIds::ConstSharedPtr msg) |
Receives request for pose graph. More... | |
void | pose_graph_callback (const cslam_common_interfaces::msg::PoseGraph::ConstSharedPtr msg) |
Receives pose graph. More... | |
void | optimized_estimates_callback (const cslam_common_interfaces::msg::OptimizationResult::ConstSharedPtr msg) |
Receives estimates from the optimizer. More... | |
void | write_current_estimates_callback (const std_msgs::msg::String::ConstSharedPtr msg) |
Prints current estimates. More... | |
void | optimization_callback () |
Starts pose graph optimization process every X ms (defined in config) More... | |
void | optimization_loop_callback () |
Step execution of the optimization State Machine. More... | |
void | update_transform_to_origin (const gtsam::Pose3 &pose) |
Update transform to origin. More... | |
void | broadcast_tf_callback () |
Broadcast tf to current origin point. More... | |
void | start_optimization () |
Performs pose graph optimization. More... | |
void | resquest_current_neighbors () |
Request to check the current neighbors. More... | |
void | reinitialize_received_pose_graphs () |
Sets received pose graphs to false. More... | |
bool | check_received_pose_graphs () |
Check if received all pose graphs. More... | |
void | start_waiting () |
Start waiting. More... | |
bool | check_waiting_timeout () |
Check waiting timeout. More... | |
void | end_waiting () |
End waiting. More... | |
bool | is_waiting () |
Check if waiting. More... | |
std::map< unsigned int, bool > | connected_robot_pose_graph () |
Breadth First Seach to check connectivity. More... | |
std::pair< gtsam::NonlinearFactorGraph::shared_ptr, gtsam::Values::shared_ptr > | aggregate_pose_graphs () |
Put all connected pose graphs into one. More... | |
void | share_optimized_estimates (const gtsam::Values &estimates) |
Shares optimizes estimates with the robots concerned. More... | |
void | heartbeat_timer_callback () |
Publish heartbeat message periodically. More... | |
void | visualization_callback () |
Publish heartbeat message periodically. More... | |
bool | is_optimizer () |
Check if the local robot is the optimizer according to the specified priority rule Default priority rule: lowest ID. More... | |
gtsam::Values | optimize (const gtsam::NonlinearFactorGraph::shared_ptr &graph, const gtsam::Values::shared_ptr &initial) |
Pose graph optimization function. More... | |
void | check_result_and_finish_optimization () |
Check if the optimization is finished. More... | |
Definition at line 64 of file decentralized_pgo.h.
DecentralizedPGO::DecentralizedPGO | ( | std::shared_ptr< rclcpp::Node > & | node | ) |
Initialization of parameters and ROS 2 objects.
node | ROS 2 node handle |
Definition at line 9 of file decentralized_pgo.cpp.
|
inline |
Definition at line 73 of file decentralized_pgo.h.
std::pair< gtsam::NonlinearFactorGraph::shared_ptr, gtsam::Values::shared_ptr > DecentralizedPGO::aggregate_pose_graphs | ( | ) |
Put all connected pose graphs into one.
Definition at line 556 of file decentralized_pgo.cpp.
void DecentralizedPGO::broadcast_tf_callback | ( | ) |
Broadcast tf to current origin point.
Definition at line 755 of file decentralized_pgo.cpp.
bool DecentralizedPGO::check_received_pose_graphs | ( | ) |
Check if received all pose graphs.
Definition at line 223 of file decentralized_pgo.cpp.
void DecentralizedPGO::check_result_and_finish_optimization | ( | ) |
Check if the optimization is finished.
Definition at line 858 of file decentralized_pgo.cpp.
bool DecentralizedPGO::check_waiting_timeout | ( | ) |
Check waiting timeout.
Definition at line 533 of file decentralized_pgo.cpp.
std::map< unsigned int, bool > DecentralizedPGO::connected_robot_pose_graph | ( | ) |
Breadth First Seach to check connectivity.
Definition at line 464 of file decentralized_pgo.cpp.
void DecentralizedPGO::current_neighbors_callback | ( | const cslam_common_interfaces::msg::RobotIdsAndOrigin::ConstSharedPtr | msg | ) |
Receives current neighbors.
msg |
Definition at line 332 of file decentralized_pgo.cpp.
void DecentralizedPGO::end_waiting | ( | ) |
End waiting.
Definition at line 529 of file decentralized_pgo.cpp.
cslam_common_interfaces::msg::PoseGraph DecentralizedPGO::fill_pose_graph_msg | ( | ) |
Fill a PoseGraph message with the local data.
Definition at line 370 of file decentralized_pgo.cpp.
cslam_common_interfaces::msg::PoseGraph DecentralizedPGO::fill_pose_graph_msg | ( | const cslam_common_interfaces::msg::RobotIds & | msg | ) |
Fill a PoseGraph message with the local data.
Definition at line 376 of file decentralized_pgo.cpp.
void DecentralizedPGO::get_pose_graph_callback | ( | const cslam_common_interfaces::msg::RobotIds::ConstSharedPtr | msg | ) |
Receives request for pose graph.
msg |
Definition at line 430 of file decentralized_pgo.cpp.
void DecentralizedPGO::heartbeat_timer_callback | ( | ) |
Publish heartbeat message periodically.
Definition at line 683 of file decentralized_pgo.cpp.
void DecentralizedPGO::inter_robot_loop_closure_callback | ( | const cslam_common_interfaces::msg::InterRobotLoopClosure::ConstSharedPtr | msg | ) |
Receives inter-robot loop closures.
msg |
Definition at line 290 of file decentralized_pgo.cpp.
void DecentralizedPGO::intra_robot_loop_closure_callback | ( | const cslam_common_interfaces::msg::IntraRobotLoopClosure::ConstSharedPtr | msg | ) |
Receives intra-robot loop closures.
msg |
Definition at line 268 of file decentralized_pgo.cpp.
bool DecentralizedPGO::is_optimizer | ( | ) |
Check if the local robot is the optimizer according to the specified priority rule Default priority rule: lowest ID.
Definition at line 347 of file decentralized_pgo.cpp.
bool DecentralizedPGO::is_waiting | ( | ) |
Check if waiting.
Definition at line 531 of file decentralized_pgo.cpp.
void DecentralizedPGO::odometry_callback | ( | const cslam_common_interfaces::msg::KeyframeOdom::ConstSharedPtr | msg | ) |
Receives odometry msg + keyframe id.
msg |
Definition at line 233 of file decentralized_pgo.cpp.
void DecentralizedPGO::optimization_callback | ( | ) |
Starts pose graph optimization process every X ms (defined in config)
Definition at line 544 of file decentralized_pgo.cpp.
void DecentralizedPGO::optimization_loop_callback | ( | ) |
Step execution of the optimization State Machine.
Definition at line 884 of file decentralized_pgo.cpp.
gtsam::Values DecentralizedPGO::optimize | ( | const gtsam::NonlinearFactorGraph::shared_ptr & | graph, |
const gtsam::Values::shared_ptr & | initial | ||
) |
Pose graph optimization function.
graph | pose graph |
initial | initial values |
Definition at line 797 of file decentralized_pgo.cpp.
void DecentralizedPGO::optimized_estimates_callback | ( | const cslam_common_interfaces::msg::OptimizationResult::ConstSharedPtr | msg | ) |
Receives estimates from the optimizer.
msg |
Definition at line 636 of file decentralized_pgo.cpp.
void DecentralizedPGO::pose_graph_callback | ( | const cslam_common_interfaces::msg::PoseGraph::ConstSharedPtr | msg | ) |
Receives pose graph.
msg |
Definition at line 438 of file decentralized_pgo.cpp.
void DecentralizedPGO::reinitialize_received_pose_graphs | ( | ) |
Sets received pose graphs to false.
Definition at line 213 of file decentralized_pgo.cpp.
void DecentralizedPGO::resquest_current_neighbors | ( | ) |
Request to check the current neighbors.
Definition at line 510 of file decentralized_pgo.cpp.
void DecentralizedPGO::share_optimized_estimates | ( | const gtsam::Values & | estimates | ) |
Shares optimizes estimates with the robots concerned.
Definition at line 665 of file decentralized_pgo.cpp.
void DecentralizedPGO::start_optimization | ( | ) |
Performs pose graph optimization.
Definition at line 829 of file decentralized_pgo.cpp.
void DecentralizedPGO::start_waiting | ( | ) |
Start waiting.
Definition at line 515 of file decentralized_pgo.cpp.
void DecentralizedPGO::update_transform_to_origin | ( | const gtsam::Pose3 & | pose | ) |
Update transform to origin.
Definition at line 731 of file decentralized_pgo.cpp.
void DecentralizedPGO::visualization_callback | ( | ) |
Publish heartbeat message periodically.
Definition at line 696 of file decentralized_pgo.cpp.
void DecentralizedPGO::write_current_estimates_callback | ( | const std_msgs::msg::String::ConstSharedPtr | msg | ) |
Prints current estimates.
msg |
Definition at line 322 of file decentralized_pgo.cpp.