mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-15 04:20:20 +08:00
fixed camera info frame id
This commit is contained in:
@@ -815,7 +815,11 @@ void OBCameraNode::onNewFrameCallback(const std::shared_ptr<ob::Frame> &frame,
|
||||
stream_index == COLOR ? camera_param_->rgbIntrinsic : camera_param_->depthIntrinsic;
|
||||
auto &distortion =
|
||||
stream_index == COLOR ? camera_param_->rgbDistortion : camera_param_->depthDistortion;
|
||||
std::string frame_id =
|
||||
depth_registration_ ? depth_aligned_frame_id_[stream_index] : optical_frame_id_[stream_index];
|
||||
auto camera_info = convertToCameraInfo(intrinsic, distortion, width);
|
||||
camera_info.header.stamp = timestamp;
|
||||
camera_info.header.frame_id = frame_id;
|
||||
CHECK(camera_info_publishers_.count(stream_index) > 0);
|
||||
camera_info_publishers_[stream_index]->publish(camera_info);
|
||||
auto image_msg =
|
||||
@@ -823,8 +827,8 @@ void OBCameraNode::onNewFrameCallback(const std::shared_ptr<ob::Frame> &frame,
|
||||
image_msg->header.stamp = timestamp;
|
||||
image_msg->is_bigendian = false;
|
||||
image_msg->step = width * unit_step_size_[stream_index];
|
||||
image_msg->header.frame_id =
|
||||
depth_registration_ ? depth_aligned_frame_id_[stream_index] : optical_frame_id_[stream_index];
|
||||
image_msg->header.frame_id = frame_id;
|
||||
|
||||
CHECK(image_publishers_.count(stream_index) > 0);
|
||||
image_publishers_[stream_index].publish(image_msg);
|
||||
saveImageToFile(stream_index, image, image_msg);
|
||||
|
||||
Reference in New Issue
Block a user