Swarm-SLAM  1.0.0
C-SLAM Framework
cslam::StereoHandler Class Reference

#include <stereo_handler.h>

Inheritance diagram for cslam::StereoHandler:
[legend]

Public Member Functions

 StereoHandler (std::shared_ptr< rclcpp::Node > &node)
 Initialization of parameters and ROS 2 objects. More...
 
 ~StereoHandler ()
 
void stereo_callback (const sensor_msgs::msg::Image::ConstSharedPtr image_rect_left, const sensor_msgs::msg::Image::ConstSharedPtr image_rect_right, const sensor_msgs::msg::CameraInfo::ConstSharedPtr camera_info_left, const sensor_msgs::msg::CameraInfo::ConstSharedPtr camera_info_right, const nav_msgs::msg::Odometry::ConstSharedPtr odom)
 Callback receiving sync data from camera. More...
 
virtual void local_descriptors_msg_to_sensor_data (const std::shared_ptr< cslam_common_interfaces::msg::LocalImageDescriptors > msg, rtabmap::SensorData &sensor_data)
 converts descriptors to sensore data More...
 
virtual void send_visualization (const std::pair< std::shared_ptr< rtabmap::SensorData >, std::shared_ptr< const nav_msgs::msg::Odometry >> &keypoints_data)
 Send keypoints for visualizations. More...
 
- Public Member Functions inherited from cslam::RGBDHandler
 RGBDHandler (std::shared_ptr< rclcpp::Node > &node)
 Initialization of parameters and ROS 2 objects. More...
 
 ~RGBDHandler ()
 
virtual void process_new_sensor_data ()
 Processes Latest received image. More...
 
void local_descriptors_request (cslam_common_interfaces::msg::LocalDescriptorsRequest::ConstSharedPtr request)
 Service callback to publish local descriptors. More...
 
void receive_local_keyframe_match (cslam_common_interfaces::msg::LocalKeyframeMatch::ConstSharedPtr msg)
 Receives a local match and tries to compute a local loop closure. More...
 
void receive_local_image_descriptors (const std::shared_ptr< cslam_common_interfaces::msg::LocalImageDescriptors > msg)
 Message callback to receive descriptors and compute. More...
 
void compute_local_descriptors (std::shared_ptr< rtabmap::SensorData > &frame_data)
 Computes local 3D descriptors from frame data and store them. More...
 
void sensor_data_to_rgbd_msg (const std::shared_ptr< rtabmap::SensorData > sensor_data, rtabmap_msgs::msg::RGBDImage &msg_data)
 converts sensor data to descriptor msg More...
 
bool generate_new_keyframe (std::shared_ptr< rtabmap::SensorData > &keyframe)
 Generate a new keyframe according to the policy. More...
 
void send_keyframe (const std::pair< std::shared_ptr< rtabmap::SensorData >, std::shared_ptr< const nav_msgs::msg::Odometry >> &keypoints_data)
 Function to send the image to the python node. More...
 
void send_keyframe (const std::pair< std::shared_ptr< rtabmap::SensorData >, std::shared_ptr< const nav_msgs::msg::Odometry >> &keypoints_data, const sensor_msgs::msg::NavSatFix &gps_data)
 Function to send the image to the python node. More...
 
void send_visualization_keypoints (const std::pair< std::shared_ptr< rtabmap::SensorData >, std::shared_ptr< const nav_msgs::msg::Odometry >> &keypoints_data)
 Send keypoints for visualizations. More...
 
void send_visualization_pointcloud (const std::shared_ptr< rtabmap::SensorData > &sensor_data)
 Send colored pointcloud for visualizations. More...
 
void rgbd_callback (const sensor_msgs::msg::Image::ConstSharedPtr image_rect_rgb, const sensor_msgs::msg::Image::ConstSharedPtr image_rect_depth, const sensor_msgs::msg::CameraInfo::ConstSharedPtr camera_info_rgb, const nav_msgs::msg::Odometry::ConstSharedPtr odom)
 Callback receiving sync data from camera. More...
 
void clear_sensor_data (std::shared_ptr< rtabmap::SensorData > &sensor_data)
 Clear images and large data fields in sensor data. More...
 
void gps_callback (const sensor_msgs::msg::NavSatFix::ConstSharedPtr msg)
 GPS data callback. More...
 
sensor_msgs::msg::PointCloud2 visualization_pointcloud_voxel_subsampling (const sensor_msgs::msg::PointCloud2 &input_cloud)
 Subsample pointcloud to reduce size for visualization. More...
 
- Public Member Functions inherited from cslam::ISensorHandler
virtual ~ISensorHandler ()
 Virtual destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from cslam::RGBDHandler
std::deque< std::pair< std::shared_ptr< rtabmap::SensorData >, nav_msgs::msg::Odometry::ConstSharedPtr > > received_data_queue_
 
std::shared_ptr< rtabmap::SensorData > previous_keyframe_
 
std::map< int, std::shared_ptr< rtabmap::SensorData > > local_descriptors_map_
 
std::shared_ptr< rclcpp::Node > node_
 
