cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::io::kitti_odometry_dataset_t< DataType > Class Template Reference

KITTI Odometry dataset loader. More...

#include <kitti_odometry_dataset.hpp>

Inheritance diagram for toolbox::io::kitti_odometry_dataset_t< DataType >:

Public Types

using frame_type = kitti_odometry_frame_t< DataType >
 
using base_type = dataset_t< kitti_odometry_dataset_t< DataType >, frame_type >
 
- Public Types inherited from toolbox::io::dataset_t< Derived, DataType >
using data_type = DataType
 数据类型别名/Type alias for data type
 

Public Member Functions

 kitti_odometry_dataset_t (const std::string &sequence_path)
 Constructor.
 
void set_cache_size (std::size_t max_cached_frames)
 Set cache size for loaded frames.
 
void enable_intensity (bool enable)
 Enable/disable intensity loading.
 
void set_error_policy (error_recovery_policy_t policy)
 Set error recovery policy.
 
std::size_t size_impl () const
 Get number of frames in the sequence.
 
std::optional< frame_typeat_impl (std::size_t index) const
 Load frame at specific index.
 
std::string get_cloud_file (std::size_t index) const
 Get cloud file path for specific frame.
 
Eigen::Matrix< DataType, 4, 4 > get_pose (std::size_t index) const
 Get pose for specific frame.
 
bool has_calibration () const
 Check if calibration data is available.
 
const kitti_calibration_t< DataType > & get_calibration () const
 Get calibration data.
 
const std::string & get_sequence_name () const
 Get sequence name.
 
const std::string & get_sequence_path () const
 Get sequence path.
 
void clear_cache () const
 Clear frame cache.
 
- Public Member Functions inherited from toolbox::io::dataset_t< Derived, DataType >
std::size_t size () const
 获取数据集大小/Get the size of the dataset
 
std::optional< DataType > operator[] (std::size_t index) const
 通过下标访问数据/Access data by index
 
std::optional< DataType > at (std::size_t index) const
 通过下标访问数据/Access data by index
 
std::optional< DataType > get_item (std::size_t index) const
 获取指定索引的数据/Get data at the specified index
 
std::optional< DataType > get_next ()
 获取下一个元素并推进内部索引/Get the next element and advance the internal index
 
std::optional< DataType > peek_next () const
 查看下一个元素但不推进索引/Peek the next element without advancing the index
 
void reset_iterator ()
 重置内部迭代器索引/Reset the internal iterator index
 
std::size_t current_index () const
 获取当前迭代器索引/Get the current iterator index
 
 dataset_t (const dataset_t &)=delete
 禁用拷贝构造/Copy constructor is disabled
 
dataset_toperator= (const dataset_t &)=delete
 禁用拷贝赋值/Copy assignment is disabled
 
 dataset_t (dataset_t &&)=delete
 禁用移动构造/Move constructor is disabled
 
dataset_toperator= (dataset_t &&)=delete
 禁用移动赋值/Move assignment is disabled
 

Additional Inherited Members

- Protected Member Functions inherited from toolbox::io::dataset_t< Derived, DataType >
 dataset_t ()=default
 构造函数/Constructor
 
 ~dataset_t ()=default
 析构函数/Destructor
 

Detailed Description

template<typename DataType = float>
class toolbox::io::kitti_odometry_dataset_t< DataType >

KITTI Odometry dataset loader.

Template Parameters
DataTypeThe floating point type (float or double)

This dataset provides access to KITTI odometry sequences, including:

  • Point cloud data from Velodyne lidar
  • Global poses for each frame
  • Optional calibration data
kitti_odometry_dataset_t<float> dataset("/path/to/kitti/sequences/00");
// Access frames
for (size_t i = 0; i < dataset.size(); ++i) {
auto frame = dataset[i];
if (frame) {
auto& cloud = frame->cloud;
auto& pose = frame->pose;
// Process frame...
}
}
KITTI Odometry dataset loader.
Definition kitti_odometry_dataset.hpp:45

