Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
librealsense::ros_reader Class Reference

#include <ros_reader.h>

Inheritance diagram for librealsense::ros_reader:
Inheritance graph
[legend]

Classes

struct  l500_data_per_resolution
 
struct  l500_depth_data
 

Public Member Functions

virtual void disable_stream (const std::vector< device_serializer::stream_identifier > &stream_ids) override
 
virtual void enable_stream (const std::vector< device_serializer::stream_identifier > &stream_ids) override
 
std::vector< std::shared_ptr< serialized_data > > fetch_last_frames (const nanoseconds &seek_time) override
 
const std::stringget_file_name () const override
 
device_snapshot query_device_description (const nanoseconds &time) override
 
nanoseconds query_duration () const override
 
std::shared_ptr< serialized_dataread_next_data () override
 
void reset () override
 
 ros_reader (const std::string &file, const std::shared_ptr< context > &ctx)
 
void seek_to_time (const nanoseconds &seek_time) override
 
- Public Member Functions inherited from librealsense::device_serializer::reader
virtual ~reader ()=default
 

Private Member Functions

void add_sensor_extension (snapshot_collection &sensor_extensions, std::string sensor_name)
 
std::shared_ptr< serialized_framecreate_frame (const rosbag::MessageInstance &msg)
 
frame_holder create_image_from_message (const rosbag::MessageInstance &image_data) const
 
l500_depth_data create_l500_intrinsic_depth (const rosbag::MessageInstance &value_message_instance)
 
frame_holder create_motion_sample (const rosbag::MessageInstance &motion_data) const
 
frame_holder create_pose_sample (const rosbag::MessageInstance &msg) const
 
bool is_color_sensor (std::string sensor_name)
 
bool is_depth_sensor (std::string sensor_name)
 
bool is_ds5_PID (int pid)
 
bool is_fisheye_module_sensor (std::string sensor_name)
 
bool is_l500_PID (int pid)
 
bool is_motion_module_sensor (std::string sensor_name)
 
bool is_sr300_PID (int pid)
 
device_snapshot read_device_description (const nanoseconds &time, bool reset=false)
 
std::shared_ptr< info_containerread_info_snapshot (const std::string &topic) const
 
std::shared_ptr< info_containerread_legacy_info_snapshot (uint32_t sensor_index) const
 
stream_profiles read_legacy_stream_info (uint32_t sensor_index) const
 
std::shared_ptr< recommended_proccesing_blocks_snapshotread_proccesing_blocks (const rosbag::Bag &file, device_serializer::sensor_identifier sensor_id, const nanoseconds &timestamp, std::shared_ptr< options_interface > options, uint32_t file_version, std::string pid, std::string sensor_name)
 
std::shared_ptr< recommended_proccesing_blocks_snapshotread_proccesing_blocks_for_version_under_4 (std::string pid, std::string sensor_name, std::shared_ptr< options_interface > options)
 
std::set< uint32_tread_sensor_indices (uint32_t device_index) const
 
stream_profiles read_stream_info (uint32_t device_index, uint32_t sensor_index) const
 
ivcam2::intrinsic_depth ros_l500_depth_data_to_intrinsic_depth (ros_reader::l500_depth_data data)
 
bool try_read_legacy_stream_extrinsic (const stream_identifier &stream_id, uint32_t &group_id, rs2_extrinsics &extrinsic) const
 
bool try_read_stream_extrinsic (const stream_identifier &stream_id, uint32_t &group_id, rs2_extrinsics &extrinsic) const
 
void update_l500_depth_sensor (const rosbag::Bag &file, uint32_t sensor_index, const nanoseconds &time, uint32_t file_version, snapshot_collection &sensor_extensions, uint32_t version, std::string pid, std::string sensor_name)
 
void update_proccesing_blocks (const rosbag::Bag &file, uint32_t sensor_index, const nanoseconds &time, uint32_t file_version, snapshot_collection &sensor_extensions, uint32_t version, std::string pid, std::string sensor_name)
 

Static Private Member Functions

