Public Types | Public Member Functions | Protected Attributes | Private Attributes | List of all members
mesh_map::AbstractLayer Class Referenceabstract

#include <abstract_layer.h>

Public Types

typedef boost::shared_ptr< mesh_map::AbstractLayerPtr
 

Public Member Functions

virtual bool computeLayer ()=0
 Function which is called to compute the layer costs. It is called if the layer information could not be loaded or if another layer triggered an update. More...
 
virtual lvr2::VertexMap< float > & costs ()=0
 Returns a vertex map, which associates a cost to each vertex handle. If a vertex handle is not associated with a cost value, i.e. there is no value in the map, the mesh_map will use the default value from threshold(). More...
 
virtual float defaultValue ()=0
 Defines the default value for all vertex costs which are not set in the layer. More...
 
virtual bool initialize (const std::string &name)=0
 Initializes the layer plugin with the giben name. More...
 
virtual bool initialize (const std::string &name, const notify_func notify_update, std::shared_ptr< mesh_map::MeshMap > &map, std::shared_ptr< lvr2::HalfEdgeMesh< Vector >> &mesh, std::shared_ptr< lvr2::AttributeMeshIOBase > &io)
 Initializes the layer plugin under the mesh_map namespace ans sets some basic attributes. More...
 
virtual std::set< lvr2::VertexHandle > & lethals ()=0
 Returns a set of vertex handles which are associated with "lethal" obstacles. More...
 
void notifyChange ()
 
virtual bool readLayer ()=0
 reads the layer data, e.g. from a file, or a database More...
 
virtual float threshold ()=0
 Defines the threshold value to consider vertices as a "lethal" obstacle. All vertices with cost values in the layer which a greater than the threshold value are marked as "lethal obstacle". More...
 
virtual void updateLethal (std::set< lvr2::VertexHandle > &added_lethal, std::set< lvr2::VertexHandle > &removed_lethal)=0
 Called by the mesh map if another previously processed layer triggers an update. More...
 
virtual lvr2::BaseVector< float > vectorAt (const lvr2::VertexHandle &vertex)
 Optional method if the layer computes vectors. Computes a vector for a given vertex handle. More...
 
virtual lvr2::BaseVector< float > vectorAt (const std::array< lvr2::VertexHandle, 3 > &vertices, const std::array< float, 3 > &barycentric_coords)
 Optional method if the layer computes vectors. Computes a vector within a triangle using barycentric coordinates. More...
 
virtual const boost::optional< lvr2::VertexMap< lvr2::BaseVector< float > > & > vectorMap ()
 Optional vector map. Can be implemented if the layer should also compute vectors. If the implmented layer computes a vector field, this method is used to inject the vector field into the mesh map. More...
 
virtual bool writeLayer ()=0
 Writes the layer data, e.g. to a file, or a database. More...
 

Protected Attributes

std::string layer_name
 
std::shared_ptr< mesh_map::MeshMapmap_ptr
 
std::shared_ptr< lvr2::AttributeMeshIOBasemesh_io_ptr
 
std::shared_ptr< lvr2::HalfEdgeMesh< Vector > > mesh_ptr
 
ros::NodeHandle private_nh
 

Private Attributes

notify_func notify
 

Detailed Description

Definition at line 56 of file abstract_layer.h.

Member Typedef Documentation

◆ Ptr

Definition at line 59 of file abstract_layer.h.

Member Function Documentation

◆ computeLayer()

virtual bool mesh_map::AbstractLayer::computeLayer ( )
pure virtual

Function which is called to compute the layer costs. It is called if the layer information could not be loaded or if another layer triggered an update.

Returns
true, if the layer costs have been computed successfully.

◆ costs()

virtual lvr2::VertexMap<float>& mesh_map::AbstractLayer::costs ( )
pure virtual

Returns a vertex map, which associates a cost to each vertex handle. If a vertex handle is not associated with a cost value, i.e. there is no value in the map, the mesh_map will use the default value from threshold().

Returns
a vertex map containing floats.

◆ defaultValue()

virtual float mesh_map::AbstractLayer::defaultValue ( )
pure virtual

Defines the default value for all vertex costs which are not set in the layer.

Returns
The default layer cost value, e.g. nan, 0, or -1, etc.

◆ initialize() [1/2]

virtual bool mesh_map::AbstractLayer::initialize ( const std::string &  name)
pure virtual

Initializes the layer plugin with the giben name.

◆ initialize() [2/2]

