rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
pose_estimation_match.h
Go to the documentation of this file.
1 #ifndef _RAPID_POSE_ESTIMATION_MATCH_H_
2 #define _RAPID_POSE_ESTIMATION_MATCH_H_
3 
4 #include <vector>
5 
6 #include "geometry_msgs/Pose.h"
7 #include "geometry_msgs/Vector3.h"
8 #include "pcl/point_cloud.h"
9 #include "pcl/point_types.h"
10 
11 #include "ros/ros.h"
12 
13 namespace rapid {
14 namespace perception {
16  public:
17  // Do not use default constructor except to initialize empty objects.
19  PoseEstimationMatch(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud,
20  const geometry_msgs::Pose& pose,
21  const geometry_msgs::Vector3& scale, double fitness);
22  pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud() const;
23  // Returns the pose of the match.
24  geometry_msgs::Pose pose() const;
25  geometry_msgs::Vector3 scale() const;
26  // Returns the center point of the point cloud
27  pcl::PointXYZ center() const;
28  // Returns the ICP fitness score (lower score is a better match).
29  double fitness() const;
30  void set_fitness(double fitness);
31 
32  private:
33  pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_;
34  geometry_msgs::Pose pose_;
35  geometry_msgs::Vector3 scale_;
36  pcl::PointXYZ center_;
37  double fitness_;
38 };
39 
40 // Returns true if a has a lower fitness score than b.
42  const PoseEstimationMatch& b);
43 
44 // Visualize matches to a PointCloud2 publisher.
45 void VisualizeMatches(ros::Publisher& pub, ros::Publisher& marker_pub,
46  const std::vector<PoseEstimationMatch>& matches);
47 } // namespace perception
48 } // namespace rapid
49 
50 #endif // _RAPID_PERCEPTION_POSE_ESTIMATION_MATCH_H_
geometry_msgs::Pose pose() const
geometry_msgs::Vector3 scale() const
bool ComparePoseEstimationMatch(const PoseEstimationMatch &a, const PoseEstimationMatch &b)
void VisualizeMatches(ros::Publisher &pub, ros::Publisher &marker_pub, const std::vector< PoseEstimationMatch > &matches)
pcl::PointCloud< pcl::PointXYZRGB >::Ptr cloud() const