static std::shared_ptr< motion_stream_profilecreate_motion_stream (rs2_stream stream_type, uint32_t stream_index, uint32_t fps, rs2_format format, rs2_motion_device_intrinsic intrinsics)
 
static notification create_notification (const rosbag::Bag &file, const rosbag::MessageInstance &message_instance)
 
static std::pair< rs2_option, std::shared_ptr< librealsense::option > > create_option (const rosbag::Bag &file, const rosbag::MessageInstance &value_message_instance)
 
static std::shared_ptr< pose_stream_profilecreate_pose_profile (uint32_t stream_index, uint32_t fps)
 
static std::shared_ptr< librealsense::processing_block_interfacecreate_processing_block (const rosbag::MessageInstance &value_message_instance, bool &depth_to_disparity, std::shared_ptr< options_interface > options)
 
static std::pair< rs2_option, std::shared_ptr< librealsense::option > > create_property (const rosbag::MessageInstance &property_message_instance)
 
static std::shared_ptr< video_stream_profilecreate_video_stream_profile (const platform::stream_profile &sp, const sensor_msgs::CameraInfo &ci, const stream_descriptor &sd)
 
static nanoseconds get_file_duration (const rosbag::Bag &file, uint32_t version)
 
static std::map< std::string, std::stringget_frame_metadata (const rosbag::Bag &bag, const std::string &topic, const device_serializer::stream_identifier &stream_id, const rosbag::MessageInstance &msg, frame_additional_data &additional_data)
 
static void get_legacy_frame_metadata (const rosbag::Bag &bag, const device_serializer::stream_identifier &stream_id, const rosbag::MessageInstance &msg, frame_additional_data &additional_data)
 
static std::vector< std::stringget_topics (std::unique_ptr< rosbag::View > &view)
 
template<typename ROS_TYPE >
static ROS_TYPE::ConstPtr instantiate_msg (const rosbag::MessageInstance &msg)
 
static uint32_t read_file_version (const rosbag::Bag &file)
 
static std::string read_option_description (const rosbag::Bag &file, const std::string &topic)
 
static std::shared_ptr< options_containerread_sensor_options (const rosbag::Bag &file, device_serializer::sensor_identifier sensor_id, const nanoseconds &timestamp, uint32_t file_version)
 
template<typename T >
static bool safe_convert (const std::string &key, T &val)
 
static float3 to_float3 (const geometry_msgs::Vector3 &v)
 
static float4 to_float4 (const geometry_msgs::Quaternion &q)
 
static void update_sensor_options (const rosbag::Bag &file, uint32_t sensor_index, const nanoseconds &time, uint32_t file_version, snapshot_collection &sensor_extensions, uint32_t version)
 

Private Attributes

std::shared_ptr< contextm_context
 
std::vector< std::stringm_enabled_streams_topics
 
rosbag::Bag m_file
 
std::string m_file_path
 
std::shared_ptr< frame_sourcem_frame_source
 
device_snapshot m_initial_device_description
 
std::shared_ptr< metadata_parser_mapm_metadata_parser_map
 
rosbag::View::iterator m_samples_itrator
 
std::unique_ptr< rosbag::Viewm_samples_view
 
nanoseconds m_total_duration
 
uint32_t m_version
 

Detailed Description

Definition at line 13 of file ros_reader.h.

Constructor & Destructor Documentation

librealsense::ros_reader::ros_reader ( const std::string file,
const std::shared_ptr< context > &  ctx 
)

Definition at line 25 of file ros_reader.cpp.

Member Function Documentation

void librealsense::ros_reader::add_sensor_extension ( snapshot_collection sensor_extensions,
std::string  sensor_name 
)
private

Definition at line 829 of file ros_reader.cpp.

std::shared_ptr< serialized_frame > librealsense::ros_reader::create_frame ( const rosbag::MessageInstance msg)
private

Definition at line 246 of file ros_reader.cpp.

frame_holder librealsense::ros_reader::create_image_from_message ( const rosbag::MessageInstance image_data) const
private

