Class CPlanarLaserScan

Inheritance Relationships

Base Types

  • public mrpt::viz::CVisualObject

  • public mrpt::viz::VisualObjectParams_Triangles

  • public mrpt::viz::VisualObjectParams_Lines

  • public mrpt::viz::VisualObjectParams_Points

Class Documentation

class CPlanarLaserScan : public virtual mrpt::viz::CVisualObject, public mrpt::viz::VisualObjectParams_Triangles, public mrpt::viz::VisualObjectParams_Lines, public mrpt::viz::VisualObjectParams_Points

This object renders a 2D laser scan by means of three elements: the points, the line along end-points and the 2D scanned surface.

By default, all those three elements are drawn, but you can individually switch them on/off with:

To change the final result, more methods allow further customization of the 3D object (color of each element, etc.).

The scan is passed or updated through CPlanarLaserScan::setScan()

mrpt::viz::CPlanarLaserScan

../../output_staging/generated/doxygen/xml/preview_CPlanarLaserScan.png

Note

The laser points are projected at the sensor pose as given in the “scan” object, so this CPlanarLaserScan object should be placed at the exact pose of the robot coordinates origin.

Public Functions

CPlanarLaserScan()
~CPlanarLaserScan() override = default
void clear()

Clear the scan

inline void enablePoints(bool enable = true)

Show or hides the scanned points

See also

sePointsWidth, setPointsColor

inline void enableLine(bool enable = true)

Show or hides lines along all scanned points

See also

setLineWidth, setLineColor

inline void enableSurface(bool enable = true)

Show or hides the scanned area as a 2D surface

See also

setSurfaceColor

inline void setLineColor(float R, float G, float B, float A = 1.0f)
inline void setPointsColor(float R, float G, float B, float A = 1.0f)
inline void setSurfaceColor(float R, float G, float B, float A = 1.0f)
inline void setScan(const mrpt::obs::CObservation2DRangeScan &scan)
virtual void updateBuffers() const override
virtual auto internalBoundingBoxLocal() const -> mrpt::math::TBoundingBoxf override
virtual auto getLocalRepresentativePoint() const -> mrpt::math::TPoint3Df override

Protected Attributes

mrpt::obs::CObservation2DRangeScan m_scan
mutable mrpt::maps::CSimplePointsMap m_cache_points
mutable bool m_cache_valid = {false}
float m_line_R = {1.f}
float m_line_G = {0.f}
float m_line_B = {0.f}
float m_line_A = {0.5f}
float m_points_R = {1.0f}
float m_points_G = {0.0f}
float m_points_B = {0.0f}
float m_points_A = {1.0f}
float m_plane_R = {0.01f}
float m_plane_G = {0.01f}
float m_plane_B = {0.6f}
float m_plane_A = {0.6f}
bool m_enable_points = {true}
bool m_enable_line = {true}
bool m_enable_surface = {true}