Class Slam

Class Documentation

class Slam

Main entry point for running the SLAM pipeline.

Public Types

typedef std::unique_ptr<Slam> unique_ptr

Unique ownership pointer type.

typedef std::shared_ptr<Slam> shared_ptr

Shared ownership pointer type.

Public Functions

Slam(const std::string &settingsPath_)

Constructs the SLAM pipeline.

Parameters:

settingsPath_ – Path to the settings YAML file.

inline Slam()

Constructs the SLAM pipeline using default settings.

~Slam()

Destroys the SLAM pipeline and releases all modules.

void add(data_type::SensorData::weak_ptr data_)

Pushes a new camera sample into the SLAM pipeline.

Parameters:

data_ – Input camera sample (monocular or RGB-D).

void add(std::vector<double> imu_)

Pushes a new IMU reading into the SLAM pipeline.

Parameters:

imu_ – IMU sample payload.

pair_t<rotation_t, translation_t> get_camera_pose() const

Returns the current camera pose in world coordinates.

Returns:

Pair containing camera rotation and translation.

std::tuple<size_t, size_t, size_t, size_t, size_t> get_map_size() const

Get the size of the map.

Returns:

Tuple with number of keyframes, number of map points, number of query cells, number of closest cells, and total number of cells.

void get_image_visualization_data(data_type::SensorData::shared_ptr data_, utils::ImageDebugData &outputData_)

Fills debug visualization data for the latest processed frame.

Parameters:
  • data_ – Sensor sample associated with the visualization request.

  • outputData_ – Output structure filled with debug render content.

double get_frames_per_second()

Get the current slam fps.

Returns:

Frames per second.

Public Static Functions

static inline Slam::unique_ptr make_unique(const std::string &settingsPath_)

Creates a std::unique_ptr<Slam>.

Parameters:

settingsPath_ – Path to the settings file.

Returns:

Unique pointer to a new Slam instance.

static inline Slam::shared_ptr make_shared(const std::string &settingsPath_)

Creates a std::shared_ptr<Slam>.

Parameters:

settingsPath_ – Path to the settings file.

Returns:

Shared pointer to a new Slam instance.

Private Types

enum class transformation_t

Values:

enumerator Pose3
enumerator Similarity3
enumerator UNDEFINED

Private Functions

template<typename transformation_t>
void __instanciate_modules()

Instanciate graph, loop, and localization modules based on settings.

template<typename transformation_t>
void __terminate_modules()

Terminate all SLAM modules and clear global state.

template<typename transformation_t>
void __add(data_type::SensorData::weak_ptr data_)

Wrapper to run add() that handles the transformation type dispatching.

template<typename transformation_t>
pair_t<rotation_t, translation_t> __get_camera_pose() const

Wrapper to run get_camera_pose() that handles the transformation type dispatching.

template<typename transformation_t>
void __get_image_visualization_data(data_type::SensorData::shared_ptr data_, utils::ImageDebugData &outputData_)

Wrapper to the get image visualization data function that handles the transformation type dispatching.

Private Members

transformation_t _type = transformation_t::UNDEFINED

Internal transformation type used for dispatching module implementations.