Class that caches and updates transformations for given frames. More...
#include <transform_provider.h>
Classes | |
struct | TransformContext |
Context Object for registered frames. More... | |
Public Member Functions | |
void | addHandle (mesh_filter::MeshHandle handle, const std::string &name) |
registers a mesh with its handle More... | |
bool | getTransform (mesh_filter::MeshHandle handle, Eigen::Affine3d &transform) const |
returns the current transformation of a mesh given by its handle More... | |
void | setFrame (const std::string &frame) |
sets the camera frame id. The returned transformations are in respect to this coordinate frame More... | |
void | setUpdateInterval (unsigned long usecs) |
sets the update interval in micro seconds. This should be low enough to reduce the system load but high enough to get up-to-date transformations. For PSDK compatible devices this value should be around 30000 = 30ms More... | |
void | start () |
starts the updating process. Done in a seperate thread More... | |
void | stop () |
stops the update process/thread. More... | |
TransformProvider (unsigned long interval_us=30000) | |
Constructor. More... | |
~TransformProvider () | |
Destructor. More... | |
Private Member Functions | |
MOVEIT_CLASS_FORWARD (TransformContext) | |
void | run () |
The entry point of the dedicated thread that updates the transformations periodically. More... | |
void | updateTransforms () |
this method is called periodically by the dedicated thread and updates all the transformations of the registered frames. More... | |
Private Attributes | |
std::string | frame_id_ |
the camera frame id More... | |
std::map< mesh_filter::MeshHandle, TransformContextPtr > | handle2context_ |
mapping between the mesh handle and its context More... | |
unsigned long | interval_us_ |
update interval in micro seconds More... | |
planning_scene_monitor::PlanningSceneMonitorPtr | psm_ |
SceneMonitor used to get current states. More... | |
bool | stop_ |
boost::shared_ptr< tf::TransformListener > | tf_ |
TransformListener used to listen and update transformations. More... | |
boost::thread | thread_ |
thread object More... | |
Class that caches and updates transformations for given frames.
Definition at line 58 of file transform_provider.h.
TransformProvider::TransformProvider | ( | unsigned long | interval_us = 30000 | ) |
Constructor.
[in] | interval_us | update interval in micro seconds |
Definition at line 47 of file transform_provider.cpp.
TransformProvider::~TransformProvider | ( | ) |
Destructor.
Definition at line 54 of file transform_provider.cpp.
void TransformProvider::addHandle | ( | mesh_filter::MeshHandle | handle, |
const std::string & | name | ||
) |
registers a mesh with its handle
[in] | handle | handle of the mesh |
[in] | name | frame_id_ of teh mesh |
Definition at line 71 of file transform_provider.cpp.
bool TransformProvider::getTransform | ( | mesh_filter::MeshHandle | handle, |
Eigen::Affine3d & | transform | ||
) | const |
returns the current transformation of a mesh given by its handle
[in] | handle | handle of the mesh |
[out] | transform | pose of the mesh in camera coordinate system |
Definition at line 95 of file transform_provider.cpp.
|
private |
|
private |
The entry point of the dedicated thread that updates the transformations periodically.
Definition at line 110 of file transform_provider.cpp.
void TransformProvider::setFrame | ( | const std::string & | frame | ) |
sets the camera frame id. The returned transformations are in respect to this coordinate frame
frame | frame id of parent/camera coordinate system. |
Definition at line 79 of file transform_provider.cpp.
void TransformProvider::setUpdateInterval | ( | unsigned long | usecs | ) |
sets the update interval in micro seconds. This should be low enough to reduce the system load but high enough to get up-to-date transformations. For PSDK compatible devices this value should be around 30000 = 30ms
[in] | usecs | interval in micro seconds |
Definition at line 122 of file transform_provider.cpp.
void TransformProvider::start | ( | void | ) |
starts the updating process. Done in a seperate thread
Definition at line 59 of file transform_provider.cpp.
void TransformProvider::stop | ( | void | ) |
stops the update process/thread.
Definition at line 65 of file transform_provider.cpp.
|
private |
this method is called periodically by the dedicated thread and updates all the transformations of the registered frames.
Definition at line 127 of file transform_provider.cpp.
|
private |
the camera frame id
Definition at line 158 of file transform_provider.h.
|
private |
mapping between the mesh handle and its context
Definition at line 149 of file transform_provider.h.
|
private |
update interval in micro seconds
Definition at line 167 of file transform_provider.h.
|
private |
SceneMonitor used to get current states.
Definition at line 155 of file transform_provider.h.
|
private |
to leave the update loop
Definition at line 164 of file transform_provider.h.
|
private |
TransformListener used to listen and update transformations.
Definition at line 152 of file transform_provider.h.
|
private |
thread object
Definition at line 161 of file transform_provider.h.