Class VisualNFrame

Class Documentation

class aslam::VisualNFrame

Public Types

typedef std::vector<VisualNFrame::Ptr> PtrVector
typedef std::vector<VisualNFrame::ConstPtr> ConstPtrVector

Public Functions

ASLAM_POINTER_TYPEDEFS(VisualNFrame)
VisualNFrame(const aslam::NFramesId &id, unsigned int num_frames)

Creates a visual n-frame from an id and number of frames.

This constructor should only be used in a specific situation when there is no information about the camera system when constructing the object. This may happen e.g. when deserializing data.

   The individual frames are initialized to NULL.
   The camera system is initialized to NULL.

Parameters
  • id[in] The unique id for this object.

  • num_frames[in] The number of frames to be constructed.

VisualNFrame(const aslam::NFramesId &id, std::shared_ptr<NCamera> ncameras)

Creates a visual n-frame from an id and camera system.

The individual frames are initialized to NULL.

Parameters
  • id[in] The unique id for this object.

  • ncameras[in] The camera system associated with this object.

VisualNFrame(std::shared_ptr<NCamera> ncameras)

Creates a visual n-frame from a camera system.

The id is set randomly and the individual frames are initialized to NULL.

Parameters

ncameras[in] The camera system associated with this object.

inline virtual ~VisualNFrame()
VisualNFrame(const VisualNFrame &other)

Copy constructor for clone operation. (NCamera is not cloned!)

VisualNFrame &operator=(const VisualNFrame &other)
inline const aslam::NFramesId &getId() const

Get the multiframe id.

inline void setId(const aslam::NFramesId &n_frames_id)

Set the multiframe id.

const NCamera &getNCamera() const

Get the camera rig.

std::shared_ptr<NCamera> getNCameraShared()

Get the camera rig.

std::shared_ptr<const NCamera> getNCameraShared() const

Get the camera rig.

void setNCameras(std::shared_ptr<NCamera> ncameras)

Set the camera rig.

This method fills in in multi-camera system information. It should be used if we had no such knowledge at time of construction of this object. This method will also assign cameras to the already existing visual frames.

bool isFrameSet(size_t frame_index) const

Is a frame set for this index?

bool areAllFramesSet() const

Are all the frames set?

bool isFrameValid(size_t frame_index) const

Is the frame at this index valid.

const VisualFrame &getFrame(size_t frame_index) const

Get one frame.

std::shared_ptr<VisualFrame> getFrameShared(size_t frame_index)

Get one frame, mutable.

std::shared_ptr<const VisualFrame> getFrameShared(size_t frame_index) const

Get one frame.

void setFrame(size_t frame_index, std::shared_ptr<VisualFrame> frame)

Set the frame at the index.

The method will fail hard if the frame does not have the same camera as specified in the camera system. It is expected that this method will mostly be used by the pipeline code when building a VisualNFrame for the first time.

void unSetFrame(size_t frame_index)

Replace the frame at the index with a nullptr.

size_t getNumFrames() const

The number of frames.

size_t getNumCameras() const

The number of frames.

const Transformation &get_T_C_B(size_t camera_index) const

Get the pose of body frame with respect to the camera i.

const Camera &getCamera(size_t camera_index) const

Get the geometry object for camera i.

const CameraId &getCameraId(size_t camera_index) const

Get the id for the camera at index i.

bool hasCameraWithId(const CameraId &id) const

Does this rig have a camera with this id?

size_t getCameraIndex(const CameraId &id) const

Get the index of the camera with the id.

Returns

-1 if the rig doesn’t have a camera with this id

int64_t getMinTimestampNanoseconds() const

Get the min. timestamp over all frames in nanoseconds.

int64_t getMaxTimestampNanoseconds() const

Get the max. timestamp over all frames in nanoseconds.

bool operator==(const VisualNFrame &other) const

Binary equality.

bool compareWithoutCameraSystem(const VisualNFrame &other) const

Binary equality excluding the camera system.

bool hasRawImagesInAllFrames() const

Checks if all frames have raw image each.

Returns

False if any one frame does not have raw image, true otherwise.

void releaseRawImagesOfAllFrames()

Iterates over all frames and releases (removes) the raw image.

void clearKeypointChannelsOfAllFrames()

Iterates over all frames and resets all keypoint channels (keypoints, keypoint_uncertainties, track_ids, keypoint_scales, …) to vectors of length zero.

Public Static Functions

static VisualNFrame::Ptr createEmptyTestVisualNFrame(const std::shared_ptr<NCamera> &ncamera, int64_t timestamp_nanoseconds)

Creates an empty visual nframe with the given ncamera system.

Parameters
  • ncamera[in] NCamera.

  • timestamp_nanoseconds[in] Timestamp of the individual frames in the nframe. [ns]

Returns

Pointer to the created VisualNFrame.

Protected Functions

VisualNFrame() = default

Creates an empty visual VisualNFrame.