![]() |
RobWorkProject
23.9.11-
|
random sampling of points and orientations close to the surface of a geometry. More...
#include <TriMeshSurfaceSampler.hpp>
Public Types | |
typedef rw::core::Ptr< TriMeshSurfaceSampler > | Ptr |
Public Member Functions | |
TriMeshSurfaceSampler () | |
constructor | |
TriMeshSurfaceSampler (rw::geometry::Geometry::Ptr geom) | |
constructor More... | |
TriMeshSurfaceSampler (const std::vector< rw::geometry::Geometry::Ptr > &geoms) | |
constructor More... | |
virtual | ~TriMeshSurfaceSampler () |
destructor | |
void | add (rw::geometry::Geometry::Ptr geom) |
add surface representing geometry to this sampler More... | |
void | add (rw::geometry::TriMesh::Ptr mesh) |
add surface mesh. More... | |
rw::math::Transform3D | sample () |
sample a pose on the surface of the object. More... | |
rw::math::Vector3D< double > | samplePoint () |
sample point on surface of object | |
void | setBoundsD (double minD, double maxD) |
set the bounds to which the random position around the sampled surface point will be generated. See setRandomPositionEnabled More... | |
void | setRandomRotationEnabled (bool enabled) |
enable the generation of a random rotation instead of a rotation with the z-axis pointing in the surface normal direction. More... | |
void | setRandomPositionEnabled (bool enabled) |
enables generation of a random position within the sampled surface position. The local point will be generated within a min and max distance from the sampled surface point. See setBoundsD More... | |
void | setZAxisDirectionEnabled (bool enabled) |
enable z-axis direction filtering. See setZAxisDirection for information on setting the direction. More... | |
void | setZAxisDirection (const rw::math::Vector3D< double > &dir) |
sets the direction that the z-axis must point into. this is equal to testing if the z-axis of the generated pose lies on the right side of the plane defined by the plane normal dir and (0,0,0). More... | |
rw::geometry::TriMesh::Ptr | getMesh () |
return the mesh that is being sampled More... | |
random sampling of points and orientations close to the surface of a geometry.
A point p on the surface is randomly choosen.
A rotation rot is randomly generated.
A random distance d in the interval [minD, maxD] is generated
The position pos is calculated as \( pos = p - rot*(0,0,d)^T \)
The random pose X is thus \( X = (pos, rot) \) Optionally a random rotation of X can be generated such that z-axis of rot is not allways pointing toward the surface.
constructor
geom | [in] geometry representing the surface that should be sampled. |
TriMeshSurfaceSampler | ( | const std::vector< rw::geometry::Geometry::Ptr > & | geoms | ) |
constructor
geoms | [in] list of geometries representing the surface that should be sampled. |
void add | ( | rw::geometry::Geometry::Ptr | geom | ) |
add surface representing geometry to this sampler
geom | [in] geometry representing surface to be sampled |
void add | ( | rw::geometry::TriMesh::Ptr | mesh | ) |
add surface mesh.
mesh | [in] mesh to add to sampler. |
rw::geometry::TriMesh::Ptr getMesh | ( | ) |
return the mesh that is being sampled
rw::math::Transform3D sample | ( | ) |
sample a pose on the surface of the object.
void setBoundsD | ( | double | minD, |
double | maxD | ||
) |
set the bounds to which the random position around the sampled surface point will be generated. See setRandomPositionEnabled
minD | [in] minimum distance |
maxD | [in] maximum distance. |
void setRandomPositionEnabled | ( | bool | enabled | ) |
enables generation of a random position within the sampled surface position. The local point will be generated within a min and max distance from the sampled surface point. See setBoundsD
enabled | [in] true to enable local random generation around sampled surface point. False otherwise. |
void setRandomRotationEnabled | ( | bool | enabled | ) |
enable the generation of a random rotation instead of a rotation with the z-axis pointing in the surface normal direction.
enabled | [in] |
void setZAxisDirection | ( | const rw::math::Vector3D< double > & | dir | ) |
sets the direction that the z-axis must point into. this is equal to testing if the z-axis of the generated pose lies on the right side of the plane defined by the plane normal dir and (0,0,0).
Setting this also sets setZAxisDirectionEnabled( true )
dir | [in] |
void setZAxisDirectionEnabled | ( | bool | enabled | ) |
enable z-axis direction filtering. See setZAxisDirection for information on setting the direction.
enabled |