fork download
  1.  
  2.  
  3. class BodyTracking {
  4. public:
  5. //Constructor
  6. BodyTracking();
  7.  
  8. //Destructor
  9. ~BodyTracking();
  10.  
  11. private:
  12.  
  13. #include "body_tracking.h"
  14. #include <opencv2/objdetect/objdetect.hpp>
  15. #include <opencv2/imgproc/imgproc.hpp>
  16.  
  17. cv::CascadeClassifier face_cascade;
  18.  
  19. typedef message_filters::sync_policies::
  20. ApproximateTime<sensor_msgs::PointCloud2, sensor_msgs::PointCloud2>
  21. MySync2Policy;
  22. typedef message_filters::sync_policies::
  23. ApproximateTime<sensor_msgs::PointCloud2, sensor_msgs::PointCloud2,
  24. sensor_msgs::PointCloud2> MySync3Policy;
  25. ros::Subscriber single_cam;
  26. boost::shared_ptr<message_filters::Synchronizer<MySync2Policy> > sync2;
  27. boost::shared_ptr<message_filters::Synchronizer<MySync3Policy> > sync3;
  28.  
  29. typedef pcl::PointXYZRGB PointT;
  30. typedef pcl::PointCloud<PointT> PointCloudT;
  31. typedef body_tracking::BodyTrackingConfig Config;
  32. typedef dynamic_reconfigure::Server<Config> ReconfigureServer;
  33.  
  34. typedef boost::shared_ptr<PointCloudT> PointCloudPtr;
  35. typedef boost::shared_ptr<const PointCloudT> PointCloudConstPtr;
  36.  
  37. // listener for coordinate system transforms
  38. boost::shared_ptr<tf::TransformListener> tflistener_ptr;
  39.  
  40. // skeltrack objects start
  41.  
  42. SkeltrackSkeleton *skeltrack_skeleton_rawptr;
  43. SkeltrackJointList skeltrack_joint_list; // this is a SkeltrackJoint**
  44. // skeltrack objects end
  45.  
  46. // body model objects start
  47. //boost::shared_ptr<BodyModel> body_model_ptr(new BodyModel());
  48. boost::shared_ptr<BodyModel> body_model_ptr();
  49. // body model objects end
  50.  
  51. bool intrinsics_already_set = false;
  52. Eigen::Matrix3f intrinsics_matrix;
  53. bool update_background = false;
  54.  
  55. // Min confidence for people detection:
  56. double min_confidence_;
  57. // People detection object
  58. open_ptrack::detection::GroundBasedPeopleDetectionApp<PointT> people_detector;
  59. // Flag stating if classifiers based on RGB image should be used or not
  60. bool use_rgb;
  61. // Threshold on image luminance. If luminance is over this threshold,
  62. // classifiers on RGB image are also used
  63. int minimum_luminance;
  64. // If true, sensor tilt angle wrt ground plane is compensated to improve people
  65. // detection
  66. bool sensor_tilt_compensation;
  67. // Voxel size for downsampling the cloud
  68. double voxel_size;
  69. // If true, do not update the ground plane at every frame
  70. bool lock_ground;
  71. // Frames to use for updating the background
  72. int max_background_frames;
  73. // Main loop rate:
  74. double rate_value;
  75. // Voxel resolution of the octree used to represent the background
  76. double background_octree_resolution;
  77. // Background cloud
  78. PointCloudT::Ptr background_cloud;
  79. // If true, background subtraction is performed
  80. bool background_subtraction;
  81. // Threshold on the ratio of valid points needed for ground estimation
  82. double valid_points_threshold;
  83.  
  84. // Create classifier for people detection:
  85. open_ptrack::detection::PersonClassifier<pcl::RGB> person_classifier;
  86. // ground estimator
  87. boost::shared_ptr<open_ptrack::detection::GroundplaneEstimation<PointT> >
  88. ground_estimator;
  89.  
  90. // algo variables
  91. bool ground_from_extrinsic_calibration;
  92. bool read_ground_from_file; // Flag stating if the ground should be read from
  93. // file, if present
  94. int sampling_factor;
  95. std::string pointcloud_topic;
  96. bool first_valid_frame = false;
  97. // algo variables end
  98.  
  99. // my variables
  100. bool ground_found_ = false;
  101. bool ground_based_found_last_frame_ = false;
  102. Eigen::VectorXf ground_coeffs;
  103. boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer;
  104. boost::shared_ptr<pcl::visualization::RangeImageVisualizer>
  105. range_image_widget_ptr_;
  106. // For visualizing things in rviz
  107. // rviz_visual_tools::RvizVisualToolsPtr visual_tools_ptr;
  108. ros::Publisher debug_cloud_;
  109. ros::Publisher debug_markers_;
  110. ros::Publisher debug_depth_image_;
  111. ros::Publisher debug_rgb_image_;
  112. float bboxxstretch_, bboxystretch_, bboxzstretch_;
  113. bool rviz_debug_output_;
  114. bool pcl_debug_output_ = true;
  115. // my variables end
  116.  
  117. visualization_msgs::Marker
  118. create_marker(Eigen::Vector3f position, Eigen::Vector4f orientation,
  119. Eigen::Vector3f scale, std::string frame_id, std::string ns,
  120. int id, Eigen::Vector4f color, std::string text, uint32_t shape,
  121. std::vector<geometry_msgs::Point> point_vector,
  122. std::vector<std_msgs::ColorRGBA> colors);
  123.  
  124.  
  125. visualization_msgs::Marker
  126. create_marker_minmax(Eigen::Vector3f centroid, Eigen::Vector4f min,
  127. Eigen::Vector4f max, std::string frame_id, std::string ns,
  128. int id, Eigen::Vector4f color, uint32_t shape);
  129.  
  130. std::vector<visualization_msgs::Marker>
  131. create_body_markers(Eigen::MatrixXf features, Eigen::MatrixXi adjacency_matrix,
  132. std::string frame_id);
  133. pcl::PointXYZ my_skeltrack_joint_to_point(SkeltrackJoint joint);
  134. void deleteAllMarkersFromFrame(std::string frame_id);
  135.  
  136. void deleteAllJointMarkers(std::string frame_id);
  137.  
  138. void publishMarkerForSkeltrackJoint(SkeltrackJoint *joint, std::string name,
  139. Eigen::Vector4f color, float radius,
  140. std::string frame_id);
  141.  
  142. void addJointAsSphereVis(SkeltrackJoint *joint, float radius,
  143. Eigen::Vector4f color, std::string name);
  144.  
  145. void updatePeopleVis(
  146. boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer,
  147. pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr cloud,
  148. std::vector<pcl::people::PersonCluster<PointT> > clusters,
  149. boost::shared_ptr<pcl::people::PersonCluster<PointT> > max_conf_cluster);
  150.  
  151. void updateVis(boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer,
  152. pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr cloud);
  153.  
  154. /** create PCL viewer window */
  155. boost::shared_ptr<pcl::visualization::PCLVisualizer> createVis();
  156.  
  157. /** input: list of ROS Clouds. Output: List of PCL clouds transformed to Frame
  158.  * of first Camera */
  159. void
  160. ROSCloud_TF_PCLCloud(const std::vector<sensor_msgs::PointCloud2ConstPtr> in,
  161. std::vector<PointCloudPtr> &out);
  162.  
  163. /** returns true if valid ground plane found*/
  164. bool estimateGround(PointCloudPtr cloud);
  165.  
  166. void findPersonClusters(PointCloudPtr cloud,std::vector<pcl::people::PersonCluster<PointT> >
  167. &clusters);
  168.  
  169. /** returns true if cluster found with confidence > minconfidence. index is returned in maxConfIndex. if function returns false maxConfIndex is INVALID. */
  170. bool getBestPersonCLuster(std::vector<pcl::people::PersonCluster<PointT> > clusters,const int min_confidence, int &maxConfIndex);
  171.  
  172. void createDepthAndRGB2DFromOrganizedCloud(const PointCloudPtr incloud_ptr,cv::Mat &out_cloud_2d ,cv::Mat &out_cloud_2d_rgb );
  173.  
  174. /** returns: cropped cloud and 2d cv:Mat depth_image and 2d cv:Mat cropped color image */
  175. void cropCloudToPerson(const PointCloudPtr incloud_ptr,PointCloudPtr &outcloud_ptr,const boost::shared_ptr<pcl::people::PersonCluster<PointT> > person1ptr,cv::Mat &out_cloud_2d ,cv::Mat &out_cloud_2d_rgb);
  176.  
  177. // callback methd fo N cameras (all logic code goes here)
  178. void cloudNCallback(const std::vector<sensor_msgs::PointCloud2ConstPtr> cloud_msg_list);
  179.  
  180. void cloud1Callback(const sensor_msgs::PointCloud2ConstPtr &camera1);
  181.  
  182. // callback method for 2 cameras (synced)
  183. void cloud2Callback(const sensor_msgs::PointCloud2ConstPtr &camera1,
  184. const sensor_msgs::PointCloud2ConstPtr &camera2);
  185.  
  186. // callback method for 3 cameras (synced)
  187. void cloud3Callback(const sensor_msgs::PointCloud2ConstPtr &camera1,
  188. const sensor_msgs::PointCloud2ConstPtr &camera2,
  189. const sensor_msgs::PointCloud2ConstPtr &camera3);
  190.  
  191. void cameraInfoCallback(const sensor_msgs::CameraInfo::ConstPtr &msg);
  192.  
  193. bool fileExists(const char *fileName);
  194.  
  195.  
  196.  
  197.  
  198.  
  199. };
  200.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:13:27: fatal error: body_tracking.h: No such file or directory
 #include "body_tracking.h"
                           ^
compilation terminated.
stdout
Standard output is empty