19#include <rclcpp/rclcpp.hpp>
22#include <std_msgs/msg/string.hpp>
23#include <std_srvs/srv/empty.hpp>
25#include <geometry_msgs/msg/pose_with_covariance_stamped.hpp>
26#include <geometry_msgs/msg/pose.hpp>
27#include <geometry_msgs/msg/pose_stamped.hpp>
28#include <geometry_msgs/msg/transform_stamped.hpp>
29#include <sensor_msgs/msg/nav_sat_fix.hpp>
31#include <tf2/LinearMath/Transform.h>
33#include <carma_ros2_utils/carma_lifecycle_node.hpp>
35#include <boost/optional.hpp>
38#include <gps_msgs/msg/gps_fix.hpp>
39#include <wgs84_utils/wgs84_utils.h>
41#include <lanelet2_extension/projection/local_frame_projector.h>
61 std::function<boost::optional<geometry_msgs::msg::TransformStamped>(
const std::string&,
const std::string&)>;
75 std::string base_link_frame_id, std::string heading_frame_id, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr logger);
83 void gnssFixCb(gps_msgs::msg::GPSFix::UniquePtr fix_msg);
104 std::shared_ptr<lanelet::projection::LocalFrameProjector>
getMapProjector();
127 geometry_msgs::msg::PoseWithCovarianceStamped
poseFromGnss(
const tf2::Transform& baselink_in_sensor,
128 const tf2::Quaternion& sensor_in_ned_heading_rotation,
129 const lanelet::projection::LocalFrameProjector& projector,
130 const tf2::Quaternion& ned_in_map_rotation,
131 gps_msgs::msg::GPSFix fix_msg);
156 rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr
logger_;
std::string base_link_frame_id_
std::shared_ptr< lanelet::projection::LocalFrameProjector > map_projector_
std::function< void(geometry_msgs::msg::PoseStamped)> PosePubCallback
void geoReferenceCallback(std_msgs::msg::String::UniquePtr geo_ref)
Map georeference callback The geodetic description of the map frame should be provided to this callba...
std::function< boost::optional< geometry_msgs::msg::TransformStamped >(const std::string &, const std::string &)> TransformLookupCallback
boost::optional< tf2::Quaternion > sensor_in_ned_heading_rotation_
TransformLookupCallback tf_lookup_
void gnssFixCb(gps_msgs::msg::GPSFix::UniquePtr fix_msg)
GNSS Fix callback which will publish a pose representing that fix in the map frame if the required tr...
std::shared_ptr< lanelet::projection::LocalFrameProjector > getMapProjector()
Get the projector built from the provided georeference via the callback.
std::string heading_frame_id_
GNSSToMapConvertor(PosePubCallback pose_pub, TransformLookupCallback tf_lookup, std::string map_frame_id, std::string base_link_frame_id, std::string heading_frame_id, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr logger)
Constructor.
std::string georeference_
boost::optional< tf2::Transform > baselink_in_sensor_
boost::optional< tf2::Quaternion > ned_in_map_rotation_
geometry_msgs::msg::PoseWithCovarianceStamped poseFromGnss(const tf2::Transform &baselink_in_sensor, const tf2::Quaternion &sensor_in_ned_heading_rotation, const lanelet::projection::LocalFrameProjector &projector, const tf2::Quaternion &ned_in_map_rotation, gps_msgs::msg::GPSFix fix_msg)
Converts a provided GNSS fix message into a pose message for the map frame describibed by the provide...
boost::optional< tf2::Quaternion > getNedInMapRotation()
Get the rotation computed from the recieved georeference or boost::none if unset.
std::string map_frame_id_
rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr logger_
PosePubCallback pose_pub_