Struct LaserScan

Struct Documentation

struct LaserScan

A single scan from a planar laser range-finder.

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the LaserScan as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::optional<Timestamp> timestamp

Timestamp of scan.

std::string frame_id

Frame of reference.

std::optional<Pose> pose

Origin of scan relative to frame of reference; points are positioned in the x-y plane relative to this origin; angles are interpreted as counterclockwise rotations around the z axis with 0 rad being in the +x direction.

double start_angle = 0

Bearing of first point, in radians.

double end_angle = 0

Bearing of last point, in radians.

std::vector<double> ranges

Distance of detections from origin; assumed to be at equally-spaced angles between start_angle and end_angle

std::vector<double> intensities

Intensity of detections.

Public Static Functions

static Schema schema()

Get the LaserScan schema.

The schema data returned is statically allocated.