Handles lifetime management and realtime plotting of TsPoints on Rviz. Visual characteristics of a marker are defined as follows:
Location - 3D coordinates of TsPoint relative to origin, which coincides with the sensor position.
Color - Relative z-distance from the sensor, green being the closest points and red being the farthest.
Scale - Product of the base scale (hard-coded, same for all markers), the user-defined global scale (dynamic, affects all markers equally) and the intensity of an individual TsPoint.
Definition at line 49 of file plot.h.
void toposens_markers::Plot::_plot |
( |
const toposens_msgs::TsScan::ConstPtr & |
msg | ) |
|
|
private |
Converts point coordinates from local sensor coordinates to global coordinates and plots the points.
- Parameters
-
msg | Pointer to an incoming TsScan message. |
Waits for a target frame transform to become available and maps incoming TsPoints to this frame.
Once the transforms are finished, the scene is wiped, old scans are deleted and the remaining scans and sensors are re-plotted.
Definition at line 91 of file plot.cpp.
void toposens_markers::Plot::_reconfig |
( |
TsMarkersConfig & |
cfg, |
|
|
uint32_t |
level |
|
) |
| |
|
private |
Callback triggered when a parameter is altered on the dynamic reconfigure server.
- Parameters
-
cfg | Structure holding updated values of parameters on server. |
level | Indicates parameter that triggered the callback. |
Current implementation defines 2 marker parameters: scale and lifetime. On each trigger, the latest config data structure is copied locally and the user-defined global scale is updated for rviz rendering. No separate updating is done for the lifetime parameter as it is always retrieved directly from the cfg object whenever its value is needed in the code.
Definition at line 60 of file plot.cpp.
void toposens_markers::Plot::_staticTFCallback |
( |
const tf2_msgs::TFMessage::ConstPtr & |
tf | ) |
|
|
private |
Callback which receives the static transform messages containing the positions of the sensors. These are stored in a dictionary. Unique point colors for each sensor postion are also stored in a dictionary.
- Parameters
-
Adds the sensor transforms to a dictionary so that each time the scene is deleted the sensors can be replaced with their correct poses.
Also Creates a unique color for the points from each sensor.
Definition at line 181 of file plot.cpp.