22#ifndef EASYNAV_COMMON_TYPES__IMAGEPERCEPTIONS_HPP_
23#define EASYNAV_COMMON_TYPES__IMAGEPERCEPTIONS_HPP_
28#include "cv_bridge/cv_bridge.hpp"
30#include "rclcpp_lifecycle/lifecycle_node.hpp"
52 return t ==
"sensor_msgs/msg/Image";
72 std::string
group()
const override {
return "image";}
77 std::shared_ptr<PerceptionBase>
create(
const std::string &)
override
79 return std::make_shared<ImagePerception>();
94 rclcpp_lifecycle::LifecycleNode & node,
95 const std::string & topic,
96 const std::string & type,
97 std::shared_ptr<PerceptionBase> target,
98 rclcpp::CallbackGroup::SharedPtr cb_group)
override;
108 std::vector<std::shared_ptr<ImagePerception>>;
Defines data structures and utilities for representing and processing sensor perceptions.
Handles the creation and updating of ImagePerception instances from sensor_msgs::msg::Image messages.
Definition ImagePerception.hpp:68
std::shared_ptr< PerceptionBase > create(const std::string &) override
Creates a new empty ImagePerception instance.
Definition ImagePerception.hpp:77
std::string group() const override
Returns the group managed by this handler.
Definition ImagePerception.hpp:72
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 image topic that updates a target ImagePerception.
Definition ImagePerception.cpp:31
Represents a single image perception from a sensor.
Definition ImagePerception.hpp:42
static bool supports_msg_type(std::string_view t)
Returns whether the given ROS 2 type name is supported by this perception.
Definition ImagePerception.hpp:50
static constexpr std::string_view default_group_
Group identifier for image perceptions.
Definition ImagePerception.hpp:45
cv::Mat data
Image data received from the sensor.
Definition ImagePerception.hpp:59
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< ImagePerception > > ImagePerceptions
Alias for a vector of shared pointers to ImagePerception objects.
Definition ImagePerception.hpp:107
rclcpp::Time get_latest_image_perceptions_stamp(const ImagePerceptions &perceptions)
Retrieves the latest timestamp among a set of image-based perceptions.
Definition ImagePerception.cpp:69