Go to the documentation of this file.
43 #include <Eigen/Geometry>
46 #include <condition_variable>
89 const std::string& render_vertex_shader =
"",
const std::string& render_fragment_shader =
"",
90 const std::string& filter_vertex_shader =
"",
const std::string& filter_fragment_shader =
"");
117 void filter(
const void* sensor_data, GLushort type,
bool wait =
false)
const;
187 void initialize(
const std::string& render_vertex_shader,
const std::string& render_fragment_shader,
188 const std::string& filter_vertex_shader,
const std::string& filter_fragment_shader);
198 void run(
const std::string& render_vertex_shader,
const std::string& render_fragment_shader,
199 const std::string& filter_vertex_shader,
const std::string& filter_fragment_shader);
206 void doFilter(
const void* sensor_data,
const int encoding)
const;
225 void addJob(
const JobPtr& job)
const;
233 void setSize(
unsigned int width,
unsigned int height);
void setPaddingScale(float scale)
set the scale component of padding used to multiply with sensor-specific padding coefficients to get ...
SensorModel::ParametersPtr sensor_parameters_
the parameters of the used sensor model
std::mutex jobs_mutex_
mutex required for synchronization of condition states
float shadow_threshold_
threshold for shadowed pixels vs. filtered pixels
~MeshFilterBase()
Desctructor.
std::mutex meshes_mutex_
mutex for synchronization of updating filtered meshes
void getModelDepth(float *depth) const
retrieves the depth values of the rendered model
GLuint sensor_depth_texture_
handle depth texture from sensor data
MeshHandle next_handle_
next handle to be used for next mesh that is added
void deInitialize()
cleaning up
void getFilteredLabels(LabelType *labels) const
retrieves the labels of the input data
MeshHandle min_handle_
Handle values below this are all taken (this variable is used for more efficient computation of next_...
void setTransformCallback(const TransformCallback &transform_callback)
set the callback for retrieving transformations for each mesh.
void getFilteredDepth(float *depth) const
retrieves the filtered depth values
void addMeshHelper(MeshHandle handle, const shapes::Mesh &cmesh)
used within a Job to allow the main thread adding meshes
void getModelLabels(LabelType *labels) const
retrieves the labels of the rendered model
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
MOVEIT_CLASS_FORWARD(Job)
void addJob(const JobPtr &job) const
add a Job for the main thread that needs to be executed there
std::queue< JobPtr > jobs_queue_
OpenGL job queue that need to be processed by the worker thread.
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
Abstract Interface defining Sensor Parameters.
void filter(const void *sensor_data, GLushort type, bool wait=false) const
label/remove pixels from input depth-image
GLuint canvas_
canvas element (screen-filling quad) for second pass
std::mutex transform_callback_mutex_
mutex for synchronization of setting/calling transform_callback_
void setShadowThreshold(float threshold)
set the shadow threshold. points that are further away than the rendered model are filtered out....
float padding_offset_
padding offset
GLRendererPtr mesh_renderer_
first pass renderer for rendering the mesh
void setPaddingOffset(float offset)
set the offset component of padding. This value is added to the scaled sensor-specific constant compo...
GLRendererPtr depth_filter_
second pass renderer for filtering the results of first pass
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.
std::function< bool(MeshHandle, Eigen::Isometry3d &)> TransformCallback
std::condition_variable jobs_condition_
condition variable to notify the filtering thread if a new image arrived
std::thread filter_thread_
the filtering thread that also holds the OpenGL context
float padding_scale_
padding scale
GLuint shadow_threshold_location_
handle to GLSL location of shadow threshold
std::map< MeshHandle, GLMeshPtr > meshes_
storage for meshed to be filtered
bool removeMeshHelper(MeshHandle handle)
used within a Job to allow the main thread removing meshes
bool stop_
indicates whether the filtering loop should stop
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 setSize(unsigned int width, unsigned int height)
sets the size of the fram buffers
TransformCallback transform_callback_
callback function for retrieving the mesh transformations
perception
Author(s): Ioan Sucan
, Jon Binney , Suat Gedikli
autogenerated on Mon May 27 2024 02:27:57