Go to the documentation of this file.
57 ridge = ridge_opt.get();
104 if (face_normals_opt)
106 face_normals = face_normals_opt.
get();
111 ROS_INFO_STREAM(
"No face normals found in the given map file, computing them...");
114 if (
mesh_io_ptr->addDenseAttributeMap(face_normals,
"face_normals"))
128 if (vertex_normals_opt)
130 vertex_normals = vertex_normals_opt.
get();
135 ROS_INFO_STREAM(
"No vertex normals found in the given map file, computing them...");
137 if (
mesh_io_ptr->addDenseAttributeMap(vertex_normals,
"vertex_normals"))
150 for (
size_t i = 0; i <
mesh_ptr->nextVertexIndex(); i++)
159 std::set<lvr2::VertexHandle> invalid;
162 int num_neighbours = 0;
165 lvr2::BaseVector<float> current_point = mesh_ptr->getVertexPosition(vertex) + vertex_normals[vertex];
166 value += (current_point - reference).length();
170 if (num_neighbours == 0)
176 ridge.insert(vH, value / num_neighbours);
191 ROS_INFO_STREAM(
"New ridge layer config through dynamic reconfigure.");
199 if (
config.threshold != cfg.threshold)
205 if (
config.radius != cfg.radius)
221 new dynamic_reconfigure::Server<mesh_layers::RidgeLayerConfig>(
private_nh));
void reconfigureCallback(mesh_layers::RidgeLayerConfig &cfg, uint32_t level)
callback for incoming reconfigure configs
std::set< lvr2::VertexHandle > lethal_vertices
virtual bool writeLayer()
try to write layer to map file
#define ROS_ERROR_STREAM(args)
size_t numValues() const final
virtual float threshold()
delivers the threshold above which vertices are marked lethal
boost::shared_ptr< dynamic_reconfigure::Server< mesh_layers::RidgeLayerConfig > > reconfigure_server_ptr
void visitLocalVertexNeighborhood(const BaseMesh< BaseVecT > &mesh, VertexHandle vH, double radius, VisitorF visitor)
dynamic_reconfigure::Server< mesh_layers::RidgeLayerConfig >::CallbackType config_callback
Costmap layer which assigns high costs to ridges. This is useful for dam avoidance in agricultural ap...
virtual bool computeLayer()
calculate the values of this layer
virtual lvr2::VertexMap< float > & costs()
deliver the current costmap
virtual bool initialize(const std::string &name)
initializes this layer plugin
virtual bool readLayer()
try read layer from map file
boost::optional< const ValueT & > get(HandleT key) const final
#define ROS_INFO_STREAM(args)
lvr2::DenseVertexMap< float > ridge
ros::NodeHandle private_nh
std::shared_ptr< lvr2::AttributeMeshIOBase > mesh_io_ptr
std::shared_ptr< lvr2::HalfEdgeMesh< Vector > > mesh_ptr
PLUGINLIB_EXPORT_CLASS(mesh_layers::InflationLayer, mesh_map::AbstractLayer)
DenseVertexMap< Normal< typename BaseVecT::CoordType > > calcVertexNormals(const BaseMesh< BaseVecT > &mesh, const FaceMap< Normal< typename BaseVecT::CoordType >> &normals)
bool computeLethals()
mark vertices with values above the threshold as lethal
DenseFaceMap< Normal< typename BaseVecT::CoordType > > calcFaceNormals(const BaseMesh< BaseVecT > &mesh)
mesh_layers
Author(s): Sebastian Pütz
autogenerated on Thu Jan 25 2024 03:43:03