Swarm-SLAM
1.0.0
C-SLAM Framework
|
#include <rgbd_handler.h>
Public Member Functions | |
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... | |
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... | |
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... | |
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... | |
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... | |
Protected Attributes | |
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_ |
Definition at line 56 of file rgbd_handler.h.
RGBDHandler::RGBDHandler | ( | std::shared_ptr< rclcpp::Node > & | node | ) |
Initialization of parameters and ROS 2 objects.
node | ROS 2 node handle |
Definition at line 16 of file rgbd_handler.cpp.
|
inline |
Definition at line 65 of file rgbd_handler.h.
void RGBDHandler::clear_sensor_data | ( | std::shared_ptr< rtabmap::SensorData > & | sensor_data | ) |
Clear images and large data fields in sensor data.
sensor_data | frame data |
Definition at line 619 of file rgbd_handler.cpp.
void RGBDHandler::compute_local_descriptors | ( | std::shared_ptr< rtabmap::SensorData > & | frame_data | ) |
Computes local 3D descriptors from frame data and store them.
frame_data | Full frame data |
Definition at line 266 of file rgbd_handler.cpp.
bool RGBDHandler::generate_new_keyframe | ( | std::shared_ptr< rtabmap::SensorData > & | keyframe | ) |
Generate a new keyframe according to the policy.
keyframe | Sensor data |
Definition at line 314 of file rgbd_handler.cpp.
void RGBDHandler::gps_callback | ( | const sensor_msgs::msg::NavSatFix::ConstSharedPtr | msg | ) |
GPS data callback.
msg |
Definition at line 684 of file rgbd_handler.cpp.
|
virtual |
converts descriptors to sensore data
msg | local descriptors |
Reimplemented in cslam::StereoHandler.
Definition at line 471 of file rgbd_handler.cpp.
void RGBDHandler::local_descriptors_request | ( | cslam_common_interfaces::msg::LocalDescriptorsRequest::ConstSharedPtr | request | ) |
Service callback to publish local descriptors.
request | Image ID to send and matching info |
Definition at line 404 of file rgbd_handler.cpp.
|
virtual |
Processes Latest received image.
Implements cslam::ISensorHandler.
Definition at line 353 of file rgbd_handler.cpp.
void RGBDHandler::receive_local_image_descriptors | ( | const std::shared_ptr< cslam_common_interfaces::msg::LocalImageDescriptors > | msg | ) |
Message callback to receive descriptors and compute.
msg | local descriptors |
Definition at line 493 of file rgbd_handler.cpp.
void RGBDHandler::receive_local_keyframe_match | ( | cslam_common_interfaces::msg::LocalKeyframeMatch::ConstSharedPtr | msg | ) |
Receives a local match and tries to compute a local loop closure.
msg |
Definition at line 433 of file rgbd_handler.cpp.
void RGBDHandler::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.
image_rgb | |
image_depth | |
camera_info_rgb | |
camera_info_depth | |
odom |
Definition at line 173 of file rgbd_handler.cpp.
void RGBDHandler::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.
keypoints_data | keyframe keypoints data |
Definition at line 556 of file rgbd_handler.cpp.
void RGBDHandler::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.
keypoints_data | keyframe keypoints data |
gps_data | GPS data |
Definition at line 584 of file rgbd_handler.cpp.
|
virtual |
Send keypoints for visualizations.
keypoints_data | keyframe keypoints data |
Reimplemented in cslam::StereoHandler.
Definition at line 613 of file rgbd_handler.cpp.
void RGBDHandler::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.
keypoints_data | keyframe keypoints data |
Definition at line 626 of file rgbd_handler.cpp.
void RGBDHandler::send_visualization_pointcloud | ( | const std::shared_ptr< rtabmap::SensorData > & | sensor_data | ) |
Send colored pointcloud for visualizations.
sensor_data | RGBD image |
Definition at line 665 of file rgbd_handler.cpp.
void RGBDHandler::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
sensor_data | local descriptors |
msg_data | rtabmap_msgs::msg::RGBDImage& |
Definition at line 396 of file rgbd_handler.cpp.
sensor_msgs::msg::PointCloud2 RGBDHandler::visualization_pointcloud_voxel_subsampling | ( | const sensor_msgs::msg::PointCloud2 & | input_cloud | ) |
Subsample pointcloud to reduce size for visualization.
input_cloud |
Definition at line 640 of file rgbd_handler.cpp.
|
protected |
Definition at line 276 of file rgbd_handler.h.
|
protected |
Definition at line 284 of file rgbd_handler.h.
|
protected |
Definition at line 270 of file rgbd_handler.h.
|
protected |
Definition at line 281 of file rgbd_handler.h.
|
protected |
Definition at line 278 of file rgbd_handler.h.
|
protected |
Definition at line 286 of file rgbd_handler.h.
|
protected |
Definition at line 285 of file rgbd_handler.h.
|
protected |
Definition at line 260 of file rgbd_handler.h.
|
protected |
Definition at line 264 of file rgbd_handler.h.
|
protected |
Definition at line 240 of file rgbd_handler.h.
|
protected |
Definition at line 277 of file rgbd_handler.h.
|
protected |
Definition at line 243 of file rgbd_handler.h.
|
protected |
Definition at line 246 of file rgbd_handler.h.
|
protected |
Definition at line 287 of file rgbd_handler.h.
|
protected |
Definition at line 221 of file rgbd_handler.h.
|
protected |
Definition at line 236 of file rgbd_handler.h.
|
protected |
Definition at line 254 of file rgbd_handler.h.
|
protected |
Definition at line 250 of file rgbd_handler.h.
|
protected |
Definition at line 268 of file rgbd_handler.h.
|
protected |
Definition at line 269 of file rgbd_handler.h.
|
protected |
Definition at line 225 of file rgbd_handler.h.
|
protected |
Definition at line 225 of file rgbd_handler.h.
|
protected |
Definition at line 225 of file rgbd_handler.h.
|
protected |
Definition at line 226 of file rgbd_handler.h.
|
protected |
Definition at line 223 of file rgbd_handler.h.
|
protected |
Definition at line 219 of file rgbd_handler.h.
|
protected |
Definition at line 217 of file rgbd_handler.h.
|
protected |
Definition at line 289 of file rgbd_handler.h.
|
protected |
Definition at line 256 of file rgbd_handler.h.
|
protected |
Definition at line 225 of file rgbd_handler.h.
|
protected |
Definition at line 232 of file rgbd_handler.h.
|
protected |
Definition at line 228 of file rgbd_handler.h.
|
protected |
Definition at line 273 of file rgbd_handler.h.
|
protected |
Definition at line 274 of file rgbd_handler.h.
|
protected |
Definition at line 237 of file rgbd_handler.h.
|
protected |
Definition at line 282 of file rgbd_handler.h.
|
protected |
Definition at line 280 of file rgbd_handler.h.
|
protected |
Definition at line 282 of file rgbd_handler.h.