unsigned int min_inliers_
 
unsigned int max_nb_robots_
 
unsigned int robot_id_
 
unsigned int max_queue_size_
 
unsigned int nb_local_keyframes_
 
message_filters::Subscriber< nav_msgs::msg::Odometry > sub_odometry_
 
rclcpp::Subscription< cslam_common_interfaces::msg::LocalDescriptorsRequest >::SharedPtr send_local_descriptors_subscriber_
 
rclcpp::Publisher< cslam_common_interfaces::msg::LocalImageDescriptors >::SharedPtr local_descriptors_publisher_
 
rclcpp::Publisher< cslam_common_interfaces::msg::LocalImageDescriptors >::SharedPtr visualization_local_descriptors_publisher_
 
rclcpp::Publisher< cslam_common_interfaces::msg::KeyframeRGB >::SharedPtr keyframe_data_publisher_
 
rclcpp::Publisher< cslam_common_interfaces::msg::KeyframeOdom >::SharedPtr keyframe_odom_publisher_
 
rclcpp::Publisher< cslam_common_interfaces::msg::VizPointCloud >::SharedPtr keyframe_pointcloud_publisher_
 
rclcpp::Subscription< cslam_common_interfaces::msg::LocalKeyframeMatch >::SharedPtr local_keyframe_match_subscriber_
 
rclcpp::Subscription< cslam_common_interfaces::msg::LocalImageDescriptors >::SharedPtr local_descriptors_subscriber_
 
rtabmap::RegistrationVis registration_
 
rclcpp::Publisher< cslam_common_interfaces::msg::InterRobotLoopClosure >::SharedPtr inter_robot_loop_closure_publisher_
 
rclcpp::Publisher< cslam_common_interfaces::msg::IntraRobotLoopClosure >::SharedPtr intra_robot_loop_closure_publisher_
 
rclcpp::Publisher< diagnostic_msgs::msg::KeyValue >::SharedPtr log_publisher_
 
unsigned int log_total_local_descriptors_cumulative_communication_
 
bool enable_logs_
 
std::shared_ptr< tf2_ros::Buffer > tf_buffer_
 
std::shared_ptr< tf2_ros::TransformListener > tf_listener_
 
std::string base_frame_id_
 
float keyframe_generation_ratio_threshold_
 
bool generate_new_keyframes_based_on_inliers_ratio_
 
unsigned int visualization_period_ms_
 
bool enable_visualization_
 
float visualization_voxel_size_
 
float visualization_max_range_
 
bool enable_gps_recording_
 
std::string gps_topic_
 
rclcpp::Subscription< sensor_msgs::msg::NavSatFix >::SharedPtr gps_subscriber_
 
sensor_msgs::msg::NavSatFix latest_gps_fix_
 
std::deque< sensor_msgs::msg::NavSatFix > received_gps_queue_
 

Detailed Description

Definition at line 9 of file stereo_handler.h.

Constructor & Destructor Documentation

◆ StereoHandler()

StereoHandler::StereoHandler ( std::shared_ptr< rclcpp::Node > &  node)

Initialization of parameters and ROS 2 objects.

Parameters
nodeROS 2 node handle

Definition at line 7 of file stereo_handler.cpp.

Here is the call graph for this function:

◆ ~StereoHandler()

cslam::StereoHandler::~StereoHandler ( )
inline

Definition at line 18 of file stereo_handler.h.

Member Function Documentation

◆ local_descriptors_msg_to_sensor_data()

void StereoHandler::local_descriptors_msg_to_sensor_data ( const std::shared_ptr< cslam_common_interfaces::msg::LocalImageDescriptors >  msg,
rtabmap::SensorData &  sensor_data 
)
virtual

converts descriptors to sensore data

Parameters
msglocal descriptors
Returns
rtabmap::SensorData&

Reimplemented from cslam::RGBDHandler.

Definition at line 251 of file stereo_handler.cpp.

◆ send_visualization()

void StereoHandler::send_visualization ( const std::pair< std::shared_ptr< rtabmap::SensorData >, std::shared_ptr< const nav_msgs::msg::Odometry >> &  keypoints_data)
virtual

Send keypoints for visualizations.

Parameters
keypoints_datakeyframe keypoints data

Reimplemented from cslam::RGBDHandler.

Definition at line 273 of file stereo_handler.cpp.

Here is the call graph for this function:

◆ stereo_callback()

void StereoHandler::stereo_callback ( const sensor_msgs::msg::Image::ConstSharedPtr  image_rect_left,
const sensor_msgs::msg::Image::ConstSharedPtr  image_rect_right,
const sensor_msgs::msg::CameraInfo::ConstSharedPtr  camera_info_left,
const sensor_msgs::msg::CameraInfo::ConstSharedPtr  camera_info_right,
const nav_msgs::msg::Odometry::ConstSharedPtr  odom 
)

Callback receiving sync data from camera.

Parameters
image_rect_left
image_rect_right
camera_info_left
camera_info_right
odom

Definition at line 48 of file stereo_handler.cpp.

Here is the caller graph for this function:

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