roughness_layer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020, Sebastian Pütz
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above
12  * copyright notice, this list of conditions and the following
13  * disclaimer in the documentation and/or other materials provided
14  * with the distribution.
15  *
16  * 3. Neither the name of the copyright holder nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * authors:
34  * Sebastian Pütz <spuetz@uni-osnabrueck.de>
35  *
36  */
37 
38 #ifndef MESH_MAP__ROUGHNESS_LAYER_H
39 #define MESH_MAP__ROUGHNESS_LAYER_H
40 
41 #include <dynamic_reconfigure/server.h>
42 #include <mesh_layers/RoughnessLayerConfig.h>
44 
45 namespace mesh_layers
46 {
52 {
58  virtual bool readLayer();
59 
65  virtual bool writeLayer();
66 
72  virtual float threshold();
73 
79  virtual float defaultValue()
80  {
81  return std::numeric_limits<float>::infinity();
82  }
83 
89  virtual bool computeLayer();
90 
96  bool computeLethals();
97 
103  virtual lvr2::VertexMap<float>& costs();
104 
110  virtual std::set<lvr2::VertexHandle>& lethals()
111  {
112  return lethal_vertices;
113  }
114 
121  virtual void updateLethal(std::set<lvr2::VertexHandle>& added_lethal, std::set<lvr2::VertexHandle>& removed_lethal){};
122 
130  virtual bool initialize(const std::string& name);
131 
132  // latest costmap
134  // set of all current lethal vertices
135  std::set<lvr2::VertexHandle> lethal_vertices;
136 
137  // Server for Reconfiguration
139  dynamic_reconfigure::Server<mesh_layers::RoughnessLayerConfig>::CallbackType config_callback;
140  // true if the first reconfigure config has been received; else false
142  // current reconfigure config
143  RoughnessLayerConfig config;
144 
151  void reconfigureCallback(mesh_layers::RoughnessLayerConfig& cfg, uint32_t level);
152 };
153 
154 } /* namespace mesh_layers */
155 
156 #endif // MESH_MAP__ROUGHNESS_LAYER_H
mesh_layers::RoughnessLayer::updateLethal
virtual void updateLethal(std::set< lvr2::VertexHandle > &added_lethal, std::set< lvr2::VertexHandle > &removed_lethal)
update set of lethal vertices by adding and removing vertices
Definition: roughness_layer.h:121
boost::shared_ptr
mesh_layers::RoughnessLayer::initialize
virtual bool initialize(const std::string &name)
initializes this layer plugin
Definition: roughness_layer.cpp:163
lvr2::AttributeMap
mesh_layers::RoughnessLayer::threshold
virtual float threshold()
delivers the threshold above which vertices are marked lethal
Definition: roughness_layer.cpp:84
mesh_layers
Definition: height_diff_layer.h:45
mesh_layers::RoughnessLayer::reconfigureCallback
void reconfigureCallback(mesh_layers::RoughnessLayerConfig &cfg, uint32_t level)
callback for incoming reconfigure configs
Definition: roughness_layer.cpp:142
mesh_layers::RoughnessLayer::reconfigure_server_ptr
boost::shared_ptr< dynamic_reconfigure::Server< mesh_layers::RoughnessLayerConfig > > reconfigure_server_ptr
Definition: roughness_layer.h:138
mesh_layers::RoughnessLayer::first_config
bool first_config
Definition: roughness_layer.h:141
lvr2::VectorMap
mesh_map::AbstractLayer
mesh_layers::RoughnessLayer::writeLayer
virtual bool writeLayer()
try to write layer to map file
Definition: roughness_layer.cpp:62
abstract_layer.h
mesh_layers::RoughnessLayer
Costmap layer which calculates the roughness of the surface. This is useful to differentiate paths fr...
Definition: roughness_layer.h:51
mesh_layers::RoughnessLayer::config_callback
dynamic_reconfigure::Server< mesh_layers::RoughnessLayerConfig >::CallbackType config_callback
Definition: roughness_layer.h:139
mesh_layers::RoughnessLayer::costs
virtual lvr2::VertexMap< float > & costs()
deliver the current costmap
Definition: roughness_layer.cpp:140
mesh_layers::RoughnessLayer::computeLayer
virtual bool computeLayer()
calculate the values of this layer
Definition: roughness_layer.cpp:86
mesh_layers::RoughnessLayer::lethals
virtual std::set< lvr2::VertexHandle > & lethals()
deliver set containing all vertices marked as lethal
Definition: roughness_layer.h:110
mesh_layers::RoughnessLayer::readLayer
virtual bool readLayer()
try read layer from map file
Definition: roughness_layer.cpp:48
mesh_layers::RoughnessLayer::lethal_vertices
std::set< lvr2::VertexHandle > lethal_vertices
Definition: roughness_layer.h:135
mesh_layers::RoughnessLayer::defaultValue
virtual float defaultValue()
delivers the default layer value
Definition: roughness_layer.h:79
mesh_layers::RoughnessLayer::config
RoughnessLayerConfig config
Definition: roughness_layer.h:143
mesh_layers::RoughnessLayer::roughness
lvr2::DenseVertexMap< float > roughness
Definition: roughness_layer.h:133
mesh_layers::RoughnessLayer::computeLethals
bool computeLethals()
mark vertices with values above the threshold as lethal
Definition: roughness_layer.cpp:72


mesh_layers
Author(s): Sebastian Pütz
autogenerated on Thu Jan 25 2024 03:43:03