35 #include <Eigen/Dense>
36 #include <opencv2/core/mat.hpp>
37 #include <opencv2/core/types.hpp>
39 #include <rclcpp/rclcpp.hpp>
67 enum TrackingAdjustment {
78 std::ostream&
operator<<(std::ostream& os,
const TrackingAdjustment& adjustment);
94 TrackingResult(
const cv::Point& object_center,
const cv::Size& object_size,
95 const float confidence = 1.f,
TrackingState state = TrackingState::UNKNOWN);
101 TrackingResult& withObjectDirection(
const Eigen::Vector3f& direction, Frame frame);
103 inline cv::Point getObjectCenter()
const {
return _object_center; }
104 inline cv::Size getObjectSize()
const {
return _object_size; }
105 inline float getConfidence()
const {
return _confidence; }
106 inline TrackingState getTrackingState()
const {
return _tracking_state; }
107 Eigen::Vector3f getObjectDirection(Frame frame = Frame::Camera)
const;
110 cv::Size _object_size;
111 cv::Point _object_center;
112 Eigen::Vector3f _object_direction_camera_frame;
114 Eigen::Vector3f _object_direction_body_frame;
116 Eigen::Vector3f _object_direction_world_frame;
159 std::optional<uint16_t>
frame_id = std::nullopt)
Camera client to subscribe to a camera image stream.
Definition: camera.hpp:318
Represents the result of an image tracking operation.
Definition: common.hpp:84
std::ostream & operator<<(std::ostream &os, const TrackingState &state)
Overloaded << operator to stringify the TrackingState enum.
TrackingState
Tracking state enum to represent different tracking states.
Definition: common.hpp:46
Represents the tracking selection as received by AMC.
Definition: common.hpp:133
std::optional< uint16_t > frame_id
Optional identifier of the selected frame.
Definition: common.hpp:138
TrackingSelection(cv::Point2d normalized_point, std::optional< uint16_t > frame_id=std::nullopt)
Constructor for creating a tracking selection with a point only.
Definition: common.hpp:146
cv::Size2d normalized_window_size
Definition: common.hpp:136
cv::Point2d normalized_point
Definition: common.hpp:134
TrackingSelection(cv::Point2d normalized_point, cv::Size2d normalized_window_size, std::optional< uint16_t > frame_id=std::nullopt)
Constructor for creating a tracking selection with a point and a window size. This should be used whe...
Definition: common.hpp:158