21 #ifndef DESCRIPTOR_SURFACED_BASED_RECOGNITION_H 22 #define DESCRIPTOR_SURFACED_BASED_RECOGNITION_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> 34 #include <Eigen/Dense> 36 #include <asr_msgs/AsrObject.h> 37 #include <asr_object_database/ObjectMetaData.h> 38 #include <asr_object_database/RecognizerListMeshes.h> 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> 57 const static std::string
NODE_NAME(
"asr_descriptor_surface_based_recognition");
126 DescriptorSurfaceBasedRecognitionConfig
config_;
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);
200 void configCallback(DescriptorSurfaceBasedRecognitionConfig &config_, uint32_t level);
218 asr_msgs::AsrObjectPtr createAsrMessage(
PoseRecognition *pose_rec,
int results_index, std_msgs::Header header);
226 void createMarker(asr_msgs::AsrObjectPtr &
object, std::string &mesh_path);
241 void createBoxMarker(
RecognitionResult *result, std_msgs::Header header,
rgb color,
bool drawCompleteBoxes);
249 void overlaySceneWith2DResults(
PoseRecognition *pose_rec, HalconCpp::HImage *scene_image);
257 pcl::PointCloud<pcl::PointXYZRGB>::Ptr createVisualizationCloud(std::vector<PoseRecognition*> &pose_recs, std_msgs::Header header);
264 bool processGetRecognizerRequest(GetRecognizer::Request &req, GetRecognizer::Response &res);
271 bool processReleaseRecognizerRequest(ReleaseRecognizer::Request &req, ReleaseRecognizer::Response &res);
278 bool processGetObjectListRequest(GetObjectList::Request &req, GetObjectList::Response &res);
285 bool processClearAllRecognizersRequest(ClearAllRecognizers::Request &req, ClearAllRecognizers::Response &res);
290 void initializeMeshes();
301 bool startObjectRecognition(std::string name,
int count,
bool use_pose_val);
308 void stopObjectRecognition(std::string name);
boost::shared_ptr< ApproximateSync > sync_policy_
std::string image_color_topic_
static const std::string OUTPUT_EVALUATION_FILE_TIME("global_times.txt")
ros::ServiceServer get_object_list_service_
std::string output_objects_topic_
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_
visualization_msgs::MarkerArrayPtr msgs_box_marker_array_
static const std::string OUTPUT_EVALUATION_DIR("eval")
std::string point_cloud_topic_
message_filters::Subscriber< sensor_msgs::Image > image_sub_
static const std::string GET_RECOGNIZER_SERVICE_NAME("get_recognizer")
std::string image_mono_topic_
boost::threadpool::pool thread_pool_
message_filters::Subscriber< sensor_msgs::PointCloud2 > pc_with_guppy_sub_
std::ofstream outstream_times_
ros::Publisher marker_pub_
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)
std::string output_marker_bounding_box_topic_
static const std::string OBJECT_DB_SERVICE_OBJECT_TYPE("/asr_object_database/object_meta_data")
ros::ServiceServer clear_all_recognizers_service_
ros::ServiceClient object_db_meshes_service_client_
ros::ServiceServer get_recognizer_service_
std::string output_cloud_topic_
static const std::string OBJECT_DB_SERVICE_OBJECT_MESHES("/asr_object_database/recognizer_list_meshes")
std::vector< ObjectDescriptor > objects_
std::ofstream outstream_poses_
DescriptorSurfaceBasedRecognitionConfig config_
ros::Publisher cloud_pub_
std::string output_marker_topic_
ros::ServiceServer release_recognizer_service_
std::string output_image_topic_
ros::Publisher boxes_pub_
visualization_msgs::MarkerArrayPtr msgs_marker_array_
ros::Publisher image_pub_
ros::Publisher objects_pub_
static const std::string OBJECT_DATABASE_CATEGORY("descriptor")
static const std::string NODE_NAME("asr_descriptor_surface_based_recognition")
std::vector< Ogre::MeshPtr > meshes_
message_filters::Synchronizer< ApproximatePolicy > ApproximateSync
std::vector< Object2DPositions > last_frame_positions_
static const std::string GET_OBJECT_LIST_SERVICE_NAME("get_object_list")
static const std::string CLEAR_ALL_RECOGNIZERS_SERVICE_NAME("clear_all_recognizers")
ros::ServiceClient object_db_service_client_
message_filters::Subscriber< sensor_msgs::Image > image_mono_sub_