descriptor_surface_based_recognition.h
Go to the documentation of this file.
1 
21 #ifndef DESCRIPTOR_SURFACED_BASED_RECOGNITION_H
22 #define DESCRIPTOR_SURFACED_BASED_RECOGNITION_H
23 
24 #include <ros/ros.h>
25 #include <dynamic_reconfigure/server.h>
26 #include <asr_descriptor_surface_based_recognition/DescriptorSurfaceBasedRecognitionConfig.h>
30 #include <visualization_msgs/MarkerArray.h>
31 #include <sensor_msgs/PointCloud2.h>
32 #include <sensor_msgs/Image.h>
33 
34 #include <Eigen/Dense>
35 
36 #include <asr_msgs/AsrObject.h>
37 #include <asr_object_database/ObjectMetaData.h>
38 #include <asr_object_database/RecognizerListMeshes.h>
39 
40 #include <asr_descriptor_surface_based_recognition/GetRecognizer.h>
41 #include <asr_descriptor_surface_based_recognition/ReleaseRecognizer.h>
42 #include <asr_descriptor_surface_based_recognition/GetObjectList.h>
43 #include <asr_descriptor_surface_based_recognition/ClearAllRecognizers.h>
44 
46 #include "pose_validation.h"
47 #include "object_descriptor.h"
48 #include "pose_recognition.h"
49 #include "object_2D_positions.h"
50 #include "util.h"
51 
52 
54 
56 
57 const static std::string NODE_NAME("asr_descriptor_surface_based_recognition");
58 
59 const static std::string GET_RECOGNIZER_SERVICE_NAME("get_recognizer");
60 const static std::string RELEASE_RECOGNIZER_SERVICE_NAME("release_recognizer");
61 const static std::string GET_OBJECT_LIST_SERVICE_NAME("get_object_list");
62 const static std::string CLEAR_ALL_RECOGNIZERS_SERVICE_NAME("clear_all_recognizers");
63 const static std::string OBJECT_DB_SERVICE_OBJECT_TYPE ("/asr_object_database/object_meta_data");
64 const static std::string OBJECT_DB_SERVICE_OBJECT_MESHES("/asr_object_database/recognizer_list_meshes");
65 
69 const static std::string OUTPUT_EVALUATION_DIR("eval");
70 const static std::string OUTPUT_EVALUATION_FILE_TIME("global_times.txt");
71 const static std::string OUTPUT_EVALUATION_FILE_POSES("global_poses.txt");
72 
76 const static std::string OBJECT_DATABASE_CATEGORY("descriptor");
77 
79 extern std::string PACKAGE_PATH;
80 
81 
82 
85 
86 
91 
92 private:
93 
95  std::string image_color_topic_;
96 
98  std::string image_mono_topic_;
99 
101  std::string point_cloud_topic_;
102 
105 
107  std::string output_marker_topic_;
108 
111 
113  std::string output_cloud_topic_;
114 
116  std::string output_image_topic_;
117 
118 
121 
123  dynamic_reconfigure::Server<DescriptorSurfaceBasedRecognitionConfig> reconfigure_server_;
124 
126  DescriptorSurfaceBasedRecognitionConfig config_;
127 
132 
138 
141 
144 
151 
152 
154  visualization_msgs::MarkerArrayPtr msgs_marker_array_;
155  visualization_msgs::MarkerArrayPtr msgs_box_marker_array_;
156 
159 
161  std::vector<ObjectDescriptor> objects_;
162 
164  std::vector<Ogre::MeshPtr> meshes_;
165 
167  std::vector<Object2DPositions> last_frame_positions_;
168 
171 
173  std::ofstream outstream_times_;
174 
176  std::ofstream outstream_poses_;
177 
180 
181 
182 
183 
184 
192  void rosCallback(const sensor_msgs::ImageConstPtr& input_image_guppy, const sensor_msgs::ImageConstPtr& input_image_guppy_mono, const sensor_msgs::PointCloud2ConstPtr& input_point_cloud_with_guppy);
193 
200  void configCallback(DescriptorSurfaceBasedRecognitionConfig &config_, uint32_t level);
201 
207  void threadTask(PoseRecognition *pose_rec);
208 
218  asr_msgs::AsrObjectPtr createAsrMessage(PoseRecognition *pose_rec, int results_index, std_msgs::Header header);
219 
226  void createMarker(asr_msgs::AsrObjectPtr &object, std::string &mesh_path);
227 
231  void clearMarkers();
232 
241  void createBoxMarker(RecognitionResult *result, std_msgs::Header header, rgb color, bool drawCompleteBoxes);
242 
249  void overlaySceneWith2DResults(PoseRecognition *pose_rec, HalconCpp::HImage *scene_image);
250 
257  pcl::PointCloud<pcl::PointXYZRGB>::Ptr createVisualizationCloud(std::vector<PoseRecognition*> &pose_recs, std_msgs::Header header);
258 
264  bool processGetRecognizerRequest(GetRecognizer::Request &req, GetRecognizer::Response &res);
265 
271  bool processReleaseRecognizerRequest(ReleaseRecognizer::Request &req, ReleaseRecognizer::Response &res);
272 
278  bool processGetObjectListRequest(GetObjectList::Request &req, GetObjectList::Response &res);
279 
285  bool processClearAllRecognizersRequest(ClearAllRecognizers::Request &req, ClearAllRecognizers::Response &res);
286 
290  void initializeMeshes();
291 
301  bool startObjectRecognition(std::string name, int count, bool use_pose_val);
302 
308  void stopObjectRecognition(std::string name);
309 
310 public:
311 
316 
317 };
318 
319 }
320 
321 #endif
static const std::string OUTPUT_EVALUATION_FILE_TIME("global_times.txt")
static const std::string RELEASE_RECOGNIZER_SERVICE_NAME("release_recognizer")
static const std::string OUTPUT_EVALUATION_FILE_POSES("global_poses.txt")
dynamic_reconfigure::Server< DescriptorSurfaceBasedRecognitionConfig > reconfigure_server_
static const std::string OUTPUT_EVALUATION_DIR("eval")
static const std::string GET_RECOGNIZER_SERVICE_NAME("get_recognizer")
message_filters::sync_policies::ApproximateTime< sensor_msgs::Image, sensor_msgs::Image, sensor_msgs::PointCloud2 > ApproximatePolicy
MarkerBase * createMarker(int marker_type, MarkerDisplay *owner, DisplayContext *context, Ogre::SceneNode *parent_node)
static const std::string OBJECT_DB_SERVICE_OBJECT_TYPE("/asr_object_database/object_meta_data")
static const std::string OBJECT_DB_SERVICE_OBJECT_MESHES("/asr_object_database/recognizer_list_meshes")
static const std::string OBJECT_DATABASE_CATEGORY("descriptor")
static const std::string NODE_NAME("asr_descriptor_surface_based_recognition")
message_filters::Synchronizer< ApproximatePolicy > ApproximateSync
static const std::string GET_OBJECT_LIST_SERVICE_NAME("get_object_list")
static const std::string CLEAR_ALL_RECOGNIZERS_SERVICE_NAME("clear_all_recognizers")
Main include.


asr_descriptor_surface_based_recognition
Author(s): Allgeyer Tobias, Hutmacher Robin, Meißner Pascal
autogenerated on Mon Dec 16 2019 03:31:15