virtual bool mesh_map::AbstractLayer::initialize ( const std::string &  name,
const notify_func  notify_update,
std::shared_ptr< mesh_map::MeshMap > &  map,
std::shared_ptr< lvr2::HalfEdgeMesh< Vector >> &  mesh,
std::shared_ptr< lvr2::AttributeMeshIOBase > &  io 
)
inlinevirtual

Initializes the layer plugin under the mesh_map namespace ans sets some basic attributes.

Definition at line 156 of file abstract_layer.h.

◆ lethals()

virtual std::set<lvr2::VertexHandle>& mesh_map::AbstractLayer::lethals ( )
pure virtual

Returns a set of vertex handles which are associated with "lethal" obstacles.

Returns
set of vertex handles which are associated with lethal obstalces.

◆ notifyChange()

void mesh_map::AbstractLayer::notifyChange ( )
inline

Definition at line 169 of file abstract_layer.h.

◆ readLayer()

virtual bool mesh_map::AbstractLayer::readLayer ( )
pure virtual

reads the layer data, e.g. from a file, or a database

Returns
true, if the layer data has been read successfully

◆ threshold()

virtual float mesh_map::AbstractLayer::threshold ( )
pure virtual

Defines the threshold value to consider vertices as a "lethal" obstacle. All vertices with cost values in the layer which a greater than the threshold value are marked as "lethal obstacle".

Returns

◆ updateLethal()

virtual void mesh_map::AbstractLayer::updateLethal ( std::set< lvr2::VertexHandle > &  added_lethal,
std::set< lvr2::VertexHandle > &  removed_lethal 
)
pure virtual

Called by the mesh map if another previously processed layer triggers an update.

Parameters
added_lethalThe "lethal" obstacle vertex handles which are new with respect to the previous call.
removed_lethalOld "lethal" obstacle vertex handles, i.e. vertices which are no "lethal" obstacles anymore.

◆ vectorAt() [1/2]

virtual lvr2::BaseVector<float> mesh_map::AbstractLayer::vectorAt ( const lvr2::VertexHandle vertex)
inlinevirtual

Optional method if the layer computes vectors. Computes a vector for a given vertex handle.

Returns
a vector for the given vertex. Default is an vertex with length 0.

Definition at line 143 of file abstract_layer.h.

◆ vectorAt() [2/2]

virtual lvr2::BaseVector<float> mesh_map::AbstractLayer::vectorAt ( const std::array< lvr2::VertexHandle, 3 > &  vertices,
const std::array< float, 3 > &  barycentric_coords 
)
inlinevirtual

Optional method if the layer computes vectors. Computes a vector within a triangle using barycentric coordinates.

Parameters
verticesThe three triangle vertices.
barycentric_coordsThe thee barycentric coordinates.
Returns
The vector for the given barycentric coordinates with respect to the corresponding triangle. Default is an vertex with length 0.

Definition at line 122 of file abstract_layer.h.

◆ vectorMap()

virtual const boost::optional<lvr2::VertexMap<lvr2::BaseVector<float> >&> mesh_map::AbstractLayer::vectorMap ( )
inlinevirtual

Optional vector map. Can be implemented if the layer should also compute vectors. If the implmented layer computes a vector field, this method is used to inject the vector field into the mesh map.

Returns
an optional vector map.

Definition at line 134 of file abstract_layer.h.

◆ writeLayer()

virtual bool mesh_map::AbstractLayer::writeLayer ( )
pure virtual

Writes the layer data, e.g. to a file, or a database.

Returns
true, if the layer data has been written successfully

Member Data Documentation

◆ layer_name

std::string mesh_map::AbstractLayer::layer_name
protected

Definition at line 175 of file abstract_layer.h.

◆ map_ptr

std::shared_ptr<mesh_map::MeshMap> mesh_map::AbstractLayer::map_ptr
protected

Definition at line 178 of file abstract_layer.h.

◆ mesh_io_ptr

std::shared_ptr<lvr2::AttributeMeshIOBase> mesh_map::AbstractLayer::mesh_io_ptr
protected

Definition at line 176 of file abstract_layer.h.

◆ mesh_ptr

std::shared_ptr<lvr2::HalfEdgeMesh<Vector> > mesh_map::AbstractLayer::mesh_ptr
protected

Definition at line 177 of file abstract_layer.h.

◆ notify

notify_func mesh_map::AbstractLayer::notify
private

Definition at line 183 of file abstract_layer.h.

◆ private_nh

ros::NodeHandle mesh_map::AbstractLayer::private_nh
protected

Definition at line 180 of file abstract_layer.h.


The documentation for this class was generated from the following file:


mesh_map
Author(s): Sebastian Pütz
autogenerated on Thu Jan 25 2024 03:42:46