1 #ifndef GTSAMMSGCONVERSION_H_
2 #define GTSAMMSGCONVERSION_H_
4 #include <rclcpp/rclcpp.hpp>
6 #include <gtsam/geometry/Pose3.h>
7 #include <gtsam/inference/Key.h>
8 #include <gtsam/inference/LabeledSymbol.h>
9 #include <gtsam/linear/NoiseModel.h>
10 #include <gtsam/nonlinear/NonlinearFactorGraph.h>
11 #include <gtsam/nonlinear/Values.h>
12 #include <gtsam/slam/BetweenFactor.h>
14 #include <cslam_common_interfaces/msg/pose_graph.hpp>
15 #include <cslam_common_interfaces/msg/pose_graph_edge.hpp>
16 #include <cslam_common_interfaces/msg/pose_graph_value.hpp>
17 #include <geometry_msgs/msg/transform.hpp>
18 #include <nav_msgs/msg/odometry.hpp>
20 #define GRAPH_LABEL 'g'
21 #define ROBOT_LABEL(id) ('A' + id)
22 #define ROBOT_ID(ch) ((unsigned int)(ch - 'A'))
56 geometry_msgs::msg::Transform
65 std::vector<cslam_common_interfaces::msg::PoseGraphValue>
74 std::vector<cslam_common_interfaces::msg::PoseGraphEdge>
83 std::vector<cslam_common_interfaces::msg::PoseGraphValue>
92 std::vector<cslam_common_interfaces::msg::PoseGraphEdge>
110 const std::vector<cslam_common_interfaces::msg::PoseGraphValue> &values);
119 const std::vector<cslam_common_interfaces::msg::PoseGraphEdge> &edges);
gtsam::NonlinearFactorGraph::shared_ptr edges_msg_to_gtsam(const std::vector< cslam_common_interfaces::msg::PoseGraphEdge > &edges)
Converts from ROS 2 message to GTSAM.
gtsam::Pose3 odometry_msg_to_pose3(const nav_msgs::msg::Odometry &odom_msg)
Converts odometry message to gtsam::Pose3.
std::vector< cslam_common_interfaces::msg::PoseGraphValue > gtsam_values_to_msg(const gtsam::Values::shared_ptr values)
Converts from GTSAM to ROS 2 message.
gtsam::Pose3 pose_msg_to_gtsam(const geometry_msgs::msg::Pose &pose)
Converts from ROS 2 message to GTSAM.
gtsam::Values::shared_ptr values_msg_to_gtsam(const std::vector< cslam_common_interfaces::msg::PoseGraphValue > &values)
Converts from ROS 2 message to GTSAM.
gtsam::Pose3 transform_msg_to_pose3(const geometry_msgs::msg::Transform &msg)
Converts a transform msg into a gtsam::Pose3.
geometry_msgs::msg::Pose gtsam_pose_to_msg(const gtsam::Pose3 &pose)
Converts from GTSAM to ROS 2 message.
std::vector< cslam_common_interfaces::msg::PoseGraphEdge > gtsam_factors_to_msg(const gtsam::NonlinearFactorGraph::shared_ptr factors)
Converts from GTSAM to ROS 2 message.
geometry_msgs::msg::Transform gtsam_pose_to_transform_msg(const gtsam::Pose3 &pose)
Converts from GTSAM to ROS 2 message.