Definition at line 406 of file ros_reader.cpp.

ros_reader::l500_depth_data librealsense::ros_reader::create_l500_intrinsic_depth ( const rosbag::MessageInstance value_message_instance)
private

Definition at line 1441 of file ros_reader.cpp.

frame_holder librealsense::ros_reader::create_motion_sample ( const rosbag::MessageInstance motion_data) const
private

Definition at line 454 of file ros_reader.cpp.

std::shared_ptr< motion_stream_profile > librealsense::ros_reader::create_motion_stream ( rs2_stream  stream_type,
uint32_t  stream_index,
uint32_t  fps,
rs2_format  format,
rs2_motion_device_intrinsic  intrinsics 
)
staticprivate

Definition at line 1187 of file ros_reader.cpp.

notification librealsense::ros_reader::create_notification ( const rosbag::Bag file,
const rosbag::MessageInstance message_instance 
)
staticprivate

Definition at line 1452 of file ros_reader.cpp.

std::pair< rs2_option, std::shared_ptr< librealsense::option > > librealsense::ros_reader::create_option ( const rosbag::Bag file,
const rosbag::MessageInstance value_message_instance 
)
staticprivate

Definition at line 1390 of file ros_reader.cpp.

std::shared_ptr< pose_stream_profile > librealsense::ros_reader::create_pose_profile ( uint32_t  stream_index,
uint32_t  fps 
)
staticprivate

Definition at line 1176 of file ros_reader.cpp.

frame_holder librealsense::ros_reader::create_pose_sample ( const rosbag::MessageInstance msg) const
private

Definition at line 538 of file ros_reader.cpp.

std::shared_ptr< librealsense::processing_block_interface > librealsense::ros_reader::create_processing_block ( const rosbag::MessageInstance value_message_instance,
bool &  depth_to_disparity,
std::shared_ptr< options_interface options 
)
staticprivate

Definition at line 1405 of file ros_reader.cpp.

std::pair< rs2_option, std::shared_ptr< librealsense::option > > librealsense::ros_reader::create_property ( const rosbag::MessageInstance property_message_instance)
staticprivate

Definition at line 1379 of file ros_reader.cpp.

std::shared_ptr< video_stream_profile > librealsense::ros_reader::create_video_stream_profile ( const platform::stream_profile sp,
const sensor_msgs::CameraInfo ci,
const stream_descriptor sd 
)
staticprivate

Definition at line 1198 of file ros_reader.cpp.

void librealsense::ros_reader::disable_stream ( const std::vector< device_serializer::stream_identifier > &  stream_ids)
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 206 of file ros_reader.cpp.

void librealsense::ros_reader::enable_stream ( const std::vector< device_serializer::stream_identifier > &  stream_ids)
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 162 of file ros_reader.cpp.

std::vector< std::shared_ptr< serialized_data > > librealsense::ros_reader::fetch_last_frames ( const nanoseconds seek_time)
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 116 of file ros_reader.cpp.

nanoseconds librealsense::ros_reader::get_file_duration ( const rosbag::Bag file,
uint32_t  version 
)
staticprivate

Definition at line 288 of file ros_reader.cpp.

const std::string & librealsense::ros_reader::get_file_name ( ) const
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 241 of file ros_reader.cpp.

std::map< std::string, std::string > librealsense::ros_reader::get_frame_metadata ( const rosbag::Bag bag,
const std::string topic,
const device_serializer::stream_identifier stream_id,
const rosbag::MessageInstance msg,
frame_additional_data additional_data 
)
staticprivate

Definition at line 349 of file ros_reader.cpp.

void librealsense::ros_reader::get_legacy_frame_metadata ( const rosbag::Bag bag,
const device_serializer::stream_identifier stream_id,
const rosbag::MessageInstance msg,
frame_additional_data additional_data 
)
staticprivate

Definition at line 300 of file ros_reader.cpp.

std::vector< std::string > librealsense::ros_reader::get_topics ( std::unique_ptr< rosbag::View > &  view)
staticprivate