Member Typedef Documentation

◆ base_type

template<typename DataType = float>
using toolbox::io::kitti_odometry_dataset_t< DataType >::base_type = dataset_t<kitti_odometry_dataset_t<DataType>, frame_type>

◆ frame_type

template<typename DataType = float>
using toolbox::io::kitti_odometry_dataset_t< DataType >::frame_type = kitti_odometry_frame_t<DataType>

Constructor & Destructor Documentation

◆ kitti_odometry_dataset_t()

template<typename DataType >
toolbox::io::kitti_odometry_dataset_t< DataType >::kitti_odometry_dataset_t ( const std::string &  sequence_path)
explicit

Constructor.

Parameters
sequence_pathPath to sequence directory (e.g., "/path/to/sequences/00")
Exceptions
kitti_invalid_sequenceif directory structure is invalid

Member Function Documentation

◆ at_impl()

template<typename DataType >
std::optional< kitti_odometry_frame_t< DataType > > toolbox::io::kitti_odometry_dataset_t< DataType >::at_impl ( std::size_t  index) const

Load frame at specific index.

Parameters
indexFrame index
Returns
Frame data or nullopt on error

◆ clear_cache()

template<typename DataType = float>
void toolbox::io::kitti_odometry_dataset_t< DataType >::clear_cache ( ) const
inline

Clear frame cache.

◆ enable_intensity()

template<typename DataType = float>
void toolbox::io::kitti_odometry_dataset_t< DataType >::enable_intensity ( bool  enable)
inline

Enable/disable intensity loading.

Parameters
enableWhether to load intensity values

◆ get_calibration()

template<typename DataType = float>
const kitti_calibration_t< DataType > & toolbox::io::kitti_odometry_dataset_t< DataType >::get_calibration ( ) const
inline

Get calibration data.

Returns
Calibration data
Exceptions
std::runtime_errorif no calibration available

◆ get_cloud_file()

template<typename DataType = float>
std::string toolbox::io::kitti_odometry_dataset_t< DataType >::get_cloud_file ( std::size_t  index) const
inline

Get cloud file path for specific frame.

Parameters
indexFrame index
Returns
Full path to .bin file

◆ get_pose()

template<typename DataType = float>
Eigen::Matrix< DataType, 4, 4 > toolbox::io::kitti_odometry_dataset_t< DataType >::get_pose ( std::size_t  index) const
inline

Get pose for specific frame.

Parameters
indexFrame index
Returns
4x4 transformation matrix

◆ get_sequence_name()

template<typename DataType = float>
const std::string & toolbox::io::kitti_odometry_dataset_t< DataType >::get_sequence_name ( ) const
inline

Get sequence name.

Returns
Sequence name (e.g., "00", "01")

◆ get_sequence_path()

template<typename DataType = float>
const std::string & toolbox::io::kitti_odometry_dataset_t< DataType >::get_sequence_path ( ) const
inline

Get sequence path.

Returns
Full path to sequence directory

◆ has_calibration()

template<typename DataType = float>
bool toolbox::io::kitti_odometry_dataset_t< DataType >::has_calibration ( ) const
inline

Check if calibration data is available.

Returns
True if calibration was loaded

◆ set_cache_size()

template<typename DataType = float>
void toolbox::io::kitti_odometry_dataset_t< DataType >::set_cache_size ( std::size_t  max_cached_frames)
inline

Set cache size for loaded frames.

Parameters
max_cached_framesMaximum number of frames to keep in memory

◆ set_error_policy()

template<typename DataType = float>
void toolbox::io::kitti_odometry_dataset_t< DataType >::set_error_policy ( error_recovery_policy_t  policy)
inline

Set error recovery policy.

Parameters
policyHow to handle errors during loading

◆ size_impl()

template<typename DataType = float>
std::size_t toolbox::io::kitti_odometry_dataset_t< DataType >::size_impl ( ) const
inline

Get number of frames in the sequence.

Returns
Number of available frames

The documentation for this class was generated from the following files: