Class NCamera

Inheritance Relationships

Base Type

Class Documentation

class aslam::NCamera : public aslam::Sensor

Public Types

enum [anonymous]

Values:

enumerator CLASS_SERIALIZATION_VERSION

Public Functions

ASLAM_POINTER_TYPEDEFS(NCamera)
NCamera()

Default constructor builds an empty camera rig.

NCamera(const NCameraId &id, const TransformationVector &T_C_B, const std::vector<std::shared_ptr<Camera>> &cameras, const std::string &description)

initialize from a list of transformations and a list of cameras

The two lists must be parallel arrays (same size). The transformation at T_C_B[i] corresponds to the camera at cameras[i].

Parameters
  • id: unique id for this camera rig

  • T_C_B: a list of transformations that take points from B to Ci

  • cameras: a list cameras

  • description: a human-readable description of this camera rig

NCamera(const NCameraId &id, const TransformationVector &T_C_B, const aslam::TransformationCovariance &T_G_B_fixed_localization_covariance, const std::vector<std::shared_ptr<Camera>> &cameras, const std::string &description)

initialize from a list of transformations and a list of cameras

The two lists must be parallel arrays (same size). The transformation at T_C_B[i] corresponds to the camera at cameras[i].

Parameters
  • id: unique id for this camera rig

  • T_C_B: a list of transformations that take points from B to Ci

  • T_G_B_fixed_localization_covariance: a fixed covariance used for result of visual localizations of a vertex.

  • cameras: a list cameras

  • description: a human-readable description of this camera rig

NCamera(const sm::PropertyTree &propertyTree)

Initialize from a property tree.

virtual ~NCamera() = default
NCamera(const NCamera&)

Copy constructor for clone.

void operator=(const NCamera&) = delete
NCamera *clone() const

Methods to clone this instance. All contained camera objects are cloned.

NCamera *cloneWithNewIds() const
inline NCamera::Ptr cloneToShared() const
inline virtual Sensor::Ptr cloneAsSensor() const override
inline virtual uint8_t getSensorType() const override

Get sensor type as an integer or as a string.

inline virtual std::string getSensorTypeString() const override
size_t getNumCameras() const

Get the number of cameras.

const Transformation &get_T_C_B(size_t camera_index) const

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

Transformation &get_T_C_B_Mutable(size_t camera_index)

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

const Transformation &get_T_C_B(const CameraId &camera_id) const

Get the pose of body frame with respect to the camera with a camera id.

The method will assert that the camera is not in the rig!

Transformation &get_T_C_B_Mutable(const CameraId &camera_id)

Get the pose of body frame with respect to the camera with a camera id.

The method will assert that the camera is not in the rig!

void set_T_C_B(size_t camera_index, const Transformation &T_Ci_B)

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

const TransformationVector &getTransformationVector() const

Get all transformations.

const Camera &getCamera(size_t camera_index) const

Get the geometry object for camera i.

Camera &getCameraMutable(size_t camera_index)

Get the geometry object for camera i.

std::shared_ptr<Camera> getCameraShared(size_t camera_index)

Get the geometry object for camera i.

std::shared_ptr<const Camera> getCameraShared(size_t camera_index) const

Get the geometry object for camera i.

void setCamera(size_t camera_index, std::shared_ptr<Camera> camera)

Get the geometry object for camera i.

size_t numCameras() const

How many cameras does this system have?

const std::vector<std::shared_ptr<Camera>> &getCameraVector() const

Get all cameras.

const CameraId &getCameraId(size_t camera_index) const

Gets the id for the camera at index i.

bool hasCameraWithId(const CameraId &id) const

Does this rig have a camera with this id.

bool has_T_G_B_fixed_localization_covariance() const

Whether the covariance matrix for visual localization has been set.

bool get_T_G_B_fixed_localization_covariance(aslam::TransformationCovariance *covariance) const
void set_T_G_B_fixed_localization_covariance(const aslam::TransformationCovariance &covariance)
int getCameraIndex(const CameraId &id) const

Get the index of the camera with the id.

Return

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

aslam::NCamera::Ptr cloneRigWithoutDistortion() const

Create a copy of this NCamera with all distortion models removed.

All internal cameras get cloned and new IDs will be assigned to the cloned NCamera and all contained cameras.