Class FrameSet

Class Documentation

class FrameSet

Container of lidar frames that allows storing collection-associated fields that cannot be referenced back to any individual lidar frame.

Internal resources are kept under shared pointers so copying the set returns a shallow copy. Use FrameSet::clone() if necessary.

Public Functions

FrameSet()

The default constructor creates an empty set.

FrameSet(const std::vector<std::shared_ptr<LidarFrame>> &frames)

Initialize a FrameSet with a vector of lidar frames.

Parameters:

frames[in] vector of lidar frame shared pointers.

FrameSet(std::vector<std::shared_ptr<LidarFrame>> &&frames)

Initialize a FrameSet with a vector of lidar frames.

Parameters:

frames[in] vector of lidar frame shared pointers to steal.

FrameSet(std::initializer_list<std::shared_ptr<LidarFrame>> frames)

Initialize a FrameSet with an initializer list.

Parameters:

frames[in] initializer list of lidar frame shared pointers.

std::vector<std::shared_ptr<LidarFrame>>::iterator begin()
Returns:

iterator to the beginning of the lidar frames

std::vector<std::shared_ptr<LidarFrame>>::iterator end()
Returns:

iterator past the end of the lidar frames

std::vector<std::shared_ptr<LidarFrame>>::const_iterator begin() const
Returns:

const iterator to the beginning of the lidar frames

std::vector<std::shared_ptr<LidarFrame>>::const_iterator end() const
Returns:

const iterator past the end of the lidar frames

inline ValidObjectIterator<LidarFrame> valid_frames()
Returns:

an iterator over valid (non-null) lidar frames

inline ValidObjectConstIterator<LidarFrame> valid_frames() const
Returns:

a const iterator over valid (non-null) lidar frames

inline ValidObjectIterator<LidarFrame> valid_scans()

Deprecated:

Use valid_frames() instead

Deprecated:

Use “valid_frames()” instead. The last supported version for this will be 1.0.0 .

Returns:

an iterator over valid (non-null) lidar frames

inline ValidObjectConstIterator<LidarFrame> valid_scans() const

Deprecated:

Use valid_frames() instead

Deprecated:

Use “valid_frames()” instead. The last supported version for this will be 1.0.0 .

Returns:

a const iterator over valid (non-null) lidar frames

inline ValidIndexIterator<LidarFrame> valid_indices()
Returns:

an iterator that yields the indices of valid (non-null) lidar frames

inline ValidIndexConstIterator<LidarFrame> valid_indices() const
Returns:

a const iterator that yields the indices of valid (non-null) lidar frames

const std::shared_ptr<LidarFrame> &operator[](size_t index) const

Returns nth frame in the FrameSet.

Parameters:

index[in] index of the frame to return

Returns:

shared ptr of frame at the given index

std::shared_ptr<LidarFrame> &operator[](size_t index)

Returns nth frame in the FrameSet.

Parameters:

index[in] index of the frame to return

Returns:

shared ptr of frame at the given index

size_t size() const

Returns number of lidar frames stored in the FrameSet.

Returns:

number of lidar frames

Field &add_field(const std::string &name, const FieldDescriptor &desc)

Add a new zero-filled field to FrameSet.

Throws:

std::invalid_argument – if key duplicates a preexisting field

Parameters:
  • name[in] string key of the field to add

  • desc[in] descriptor of the field to add

Returns:

field

Field del_field(const std::string &name)

Release the field and remove it from FrameSet.

Throws:

std::invalid_argument – if field under key does not exist

Parameters:

name[in] string key of the field to remove

Returns:

field The deleted field.

bool has_field(const std::string &name) const

Check if a field exists.

Parameters:

name[in] string key of the field to check

Returns:

true if the FrameSet has the field, else false

Field &field(const std::string &name)
Parameters:

name[in] string key of the field to access

Returns:

Field reference of the requested field

const Field &field(const std::string &name) const
Parameters:

name[in] string key of the field to access

Returns:

Field reference of the requested field

std::unordered_map<std::string, Field> &fields()

Reference to the internal fields map.

Returns:

The unordered map of names and fields.

const std::unordered_map<std::string, Field> &fields() const

Reference to the internal fields map.

Returns:

The unordered map of names and fields.

std::vector<std::shared_ptr<LidarFrame>> &frames()

Reference to the internal vector of frames.

Returns:

The vector of shared pointers to lidar frames.

const std::vector<std::shared_ptr<LidarFrame>> &frames() const

Reference to the internal vector of frames. (const overload)

Returns:

The vector of shared pointers to lidar frames. (const overload)

std::vector<std::shared_ptr<LidarFrame>> &scans()

Deprecated:

Use frames() instead

Reference to the internal vector of frames.

Deprecated:

Use “frames()” instead. The last supported version for this will be 1.0.0 .

Returns:

The vector of shared pointers to lidar frames.

const std::vector<std::shared_ptr<LidarFrame>> &scans() const

Deprecated:

Use frames() instead

Reference to the internal vector of frames. (const overload)

Deprecated:

Use “frames()” instead. The last supported version for this will be 1.0.0 .

Returns:

The vector of shared pointers to lidar frames. (const overload)

std::unordered_map<std::string, std::vector<Object>> &objects()

Reference to the internal objects map.

Returns:

The unordered map of names and object lists.

const std::unordered_map<std::string, std::vector<Object>> &objects() const

Reference to the internal objects map.

Returns:

The unordered map of names and object lists.

void swap(FrameSet &other) noexcept

Swaps two FrameSets.

Parameters:

other[in] FrameSet to swap resources with

FrameSet clone() const

Get a deep copy of a FrameSet.

Returns:

deep copy