Definition at line 1510 of file ros_reader.cpp.

template<typename ROS_TYPE >
static ROS_TYPE::ConstPtr librealsense::ros_reader::instantiate_msg ( const rosbag::MessageInstance msg)
inlinestaticprivate

Definition at line 30 of file ros_reader.h.

bool librealsense::ros_reader::is_color_sensor ( std::string  sensor_name)
private

Definition at line 873 of file ros_reader.cpp.

bool librealsense::ros_reader::is_depth_sensor ( std::string  sensor_name)
private

Definition at line 866 of file ros_reader.cpp.

bool librealsense::ros_reader::is_ds5_PID ( int  pid)
private

Definition at line 894 of file ros_reader.cpp.

bool librealsense::ros_reader::is_fisheye_module_sensor ( std::string  sensor_name)
private

Definition at line 887 of file ros_reader.cpp.

bool librealsense::ros_reader::is_l500_PID ( int  pid)
private

Definition at line 923 of file ros_reader.cpp.

bool librealsense::ros_reader::is_motion_module_sensor ( std::string  sensor_name)
private

Definition at line 880 of file ros_reader.cpp.

bool librealsense::ros_reader::is_sr300_PID ( int  pid)
private

Definition at line 906 of file ros_reader.cpp.

device_snapshot librealsense::ros_reader::query_device_description ( const nanoseconds time)
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 44 of file ros_reader.cpp.

nanoseconds librealsense::ros_reader::query_duration ( ) const
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 146 of file ros_reader.cpp.

device_snapshot librealsense::ros_reader::read_device_description ( const nanoseconds time,
bool  reset = false 
)
private

Definition at line 1011 of file ros_reader.cpp.

uint32_t librealsense::ros_reader::read_file_version ( const rosbag::Bag file)
staticprivate

Definition at line 646 of file ros_reader.cpp.

std::shared_ptr< info_container > librealsense::ros_reader::read_info_snapshot ( const std::string topic) const
private

Definition at line 1114 of file ros_reader.cpp.

std::shared_ptr< info_container > librealsense::ros_reader::read_legacy_info_snapshot ( uint32_t  sensor_index) const
private

Definition at line 1088 of file ros_reader.cpp.

stream_profiles librealsense::ros_reader::read_legacy_stream_info ( uint32_t  sensor_index) const
private

Definition at line 1232 of file ros_reader.cpp.

std::shared_ptr< serialized_data > librealsense::ros_reader::read_next_data ( )
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 49 of file ros_reader.cpp.

std::string librealsense::ros_reader::read_option_description ( const rosbag::Bag file,
const std::string topic 
)
staticprivate

Definition at line 1364 of file ros_reader.cpp.

std::shared_ptr< recommended_proccesing_blocks_snapshot > librealsense::ros_reader::read_proccesing_blocks ( const rosbag::Bag file,
device_serializer::sensor_identifier  sensor_id,
const nanoseconds timestamp,
std::shared_ptr< options_interface options,
uint32_t  file_version,
std::string  pid,
std::string  sensor_name 
)
private

Definition at line 977 of file ros_reader.cpp.

std::shared_ptr< recommended_proccesing_blocks_snapshot > librealsense::ros_reader::read_proccesing_blocks_for_version_under_4 ( std::string  pid,
std::string  sensor_name,
std::shared_ptr< options_interface options 
)
private

Definition at line 928 of file ros_reader.cpp.

std::set< uint32_t > librealsense::ros_reader::read_sensor_indices ( uint32_t  device_index) const
private

Definition at line 1144 of file ros_reader.cpp.

std::shared_ptr< options_container > librealsense::ros_reader::read_sensor_options ( const rosbag::Bag file,
device_serializer::sensor_identifier  sensor_id,
const nanoseconds timestamp,
uint32_t  file_version 
)
staticprivate

Definition at line 1466 of file ros_reader.cpp.

stream_profiles librealsense::ros_reader::read_stream_info ( uint32_t  device_index,
uint32_t  sensor_index 
) const
private

