steepness_layer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020, The authors
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  * Malte kl. Piening <malte@klpiening.de>
35  *
36  */
37 
38 #ifndef MESH_MAP__STEEPNESS_LAYER_H
39 #define MESH_MAP__STEEPNESS_LAYER_H
40 
41 #include <dynamic_reconfigure/server.h>
42 #include <mesh_layers/SteepnessLayerConfig.h>
44 
45 namespace mesh_layers
46 {
51 {
57  virtual bool readLayer();
58 
64  virtual bool writeLayer();
65 
71  virtual float threshold();
72 
78  virtual float defaultValue()
79  {
80  return std::numeric_limits<float>::infinity();
81  }
82 
88  virtual bool computeLayer();
89 
95  bool computeLethals();
96 
102  virtual lvr2::VertexMap<float>& costs();
103 
109  virtual std::set<lvr2::VertexHandle>& lethals()
110  {
111  return lethal_vertices;
112  }
113 
120  virtual void updateLethal(std::set<lvr2::VertexHandle>& added_lethal, std::set<lvr2::VertexHandle>& removed_lethal){};
121 
129  virtual bool initialize(const std::string& name);
130 
131  // latest costmap
133  // set of all current lethal vertices
134  std::set<lvr2::VertexHandle> lethal_vertices;
135 
136  // Server for Reconfiguration
138  dynamic_reconfigure::Server<mesh_layers::SteepnessLayerConfig>::CallbackType config_callback;
139  // true if the first reconfigure config has been received; else false
141  // current reconfigure config
142  SteepnessLayerConfig config;
143 
150  void reconfigureCallback(mesh_layers::SteepnessLayerConfig& cfg, uint32_t level);
151 };
152 
153 } /* namespace mesh_layers */
154 
155 #endif // MESH_MAP__STEEPNESS_LAYER_H
boost::shared_ptr
mesh_layers::SteepnessLayer::computeLethals
bool computeLethals()
mark vertices with values above the threshold as lethal
Definition: steepness_layer.cpp:77
lvr2::AttributeMap
mesh_layers::SteepnessLayer::writeLayer
virtual bool writeLayer()
try to write layer to map file
Definition: steepness_layer.cpp:63
mesh_layers::SteepnessLayer::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: steepness_layer.h:120
mesh_layers::SteepnessLayer::lethals
virtual std::set< lvr2::VertexHandle > & lethals()
deliver set containing all vertices marked as lethal
Definition: steepness_layer.h:109
mesh_layers
Definition: height_diff_layer.h:45
mesh_layers::SteepnessLayer::reconfigureCallback
void reconfigureCallback(mesh_layers::SteepnessLayerConfig &cfg, uint32_t level)
callback for incoming reconfigure configs
Definition: steepness_layer.cpp:168
mesh_layers::SteepnessLayer::initialize
virtual bool initialize(const std::string &name)
initializes this layer plugin
Definition: steepness_layer.cpp:192
mesh_layers::SteepnessLayer::config_callback
dynamic_reconfigure::Server< mesh_layers::SteepnessLayerConfig >::CallbackType config_callback
Definition: steepness_layer.h:138
lvr2::VectorMap
mesh_layers::SteepnessLayer::lethal_vertices
std::set< lvr2::VertexHandle > lethal_vertices
Definition: steepness_layer.h:134
mesh_map::AbstractLayer
mesh_layers::SteepnessLayer::steepness
lvr2::DenseVertexMap< float > steepness
Definition: steepness_layer.h:132
abstract_layer.h
mesh_layers::SteepnessLayer::computeLayer
virtual bool computeLayer()
calculate the values of this layer
Definition: steepness_layer.cpp:95
mesh_layers::SteepnessLayer
Costmap layer which calculates the steepness of the vertices. This is useful to avoid stairs.
Definition: steepness_layer.h:50
mesh_layers::SteepnessLayer::threshold
virtual float threshold()
delivers the threshold above which vertices are marked lethal
Definition: steepness_layer.cpp:90
mesh_layers::SteepnessLayer::first_config
bool first_config
Definition: steepness_layer.h:140
mesh_layers::SteepnessLayer::defaultValue
virtual float defaultValue()
delivers the default layer value
Definition: steepness_layer.h:78
mesh_layers::SteepnessLayer::reconfigure_server_ptr
boost::shared_ptr< dynamic_reconfigure::Server< mesh_layers::SteepnessLayerConfig > > reconfigure_server_ptr
Definition: steepness_layer.h:137
mesh_layers::SteepnessLayer::config
SteepnessLayerConfig config
Definition: steepness_layer.h:142
mesh_layers::SteepnessLayer::costs
virtual lvr2::VertexMap< float > & costs()
deliver the current costmap
Definition: steepness_layer.cpp:163
mesh_layers::SteepnessLayer::readLayer
virtual bool readLayer()
try read layer from map file
Definition: steepness_layer.cpp:49


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