MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO-ROS / addStereoFrame

Method addStereoFrame

src/stereo-image-buffer.cpp:40–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void StereoBuffer::addStereoFrame(const sensor_msgs::ImageConstPtr& left_img,
41 const sensor_msgs::ImageConstPtr& right_img) {
42 // Timestamp is in nanoseconds
43 Timestamp timestamp = left_img->header.stamp.toNSec();
44
45 if (stereo_buffer_.size() == 0) {
46 // if only frame
47 earliest_timestamp_ = timestamp;
48 }
49
50 // create packet
51 StereoPacket sp;
52 sp.timestamp = timestamp;
53 sp.left_ros_img = left_img;
54 sp.right_ros_img = right_img;
55
56 // Update buffer and time
57 stereo_buffer_.push_back(sp);
58 latest_timestamp_ = timestamp;
59 return;
60}
61
62void StereoBuffer::removeNext() {
63 // Remove next pair of stereo frames

Callers 1

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected