mht.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
32 #ifndef _MHT_H_
33 #define _MHT_H_
34 
35 #include <ros/ros.h>
36 
37 #include <visualization_msgs/MarkerArray.h>
38 
39 #include <mtt/graph_wrapper.h>
40 
41 #include <mtt/mht_declaration.h>
42 
43 #include <mtt/k_best.h>
44 #include <mtt/cluster.h>
45 
46 #include <laser_geometry/laser_geometry.h>
47 
48 #include <pcl/point_types.h>
49 #include <pcl/io/pcd_io.h>
50 #include <pcl/kdtree/kdtree_flann.h>
51 #include <pcl/surface/mls.h>
52 #include <pcl_conversions/pcl_conversions.h>
53 
54 #include <Eigen/Dense>
55 #include <Eigen/Cholesky>
56 
57 #include <iostream>
58 #include <istream>
59 #include <fstream>
60 #include <string>
61 #include <complex>
62 
63 #include <boost/thread/thread.hpp>
64 
65 using Eigen::Vector4d;
66 
68 extern gvplugin_library_t gvplugin_xgtk_LTX_library;
69 
70 extern "C"
71 {
75  extern void gvconfig_plugin_install_from_library(GVC_t*,char*,gvplugin_library_t*);
76 }
77 
83 class Markers
84 {
85  public:
93  void update(visualization_msgs::Marker& marker);
94 
98  void decrement(void);
99 
103  void clean(void);
104 
110  vector<visualization_msgs::Marker> getOutgoingMarkers(void);
111  private:
113  vector<visualization_msgs::Marker> markers;
114 };
115 
124 vector<visualization_msgs::Marker> createTargetMarkers(vector<TargetPtr>& targets);
125 
134 vector<visualization_msgs::Marker> createClustersMarkers(vector<MeasurementPtr>& clusters);
135 
143 std_msgs::ColorRGBA makeColor(int id);
144 
155 std_msgs::ColorRGBA makeColor(double r,double g, double b, double a);
156 
166 geometry_msgs::Point makePose(double x,double y, double z);
167 
173 void dataHandler(const sensor_msgs::PointCloud2& msg);
174 
183 void* graphicalThread(void*data);
184 
194 void createObjects(vector<PointPtr>&data,vector<MeasurementPtr>&clusters,double clustering_distance);
195 
203 void pointCloud2ToVector(const sensor_msgs::PointCloud2& cloud,vector<PointPtr>& data);
204 
214 double euclideanDistance(Point&p1,Point&p2);
215 
216 #endif
std_msgs::ColorRGBA makeColor(int id)
Create a std_msgs color from a hsv color map.
Definition: mht.cpp:723
Dynamic markers support class.
Definition: mht.h:83
vector< visualization_msgs::Marker > markers
Internal storing vector of markers.
Definition: mht.h:113
vector< visualization_msgs::Marker > createTargetMarkers(vector< TargetPtr > &targets)
Create markers from targets.
Definition: mht.cpp:509
double euclideanDistance(Point &p1, Point &p2)
Calculate Euclidean distance between Point class types.
void dataHandler(const sensor_msgs::PointCloud2 &msg)
Handler for the incoming data.
Definition: mht.cpp:213
vector< visualization_msgs::Marker > createClustersMarkers(vector< MeasurementPtr > &clusters)
Create markers from clusters.
Definition: mht.cpp:729
gvplugin_library_t gvplugin_xgtk_LTX_library
Xgtk external graphviz library/plugin (only plugin, there's no need to create a library since it can ...
Simple point class.
Definition: point.h:53
void update(visualization_msgs::Marker &marker)
Update a internal marker.
Definition: mht.cpp:357
void gvconfig_plugin_install_from_library(GVC_t *, char *, gvplugin_library_t *)
External function used to install a gv plugin from a library.
void createObjects(vector< PointPtr > &data, vector< MeasurementPtr > &clusters, double clustering_distance)
Clustering function.
Definition: mht.cpp:175
vector< visualization_msgs::Marker > getOutgoingMarkers(void)
Obtain the list of outgoing markers.
Definition: mht.cpp:396
K-best Murtys' algorithm header and auxiliary classes declaration.
void decrement(void)
Mark existing markers for deletion.
Definition: mht.cpp:369
GVGraph class declaration.
geometry_msgs::Point makePose(double x, double y, double z)
Create a geometry_msgs::Point from values.
void * graphicalThread(void *data)
Graphical thread.
Definition: mht.cpp:810
MHT class declaration.
void clean(void)
Remove markers that should not be transmitted.
Definition: mht.cpp:385
Hypotheses cluster definition.
void pointCloud2ToVector(const sensor_msgs::PointCloud2 &cloud, vector< PointPtr > &data)
Convert the point cloud data into a laser scan type structure.
Definition: mht.cpp:83


mtt
Author(s): Jorge Almeida
autogenerated on Mon Mar 2 2015 01:32:18