22#ifndef EASYNAV_COMMON_TYPES__GNSSPERCEPTIONS_HPP_
23#define EASYNAV_COMMON_TYPES__GNSSPERCEPTIONS_HPP_
28#include "sensor_msgs/msg/nav_sat_fix.hpp"
30#include "rclcpp_lifecycle/lifecycle_node.hpp"
52 return t ==
"sensor_msgs/msg/NavSatFix";
56 sensor_msgs::msg::NavSatFix
data;
68 std::string
group()
const override {
return "gnss";}
73 std::shared_ptr<PerceptionBase>
create(
const std::string &)
override
75 return std::make_shared<GNSSPerception>();
90 rclcpp_lifecycle::LifecycleNode & node,
91 const std::string & topic,
92 const std::string & type,
93 std::shared_ptr<PerceptionBase> target,
94 rclcpp::CallbackGroup::SharedPtr cb_group)
override;
104 std::vector<std::shared_ptr<GNSSPerception>>;
Defines data structures and utilities for representing and processing sensor perceptions.
Handles the creation and updating of GNSSPerception instances from sensor_msgs::msg::NavSatFix messag...
Definition GNSSPerception.hpp:64
std::shared_ptr< PerceptionBase > create(const std::string &) override
Creates a new empty GNSSPerception instance.
Definition GNSSPerception.hpp:73
std::string group() const override
Returns the group managed by this handler.
Definition GNSSPerception.hpp:68
rclcpp::SubscriptionBase::SharedPtr create_subscription(rclcpp_lifecycle::LifecycleNode &node, const std::string &topic, const std::string &type, std::shared_ptr< PerceptionBase > target, rclcpp::CallbackGroup::SharedPtr cb_group) override
Creates a subscription to an GNSS topic that updates a target GNSSPerception.
Definition GNSSPerception.cpp:29
Represents a single GNSS perception from a sensor.
Definition GNSSPerception.hpp:42
sensor_msgs::msg::NavSatFix data
GNSS data received from the sensor.
Definition GNSSPerception.hpp:56
static bool supports_msg_type(std::string_view t)
Returns whether the given ROS 2 type name is supported by this perception.
Definition GNSSPerception.hpp:50
static constexpr std::string_view default_group_
Group identifier for GNSS perceptions.
Definition GNSSPerception.hpp:45
Abstract base class for representing a single sensor perception.
Definition Perceptions.hpp:40
Abstract base interface for group-specific perception handlers.
Definition Perceptions.hpp:116
Definition CircularBuffer.hpp:23
std::vector< std::shared_ptr< GNSSPerception > > GNSSPerceptions
Alias for a vector of shared pointers to GNSSPerception objects.
Definition GNSSPerception.hpp:103
rclcpp::Time get_latest_gnss_perceptions_stamp(const GNSSPerceptions &perceptions)
Retrieves the latest timestamp among a set of GNSS perceptions.
Definition GNSSPerception.cpp:58