visualization_rviz.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 ***************************************************************************************************/
33 #ifndef _COIMBRA_VISUALIZATION_RVIZ_H_
34 #define _COIMBRA_VISUALIZATION_RVIZ_H_
35 
36 #include <vector>
37 
45 class Markers
46 {
47  public:
48  void update(visualization_msgs::Marker& marker)
49  {
50  for(uint i=0;i<markers.size();++i)
51  if(markers[i].ns==marker.ns && markers[i].id==marker.id)//Marker found
52  {
53  markers.erase(markers.begin()+i);
54  break;
55  }
56 
57  markers.push_back(marker);
58  }
59 
60  void decrement(void)
61  {
62  for(uint i=0;i<markers.size();++i)
63  {
64  switch(markers[i].action)
65  {
66  case visualization_msgs::Marker::ADD:
67  markers[i].action = visualization_msgs::Marker::DELETE;
68  break;
69  case visualization_msgs::Marker::DELETE:
70  markers[i].action = -1;
71  break;
72  }
73  }
74  }
75 
76  void clean(void)
77  {
78  vector<visualization_msgs::Marker> new_markers;
79 
80  for(uint i=0;i<markers.size();++i)
81  if(markers[i].action!=-1)
82  new_markers.push_back(markers[i]);
83 
84  markers=new_markers;
85  }
86 
87  vector<visualization_msgs::Marker> getOutgoingMarkers(void)
88  {
89  vector<visualization_msgs::Marker> m_out(markers);
90  return markers;
91  }
92 
93  private:
94 
95  vector<visualization_msgs::Marker> markers;
96 };
97 
98 
114 vector<visualization_msgs::Marker> createTargetMarkers( vector<ClusterPtr>& clusters , vector<ClusterPtr>& clusters_Premebida , vector<ClusterPtr>& clusters_Dietmayer, vector<ClusterPtr>& clusters_Santos, vector<ClusterPtr>& clusters_ABD ,vector<ClusterPtr>& clusters_nn , vector<ClusterPtr>& clusters_GT );
115 
116 #endif
117 
118 
vector< visualization_msgs::Marker > markers
void update(visualization_msgs::Marker &marker)
void decrement(void)
vector< visualization_msgs::Marker > getOutgoingMarkers(void)
void clean(void)
vector< visualization_msgs::Marker > createTargetMarkers(vector< ClusterPtr > &clusters, vector< ClusterPtr > &clusters_Premebida, vector< ClusterPtr > &clusters_Dietmayer, vector< ClusterPtr > &clusters_Santos, vector< ClusterPtr > &clusters_ABD, vector< ClusterPtr > &clusters_nn, vector< ClusterPtr > &clusters_GT)
Create marker form clusters This function creates a set of markers for the current clusters from the ...


lidar_segmentation
Author(s): Daniel Coimbra
autogenerated on Mon Mar 2 2015 01:32:12