representation_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 ***************************************************************************************************/
27 #ifndef _REPRESENTATION_RVIZ_H_
28 #define _REPRESENTATION_RVIZ_H_
29 
31 
32 
48 class Markers
49 {
50  public:
51  void update(visualization_msgs::Marker& marker)
52  {
53  for(uint i=0;i<markers.size();++i)
54  if(markers[i].ns==marker.ns && markers[i].id==marker.id)//Marker found
55  {
56  markers.erase(markers.begin()+i);
57  break;
58  }
59 
60  markers.push_back(marker);
61  }
62 
63  void decrement(void)
64  {
65  for(uint i=0;i<markers.size();++i)
66  {
67  switch(markers[i].action)
68  {
69  case visualization_msgs::Marker::ADD:
70  markers[i].action = visualization_msgs::Marker::DELETE;
71  break;
72  case visualization_msgs::Marker::DELETE:
73  markers[i].action = -1;
74  break;
75  }
76  }
77  }
78 
79  void clean(void)
80  {
81  vector<visualization_msgs::Marker> new_markers;
82 
83  for(uint i=0;i<markers.size();++i)
84  if(markers[i].action!=-1)
85  new_markers.push_back(markers[i]);
86 
87  markers=new_markers;
88  }
89 
90  vector<visualization_msgs::Marker> getOutgoingMarkers(void)
91  {
92  vector<visualization_msgs::Marker> m_out(markers);
93  return markers;
94  }
95 
96  private:
97 
98  vector<visualization_msgs::Marker> markers;
99 };
100 
109 vector<visualization_msgs::Marker> create_Markers_ElavationMap(Navigability_Map& nav_map, std::string grid_frame);
110 
119 visualization_msgs::Marker create_Markers_Normals(Navigability_Map& nav_map, std::string grid_frame);
120 
129 vector<visualization_msgs::Marker> create_Markers_AccessibilityMap(Navigability_Map& nav_map, std::string grid_frame);
130 
135 visualization_msgs::Marker create_Markers_Polygon(Navigability_Map& nav_map, std::string grid_frame);
136 visualization_msgs::Marker create_Markers_Obstacle(Navigability_Map& nav_map, std::string grid_frame);
137 
138 
139 #endif
visualization_msgs::Marker create_Markers_Normals(Navigability_Map &nav_map, std::string grid_frame)
Function to generate marker for the visualization of the Normals on the Class Navigability_Map.
vector< visualization_msgs::Marker > markers
void update(visualization_msgs::Marker &marker)
visualization_msgs::Marker create_Markers_Obstacle(Navigability_Map &nav_map, std::string grid_frame)
vector< visualization_msgs::Marker > create_Markers_AccessibilityMap(Navigability_Map &nav_map, std::string grid_frame)
Function to generate marker for the visualization of the Accessibility Map on the Class Navigability_...
void decrement(void)
vector< visualization_msgs::Marker > create_Markers_ElavationMap(Navigability_Map &nav_map, std::string grid_frame)
Function to generate marker for the visualization of the Elevation Map on the Class Navigability_Map...
visualization_msgs::Marker create_Markers_Polygon(Navigability_Map &nav_map, std::string grid_frame)
vector< visualization_msgs::Marker > getOutgoingMarkers(void)
void clean(void)


navigability_map
Author(s): Diogo Matos
autogenerated on Mon Mar 2 2015 01:32:29