Voyant API 0.16.0
Loading...
Searching...
No Matches
PointDataWrapper Class Reference

Wrapper for PointData messages. More...

#include <voyant_point_data_wrapper.hpp>

Inheritance diagram for PointDataWrapper:
CapnpWrapper< PointData >

Public Member Functions

 ~PointDataWrapper () override
 Destructor.
void fromProto (PointData::Reader reader) override
 Update wrapper fields from a Cap'n Proto reader.
void toProto (PointData::Builder &builder) const override
 Write wrapper fields to a Cap'n Proto builder.
void debugString (std::ostream &os) const override
 Generate a debug string representation.
int32_t timestamp_nanosecs () const
 Get timestamp in nanoseconds since frame start.
void set_timestamp_nanosecs (int32_t value)
 Set timestamp in nanoseconds.
uint32_t point_index () const
 Get point index within frame.
void set_point_index (uint32_t value)
 Set point index.
float x () const
 Get X position in meters.
void set_x (float value)
 Set X position.
float y () const
 Get Y position in meters.
void set_y (float value)
 Set Y position.
float z () const
 Get Z position in meters.
void set_z (float value)
 Set Z position.
float radial_vel () const
 Get radial velocity in m/s.
void set_radial_vel (float value)
 Set radial velocity.
float snr_linear () const
 Get signal-to-noise ratio (linear, electrical power).
void set_snr_linear (float value)
 Set signal-to-noise ratio.
float calibrated_reflectance () const
 Get calibrated reflectance.
void set_calibrated_reflectance (float value)
 Set calibrated reflectance.
float noise_mean_estimate () const
 Get estimated mean noise level about the peaks.
void set_noise_mean_estimate (float value)
 Set noise mean estimate.
float min_ramp_snr () const
 Get minimum ramp SNR.
void set_min_ramp_snr (float value)
 Set minimum ramp SNR.
DropReason drop_reason () const
 Get point drop reason.
void set_drop_reason (DropReason value)
 Set point drop reason.
bool is_valid () const
 Check if point is valid based on drop reason.
void set_point_index_components (uint16_t azimuth, uint16_t elevation)
 Encode azimuth and elevation into the point_index field.
uint16_t azimuth_index () const
 Extract azimuth index from point_index.
uint16_t elevation_index () const
 Extract elevation index from point_index.
float range () const
 Calculate the range (Euclidean distance from origin) of the point.
float azimuth_radians () const
 Get azimuth angle in radians.
float azimuth_degrees () const
 Get azimuth angle in degrees.
float elevation_radians () const
 Get elevation angle in radians.
float elevation_degrees () const
 Get elevation angle in degrees.
void fromBuffer (const uint8_t *buffer, size_t size)
 Update wrapper fields from a serialized message buffer.
size_t toBuffer (uint8_t *buffer, size_t buffer_size) const
 Serialize this wrapper to a buffer using Cap'n Proto format.

Private Attributes

int32_t timestamp_nanosecs_ = 0
 Timestamp in nanoseconds since frame start.
uint32_t point_index_ = 0
 Point index within frame (encoded azimuth/elevation).
float x_ = 0.0f
 X position in meters (Cartesian coordinate).
float y_ = 0.0f
 Y position in meters (Cartesian coordinate).
float z_ = 0.0f
 Z position in meters (Cartesian coordinate).
float radial_vel_ = 0.0f
 Radial velocity in m/s (Doppler measurement).
float snr_linear_ = 0.0f
 Signal-to-Noise Ratio (electrical power, see snr_linear()).
float calibrated_reflectance_ = 0.0f
 Calibrated reflectance (not implemented).
float noise_mean_estimate_ = 0.0f
 Noise floor estimate for SNR calculation.
float min_ramp_snr_ = 0.0f
 Minimum ramp SNR (internal test use).
DropReason drop_reason_ = DropReason::UNKNOWN
 Point validity status (see drop_reason()).

Detailed Description

Wrapper for PointData messages.

Provides a C++ interface for handling LiDAR point data with position, velocity, signal quality, and validity information.

Constructor & Destructor Documentation

◆ ~PointDataWrapper()

PointDataWrapper::~PointDataWrapper ( )
override

Destructor.

Member Function Documentation

◆ azimuth_degrees()

float PointDataWrapper::azimuth_degrees ( ) const

Get azimuth angle in degrees.

Angle on the XY plane, measured counterclockwise from the positive X axis. 0° is along the positive X axis, 90° is along the positive Y axis.

