10 #include <cv_bridge/cv_bridge.h>
12 #include <image_transport/image_transport.h>
14 #include <sensor_msgs/CameraInfo.h>
15 #include <sensor_msgs/Image.h>
16 #include <sensor_msgs/RegionOfInterest.h>
18 #include <Eigen/Dense>
20 #include <boost/thread/mutex.hpp>
34 roi_subscriber_(nh.subscribe(
36 camera_info_subscriber_(
37 nh.subscribe(
"camera_info", 1,
39 depth_subscriber_(nh.subscribe(
41 image_subscriber_(it_.subscribe(
62 const sensor_msgs::CameraInfo &cam_info,
64 double foreground_percent,
Position &pos);
82 bool cameraInfoIsValid();
92 void roiCallback(
const sensor_msgs::RegionOfInterest &roi_msg);
98 void imageCallback(
const sensor_msgs::ImageConstPtr &img_msg);
104 void cameraInfoCallback(
const sensor_msgs::CameraInfo &cam_info_msg);
110 void depthCallback(
const sensor_msgs::ImageConstPtr &depth_msg);
118 static bool compare(Eigen::Vector3d a, Eigen::Vector3d b);
123 image_transport::ImageTransport it_;
127 ros::Subscriber roi_subscriber_;
131 ros::Subscriber camera_info_subscriber_;
135 ros::Subscriber depth_subscriber_;
139 image_transport::Subscriber image_subscriber_;
156 double max_object_distance_ = 3.0;
161 double foreground_percent_ = 0.25;
A strategy that simply returns the first element in the list of tracking vectors Should be used if yo...
Definition: simple_tracking_strategy.h:10
Converts a ROI in image to vector in camera frame.
Definition: roi_to_position_converter.h:25
static void computeTrackingVector(const sensor_msgs::RegionOfInterest &roi, const cv::Mat &depth, const sensor_msgs::CameraInfo &cam_info, double max_distance, double foreground_percent, Position &pos)
Get the 3D position of the ROI (in the frame of the camera)
Definition: roi_to_position_converter.cpp:88
Interface for classes that provide a vector to a tracked target.
Definition: base_tracker.h:13
bool isConnected()
Check whether topics are connected.
Definition: roi_to_position_converter.cpp:7
bool trackingIsValid()
Check whether tracking is valid.
Definition: roi_to_position_converter.cpp:60
bool getTrackingVectors(std::unordered_map< uint32_t, Position > &pos)
Get the stored tracking vector.
Definition: roi_to_position_converter.cpp:78
RoiToPositionConverter(ros::NodeHandle &nh)
Constructor.
Definition: roi_to_position_converter.h:32
Store 3D position.
Definition: position.h:8