moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
MeshFilter filters out points that belong to given meshes in depth-images. More...
#include <mesh_filter.h>
Public Member Functions | |
MOVEIT_DECLARE_PTR_MEMBER (MeshFilter) | |
MeshFilter (const TransformCallback &transform_callback=TransformCallback(), const typename SensorType::Parameters &sensor_parameters=typename SensorType::Parameters()) | |
Constructor. More... | |
SensorType::Parameters & | parameters () |
returns the Sensor Parameters More... | |
const SensorType::Parameters & | parameters () const |
returns the Sensor Parameters More... | |
Public Member Functions inherited from mesh_filter::MeshFilterBase | |
MeshFilterBase (const TransformCallback &transform_callback, const SensorModel::Parameters &sensor_parameters, const std::string &render_vertex_shader="", const std::string &render_fragment_shader="", const std::string &filter_vertex_shader="", const std::string &filter_fragment_shader="") | |
Constructor. More... | |
~MeshFilterBase () | |
Destructor. More... | |
MeshHandle | addMesh (const shapes::Mesh &mesh) |
adds a mesh to the filter object. More... | |
void | removeMesh (MeshHandle mesh_handle) |
removes a mesh given by its handle More... | |
void | filter (const void *sensor_data, GLushort type, bool wait=false) const |
label/remove pixels from input depth-image More... | |
void | getFilteredLabels (LabelType *labels) const |
retrieves the labels of the input data More... | |
void | getFilteredDepth (float *depth) const |
retrieves the filtered depth values More... | |
void | getModelLabels (LabelType *labels) const |
retrieves the labels of the rendered model More... | |
void | getModelDepth (float *depth) const |
retrieves the depth values of the rendered model More... | |
void | setShadowThreshold (float threshold) |
set the shadow threshold. points that are further away than the rendered model are filtered out. Except they are further away than this threshold. Then these points are kept, but its label is set to 1 indicating that it is in the shadow of the model More... | |
void | setTransformCallback (const TransformCallback &transform_callback) |
set the callback for retrieving transformations for each mesh. More... | |
void | setPaddingScale (float scale) |
set the scale component of padding used to multiply with sensor-specific padding coefficients to get final coefficients. More... | |
void | setPaddingOffset (float offset) |
set the offset component of padding. This value is added to the scaled sensor-specific constant component. More... | |
Additional Inherited Members | |
Public Types inherited from mesh_filter::MeshFilterBase | |
enum | { BACKGROUND = 0 , SHADOW = 1 , NEAR_CLIP = 2 , FAR_CLIP = 3 , FIRST_LABEL = 16 } |
typedef std::function< bool(MeshHandle, Eigen::Isometry3d &)> | TransformCallback |
Protected Member Functions inherited from mesh_filter::MeshFilterBase | |
void | initialize (const std::string &render_vertex_shader, const std::string &render_fragment_shader, const std::string &filter_vertex_shader, const std::string &filter_fragment_shader) |
initializes OpenGL related things as well as renderers More... | |
void | deInitialize () |
cleaning up More... | |
void | run (const std::string &render_vertex_shader, const std::string &render_fragment_shader, const std::string &filter_vertex_shader, const std::string &filter_fragment_shader) |
filtering thread More... | |
void | doFilter (const void *sensor_data, const int encoding) const |
the filter method that does the magic More... | |
void | addMeshHelper (MeshHandle handle, const shapes::Mesh &cmesh) |
used within a Job to allow the main thread adding meshes More... | |
bool | removeMeshHelper (MeshHandle handle) |
used within a Job to allow the main thread removing meshes More... | |
void | addJob (const JobPtr &job) const |
add a Job for the main thread that needs to be executed there More... | |
void | setSize (unsigned int width, unsigned int height) |
sets the size of the fram buffers More... | |
Protected Attributes inherited from mesh_filter::MeshFilterBase | |
std::map< MeshHandle, GLMeshPtr > | meshes_ |
storage for meshed to be filtered More... | |
SensorModel::ParametersPtr | sensor_parameters_ |
the parameters of the used sensor model More... | |
MeshHandle | next_handle_ |
next handle to be used for next mesh that is added More... | |
MeshHandle | min_handle_ |
Handle values below this are all taken (this variable is used for more efficient computation of next_label_) More... | |
std::thread | filter_thread_ |
the filtering thread that also holds the OpenGL context More... | |
std::condition_variable | jobs_condition_ |
condition variable to notify the filtering thread if a new image arrived More... | |
std::mutex | jobs_mutex_ |
mutex required for synchronization of condition states More... | |
std::queue< JobPtr > | jobs_queue_ |
OpenGL job queue that need to be processed by the worker thread. More... | |
std::mutex | meshes_mutex_ |
mutex for synchronization of updating filtered meshes More... | |
std::mutex | transform_callback_mutex_ |
mutex for synchronization of setting/calling transform_callback_ More... | |
bool | stop_ |
indicates whether the filtering loop should stop More... | |
GLRendererPtr | mesh_renderer_ |
first pass renderer for rendering the mesh More... | |
GLRendererPtr | depth_filter_ |
second pass renderer for filtering the results of first pass More... | |
GLuint | canvas_ |
canvas element (screen-filling quad) for second pass More... | |
GLuint | sensor_depth_texture_ |
handle depth texture from sensor data More... | |
GLuint | shadow_threshold_location_ |
handle to GLSL location of shadow threshold More... | |
TransformCallback | transform_callback_ |
callback function for retrieving the mesh transformations More... | |
float | padding_scale_ |
padding scale More... | |
float | padding_offset_ |
padding offset More... | |
float | shadow_threshold_ |
threshold for shadowed pixels vs. filtered pixels More... | |
MeshFilter filters out points that belong to given meshes in depth-images.
Definition at line 60 of file mesh_filter.h.
mesh_filter::MeshFilter< SensorType >::MeshFilter | ( | const TransformCallback & | transform_callback = TransformCallback() , |
const typename SensorType::Parameters & | sensor_parameters = typename SensorType::Parameters() |
||
) |
Constructor.
[in] | transform_callback | Callback function that is called for each mesh to obtain the current transformation. |
Definition at line 91 of file mesh_filter.h.
mesh_filter::MeshFilter< SensorType >::MOVEIT_DECLARE_PTR_MEMBER | ( | MeshFilter< SensorType > | ) |
SensorType::Parameters & mesh_filter::MeshFilter< SensorType >::parameters |
returns the Sensor Parameters
Definition at line 100 of file mesh_filter.h.
const SensorType::Parameters & mesh_filter::MeshFilter< SensorType >::parameters |
returns the Sensor Parameters
Definition at line 106 of file mesh_filter.h.