Returns
Azimuth angle in degrees [-180, 180]

◆ azimuth_index()

uint16_t PointDataWrapper::azimuth_index ( ) const

Extract azimuth index from point_index.

Returns
Azimuth index (16 bits)

◆ azimuth_radians()

float PointDataWrapper::azimuth_radians ( ) const

Get azimuth angle in radians.

Angle on the XY plane, measured counterclockwise from the positive X axis. 0° is along the positive X axis, 90° is along the positive Y axis.

Returns
Azimuth angle in radians [-π, π]

◆ calibrated_reflectance()

float PointDataWrapper::calibrated_reflectance ( ) const
inline

Get calibrated reflectance.

Note
Not currently implemented - reserved for future use
Returns
Reflectance measurement (currently unused)

◆ debugString()

void PointDataWrapper::debugString ( std::ostream & os) const
overridevirtual

Generate a debug string representation.

Parameters
osThe output stream to write to

Implements CapnpWrapper< PointData >.

◆ drop_reason()

DropReason PointDataWrapper::drop_reason ( ) const
inline

Get point drop reason.

Indicates whether this point passed validation checks:

  • 0: Unknown status
  • 1: Success (Valid point)
  • 2+: Invalid point (various failure reasons)
Returns
Drop reason enum value

◆ elevation_degrees()

float PointDataWrapper::elevation_degrees ( ) const

Get elevation angle in degrees.

Angle from the horizontal XY plane toward the Z axis. 0° points horizontally, +90° points straight up, -90° points straight down.

Returns
Elevation angle in degrees [-90, 90]

◆ elevation_index()

uint16_t PointDataWrapper::elevation_index ( ) const

Extract elevation index from point_index.

Returns
Elevation index (12 bits)

◆ elevation_radians()

float PointDataWrapper::elevation_radians ( ) const

Get elevation angle in radians.

Angle from the horizontal XY plane toward the Z axis. 0° points horizontally, +90° points straight up, -90° points straight down.

Returns
Elevation angle in radians [-π/2, π/2]

◆ fromBuffer()

void CapnpWrapper< PointData >::fromBuffer ( const uint8_t * buffer,
size_t size )
inlineinherited

Update wrapper fields from a serialized message buffer.

Parameters
bufferPointer to the buffer containing serialized Cap'n Proto data
sizeSize of the buffer in bytes

◆ fromProto()

void PointDataWrapper::fromProto ( PointData::Reader reader)
overridevirtual

Update wrapper fields from a Cap'n Proto reader.

Parameters
readerThe PointData reader to extract data from

Implements CapnpWrapper< PointData >.

◆ is_valid()

bool PointDataWrapper::is_valid ( ) const
inline

Check if point is valid based on drop reason.

Returns
True if drop reason is SUCCESS, false otherwise

◆ min_ramp_snr()

float PointDataWrapper::min_ramp_snr ( ) const
inline

Get minimum ramp SNR.

Note
Intended for internal test team use only
Returns
Minimum ramp SNR value

◆ noise_mean_estimate()

float PointDataWrapper::noise_mean_estimate ( ) const
inline

Get estimated mean noise level about the peaks.

This value is used internally to calculate the Signal-to-Noise Ratio (SNR) by providing the noise floor estimation for the detection algorithm.

Returns
Noise mean value

◆ point_index()

uint32_t PointDataWrapper::point_index ( ) const
inline

Get point index within frame.

Returns
Point index value (contains encoded azimuth and elevation)

◆ radial_vel()

float PointDataWrapper::radial_vel ( ) const
inline

Get radial velocity in m/s.

Returns
Doppler velocity estimate

◆ range()

float PointDataWrapper::range ( ) const

Calculate the range (Euclidean distance from origin) of the point.

Returns
Range in meters

◆ set_calibrated_reflectance()

void PointDataWrapper::set_calibrated_reflectance ( float value)
inline

Set calibrated reflectance.

Parameters
valueReflectance value

◆ set_drop_reason()

void PointDataWrapper::set_drop_reason ( DropReason value)
inline

Set point drop reason.

Parameters
valueDrop reason enum value

◆ set_min_ramp_snr()

void PointDataWrapper::set_min_ramp_snr ( float value)
inline

Set minimum ramp SNR.

Parameters
valueMinimum ramp SNR value

◆ set_noise_mean_estimate()

void PointDataWrapper::set_noise_mean_estimate ( float value)
inline

Set noise mean estimate.

Parameters
valueNoise mean value

◆ set_point_index()

