ImgDetectionConverter.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <depthai/depthai.hpp>
4 #include <deque>
5 
6 #ifdef IS_ROS2
7  #include <vision_msgs/msg/detection2_d_array.hpp>
8 
9  #include "rclcpp/rclcpp.hpp"
10 #else
11  #include <ros/ros.h>
12  #include <vision_msgs/Detection2DArray.h>
13 
14  #include <boost/make_shared.hpp>
15  #include <boost/shared_ptr.hpp>
16 #endif
17 
18 namespace dai {
19 
20 namespace ros {
21 
22 #ifdef IS_ROS2
23 namespace VisionMsgs = vision_msgs::msg;
24 using Detection2DArrayPtr = VisionMsgs::Detection2DArray::SharedPtr;
25 #else
26 namespace VisionMsgs = vision_msgs;
27 using Detection2DArrayPtr = VisionMsgs::Detection2DArray::Ptr;
28 #endif
30  public:
31  // DetectionConverter() = default;
32  ImgDetectionConverter(std::string frameName, int width, int height, bool normalized = false);
33 
34  void toRosMsg(std::shared_ptr<dai::ImgDetections> inNetData, std::deque<VisionMsgs::Detection2DArray>& opDetectionMsgs);
35 
36  Detection2DArrayPtr toRosMsgPtr(std::shared_ptr<dai::ImgDetections> inNetData);
37 
38  private:
40  const std::string _frameName;
42 };
43 
52 } // namespace ros
53 
54 namespace rosBridge = ros;
55 
56 } // namespace dai
ImgDetectionConverter(std::string frameName, int width, int height, bool normalized=false)
VisionMsgs::Detection2DArray::Ptr Detection2DArrayPtr
Detection2DArrayPtr toRosMsgPtr(std::shared_ptr< dai::ImgDetections > inNetData)
void toRosMsg(std::shared_ptr< dai::ImgDetections > inNetData, std::deque< VisionMsgs::Detection2DArray > &opDetectionMsgs)


depthai_bridge
Author(s): Sachin Guruswamy
autogenerated on Tue May 10 2022 03:01:27