Skip to content

Commit

Permalink
Use message timestamp for internal timestamp (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymd-stella authored Jul 23, 2024
1 parent 9f31886 commit dfd165e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stella_vslam_ros.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void mono::callback(const sensor_msgs::ImageConstPtr& msg) {
camera_optical_frame_ = msg->header.frame_id;
}
const auto tp_1 = std::chrono::steady_clock::now();
const auto timestamp = std::chrono::duration_cast<std::chrono::duration<double>>(tp_1 - tp_0_).count();
const auto timestamp = msg->header.stamp.toSec();

// input the current frame and estimate the camera pose
auto cam_pose_wc = slam_->feed_monocular_frame(cv_bridge::toCvShare(msg)->image, timestamp, mask_);
Expand Down Expand Up @@ -291,7 +291,7 @@ void stereo::callback(const sensor_msgs::ImageConstPtr& left, const sensor_msgs:
}

const auto tp_1 = std::chrono::steady_clock::now();
const auto timestamp = std::chrono::duration_cast<std::chrono::duration<double>>(tp_1 - tp_0_).count();
const auto timestamp = left->header.stamp.toSec();

// input the current frame and estimate the camera pose
auto cam_pose_wc = slam_->feed_stereo_frame(leftcv, rightcv, timestamp, mask_);
Expand Down Expand Up @@ -344,7 +344,7 @@ void rgbd::callback(const sensor_msgs::ImageConstPtr& color, const sensor_msgs::
}

const auto tp_1 = std::chrono::steady_clock::now();
const auto timestamp = std::chrono::duration_cast<std::chrono::duration<double>>(tp_1 - tp_0_).count();
const auto timestamp = color->header.stamp.toSec();

// input the current frame and estimate the camera pose
auto cam_pose_wc = slam_->feed_RGBD_frame(colorcv, depthcv, timestamp, mask_);
Expand Down

0 comments on commit dfd165e

Please sign in to comment.