void PointDataWrapper::set_point_index ( uint32_t value)
inline

Set point index.

Parameters
valuePoint index value

◆ set_point_index_components()

void PointDataWrapper::set_point_index_components ( uint16_t azimuth,
uint16_t elevation )

Encode azimuth and elevation into the point_index field.

Parameters
azimuthAzimuth index (16 bits)
elevationElevation index (12 bits)

◆ set_radial_vel()

void PointDataWrapper::set_radial_vel ( float value)
inline

Set radial velocity.

Parameters
valueVelocity in m/s

◆ set_snr_linear()

void PointDataWrapper::set_snr_linear ( float value)
inline

Set signal-to-noise ratio.

Parameters
valueSNR value in linear scale (electrical power)

◆ set_timestamp_nanosecs()

void PointDataWrapper::set_timestamp_nanosecs ( int32_t value)
inline

Set timestamp in nanoseconds.

Parameters
valueTimestamp value

◆ set_x()

void PointDataWrapper::set_x ( float value)
inline

Set X position.

Parameters
valueX coordinate in meters

◆ set_y()

void PointDataWrapper::set_y ( float value)
inline

Set Y position.

Parameters
valueY coordinate in meters

◆ set_z()

void PointDataWrapper::set_z ( float value)
inline

Set Z position.

Parameters
valueZ coordinate in meters

◆ snr_linear()

float PointDataWrapper::snr_linear ( ) const
inline

Get signal-to-noise ratio (linear, electrical power).

This value represents the SNR of the detected point and is normally thresholded for detection at 1e-3 Probability of False Alarm.

Returns
SNR value in linear scale (electrical power)

◆ timestamp_nanosecs()

int32_t PointDataWrapper::timestamp_nanosecs ( ) const
inline

Get timestamp in nanoseconds since frame start.

Returns
Timestamp value

◆ toBuffer()

size_t CapnpWrapper< PointData >::toBuffer ( uint8_t * buffer,
size_t buffer_size ) const
inlineinherited

Serialize this wrapper to a buffer using Cap'n Proto format.

Parameters
bufferPointer to the buffer to write serialized data to
buffer_sizeSize of the buffer in bytes
Returns
The number of bytes written to the buffer
Exceptions
std::runtime_errorif the buffer is too small

◆ toProto()

void PointDataWrapper::toProto ( PointData::Builder & builder) const
overridevirtual

Write wrapper fields to a Cap'n Proto builder.

Parameters
builderThe PointData builder to write data to

Implements CapnpWrapper< PointData >.

◆ x()

float PointDataWrapper::x ( ) const
inline

Get X position in meters.

Returns
X coordinate

◆ y()

float PointDataWrapper::y ( ) const
inline

Get Y position in meters.

Returns
Y coordinate

◆ z()

float PointDataWrapper::z ( ) const
inline

Get Z position in meters.

Returns
Z coordinate

Member Data Documentation

◆ calibrated_reflectance_

float PointDataWrapper::calibrated_reflectance_ = 0.0f
private

Calibrated reflectance (not implemented).

◆ drop_reason_

DropReason PointDataWrapper::drop_reason_ = DropReason::UNKNOWN
private

Point validity status (see drop_reason()).

◆ min_ramp_snr_

float PointDataWrapper::min_ramp_snr_ = 0.0f
private

Minimum ramp SNR (internal test use).

◆ noise_mean_estimate_

float PointDataWrapper::noise_mean_estimate_ = 0.0f
private

Noise floor estimate for SNR calculation.

◆ point_index_

uint32_t PointDataWrapper::point_index_ = 0
private

Point index within frame (encoded azimuth/elevation).

◆ radial_vel_

float PointDataWrapper::radial_vel_ = 0.0f
private

Radial velocity in m/s (Doppler measurement).

◆ snr_linear_

float PointDataWrapper::snr_linear_ = 0.0f
private

Signal-to-Noise Ratio (electrical power, see snr_linear()).

◆ timestamp_nanosecs_

int32_t PointDataWrapper::timestamp_nanosecs_ = 0
private

Timestamp in nanoseconds since frame start.

◆ x_

float PointDataWrapper::x_ = 0.0f
private

X position in meters (Cartesian coordinate).

◆ y_

float PointDataWrapper::y_ = 0.0f
private

Y position in meters (Cartesian coordinate).

◆ z_

float PointDataWrapper::z_ = 0.0f
private

Z position in meters (Cartesian coordinate).


The documentation for this class was generated from the following file: