27#ifndef EASYNAV_COMMON_TYPES__IMAGEPERCEPTIONS_HPP_
28#define EASYNAV_COMMON_TYPES__IMAGEPERCEPTIONS_HPP_
33#include "cv_bridge/cv_bridge.hpp"
35#include "rclcpp_lifecycle/lifecycle_node.hpp"
57 return t ==
"sensor_msgs/msg/Image";
77 std::string
group()
const override {
return "image";}
82 std::shared_ptr<PerceptionBase>
create(
const std::string &)
override
84 return std::make_shared<ImagePerception>();
99 rclcpp_lifecycle::LifecycleNode & node,
100 const std::string & topic,
101 const std::string & type,
102 std::shared_ptr<PerceptionBase> target,
103 rclcpp::CallbackGroup::SharedPtr cb_group)
override;
113 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:73
std::shared_ptr< PerceptionBase > create(const std::string &) override
Creates a new empty ImagePerception instance.
Definition ImagePerception.hpp:82
std::string group() const override
Returns the group managed by this handler.
Definition ImagePerception.hpp:77
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:36
Represents a single image perception from a sensor.
Definition ImagePerception.hpp:47
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:55
static constexpr std::string_view default_group_
Group identifier for image perceptions.
Definition ImagePerception.hpp:50
cv::Mat data
Image data received from the sensor.
Definition ImagePerception.hpp:64
Abstract base class for representing a single sensor perception.
Definition Perceptions.hpp:45
Abstract base interface for group-specific perception handlers.
Definition Perceptions.hpp:121
Definition CircularBuffer.hpp:28
std::vector< std::shared_ptr< ImagePerception > > ImagePerceptions
Alias for a vector of shared pointers to ImagePerception objects.
Definition ImagePerception.hpp:112
rclcpp::Time get_latest_image_perceptions_stamp(const ImagePerceptions &perceptions)
Retrieves the latest timestamp among a set of image-based perceptions.
Definition ImagePerception.cpp:74