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. | |
SensorType::Parameters & | parameters () |
returns the Sensor Parameters | |
const SensorType::Parameters & | parameters () const |
returns the Sensor Parameters | |
![]() | |
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. | |
~MeshFilterBase () | |
Destructor. | |
MeshHandle | addMesh (const shapes::Mesh &mesh) |
adds a mesh to the filter object. | |
void | removeMesh (MeshHandle mesh_handle) |
removes a mesh given by its handle | |
void | filter (const void *sensor_data, GLushort type, bool wait=false) const |
label/remove pixels from input depth-image | |
void | getFilteredLabels (LabelType *labels) const |
retrieves the labels of the input data | |
void | getFilteredDepth (float *depth) const |
retrieves the filtered depth values | |
void | getModelLabels (LabelType *labels) const |
retrieves the labels of the rendered model | |
void | getModelDepth (float *depth) const |
retrieves the depth values of the rendered model | |
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 | |
void | setTransformCallback (const TransformCallback &transform_callback) |
set the callback for retrieving transformations for each mesh. | |
void | setPaddingScale (float scale) |
set the scale component of padding used to multiply with sensor-specific padding coefficients to get final coefficients. | |
void | setPaddingOffset (float offset) |
set the offset component of padding. This value is added to the scaled sensor-specific constant component. | |
Additional Inherited Members | |
![]() | |
enum | { BACKGROUND = 0 , SHADOW = 1 , NEAR_CLIP = 2 , FAR_CLIP = 3 , FIRST_LABEL = 16 } |
typedef std::function< bool(MeshHandle, Eigen::Isometry3d &)> | TransformCallback |
![]() | |
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 | |
void | deInitialize () |
cleaning up | |
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 | |
void | doFilter (const void *sensor_data, const int encoding) const |
the filter method that does the magic | |
void | addMeshHelper (MeshHandle handle, const shapes::Mesh &cmesh) |
used within a Job to allow the main thread adding meshes | |
bool | removeMeshHelper (MeshHandle handle) |
used within a Job to allow the main thread removing meshes | |
void | addJob (const JobPtr &job) const |
add a Job for the main thread that needs to be executed there | |
void | setSize (unsigned int width, unsigned int height) |
sets the size of the frame buffers | |
![]() | |
std::map< MeshHandle, GLMeshPtr > | meshes_ |
storage for meshed to be filtered | |
SensorModel::ParametersPtr | sensor_parameters_ |
the parameters of the used sensor model | |
MeshHandle | next_handle_ |
next handle to be used for next mesh that is added | |
MeshHandle | min_handle_ |
Handle values below this are all taken (this variable is used for more efficient computation of next_label_) | |
std::thread | filter_thread_ |
the filtering thread that also holds the OpenGL context | |
std::condition_variable | jobs_condition_ |
condition variable to notify the filtering thread if a new image arrived | |
std::mutex | jobs_mutex_ |
mutex required for synchronization of condition states | |
std::queue< JobPtr > | jobs_queue_ |
OpenGL job queue that need to be processed by the worker thread. | |
std::mutex | meshes_mutex_ |
mutex for synchronization of updating filtered meshes | |
std::mutex | transform_callback_mutex_ |
mutex for synchronization of setting/calling transform_callback_ | |
bool | stop_ |
indicates whether the filtering loop should stop | |
GLRendererPtr | mesh_renderer_ |
first pass renderer for rendering the mesh | |
GLRendererPtr | depth_filter_ |
second pass renderer for filtering the results of first pass | |
GLuint | canvas_ |
canvas element (screen-filling quad) for second pass | |
GLuint | sensor_depth_texture_ |
handle depth texture from sensor data | |
GLuint | shadow_threshold_location_ |
handle to GLSL location of shadow threshold | |
TransformCallback | transform_callback_ |
callback function for retrieving the mesh transformations | |
float | padding_scale_ |
padding scale | |
float | padding_offset_ |
padding offset | |
float | shadow_threshold_ |
threshold for shadowed pixels vs. filtered pixels | |
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 | ( | ) | const |
returns the Sensor Parameters
Definition at line 106 of file mesh_filter.h.