Definition at line 1299 of file ros_reader.cpp.

void librealsense::ros_reader::reset ( void  )
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 151 of file ros_reader.cpp.

ivcam2::intrinsic_depth librealsense::ros_reader::ros_l500_depth_data_to_intrinsic_depth ( ros_reader::l500_depth_data  data)
private

Definition at line 808 of file ros_reader.cpp.

template<typename T >
static bool librealsense::ros_reader::safe_convert ( const std::string key,
T &  val 
)
inlinestaticprivate

Definition at line 52 of file ros_reader.h.

void librealsense::ros_reader::seek_to_time ( const nanoseconds seek_time)
overridevirtual

Implements librealsense::device_serializer::reader.

Definition at line 95 of file ros_reader.cpp.

float3 librealsense::ros_reader::to_float3 ( const geometry_msgs::Vector3 v)
inlinestaticprivate

Definition at line 519 of file ros_reader.cpp.

float4 librealsense::ros_reader::to_float4 ( const geometry_msgs::Quaternion q)
inlinestaticprivate

Definition at line 528 of file ros_reader.cpp.

bool librealsense::ros_reader::try_read_legacy_stream_extrinsic ( const stream_identifier stream_id,
uint32_t group_id,
rs2_extrinsics extrinsic 
) const
private

Definition at line 680 of file ros_reader.cpp.

bool librealsense::ros_reader::try_read_stream_extrinsic ( const stream_identifier stream_id,
uint32_t group_id,
rs2_extrinsics extrinsic 
) const
private

Definition at line 745 of file ros_reader.cpp.

void librealsense::ros_reader::update_l500_depth_sensor ( const rosbag::Bag file,
uint32_t  sensor_index,
const nanoseconds time,
uint32_t  file_version,
snapshot_collection sensor_extensions,
uint32_t  version,
std::string  pid,
std::string  sensor_name 
)
private

Definition at line 845 of file ros_reader.cpp.

void librealsense::ros_reader::update_proccesing_blocks ( const rosbag::Bag file,
uint32_t  sensor_index,
const nanoseconds time,
uint32_t  file_version,
snapshot_collection sensor_extensions,
uint32_t  version,
std::string  pid,
std::string  sensor_name 
)
private

Definition at line 787 of file ros_reader.cpp.

void librealsense::ros_reader::update_sensor_options ( const rosbag::Bag file,
uint32_t  sensor_index,
const nanoseconds time,
uint32_t  file_version,
snapshot_collection sensor_extensions,
uint32_t  version 
)
staticprivate

Definition at line 764 of file ros_reader.cpp.

Member Data Documentation

std::shared_ptr<context> librealsense::ros_reader::m_context
private

Definition at line 144 of file ros_reader.h.

std::vector<std::string> librealsense::ros_reader::m_enabled_streams_topics
private

Definition at line 143 of file ros_reader.h.

rosbag::Bag librealsense::ros_reader::m_file
private

Definition at line 140 of file ros_reader.h.

std::string librealsense::ros_reader::m_file_path
private

Definition at line 138 of file ros_reader.h.

std::shared_ptr<frame_source> librealsense::ros_reader::m_frame_source
private

Definition at line 139 of file ros_reader.h.

device_snapshot librealsense::ros_reader::m_initial_device_description
private

Definition at line 136 of file ros_reader.h.

std::shared_ptr<metadata_parser_map> librealsense::ros_reader::m_metadata_parser_map
private

Definition at line 135 of file ros_reader.h.

rosbag::View::iterator librealsense::ros_reader::m_samples_itrator
private

Definition at line 142 of file ros_reader.h.

std::unique_ptr<rosbag::View> librealsense::ros_reader::m_samples_view
private

Definition at line 141 of file ros_reader.h.

nanoseconds librealsense::ros_reader::m_total_duration
private

Definition at line 137 of file ros_reader.h.

uint32_t librealsense::ros_reader::m_version
private

Definition at line 145 of file ros_reader.h.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:38