Skip to content

Commit 756d9ee

Browse files
committed
Update the frame_id when enable_sync_output_accel_gyro is set to true
1 parent 719c075 commit 756d9ee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

orbbec_camera/include/orbbec_camera/ob_camera_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class OBCameraNode {
375375
std::unique_ptr<ob::Pipeline> imuPipeline_ = nullptr;
376376
std::atomic_bool pipeline_started_{false};
377377
std::string camera_name_ = "camera";
378-
const std::string imu_optical_frame_id_ = "camera_gyro_optical_frame";
378+
std::string accel_gyro_frame_id_ = "camera_accel_gyro_optical_frame";
379379
const std::string imu_frame_id_ = "camera_gyro_frame";
380380
std::shared_ptr<ob::Config> pipeline_config_ = nullptr;
381381
std::map<stream_index_pair, std::shared_ptr<ob::Sensor>> sensors_;

orbbec_camera/src/ob_camera_node.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,8 @@ void OBCameraNode::getParameters() {
11331133
depth_aligned_frame_id_[stream_index] = optical_frame_id_[COLOR];
11341134
}
11351135

1136+
accel_gyro_frame_id_ = camera_name_ + "_accel_gyro_optical_frame";
1137+
11361138
setAndGetNodeParameter(enable_sync_output_accel_gyro_, "enable_sync_output_accel_gyro", false);
11371139
for (const auto &stream_index : HID_STREAMS) {
11381140
std::string param_name = stream_name_[stream_index] + "_qos";
@@ -2318,7 +2320,7 @@ void OBCameraNode::onNewIMUFrameSyncOutputCallback(const std::shared_ptr<ob::Fra
23182320
accel_info.header = imu_msg.header;
23192321
imu_info_publishers_[ACCEL]->publish(accel_info);
23202322

2321-
imu_msg.header.frame_id = imu_optical_frame_id_;
2323+
imu_msg.header.frame_id = accel_gyro_frame_id_;
23222324

23232325
auto gyro_frame = gryoframe->as<ob::GyroFrame>();
23242326
auto gyroData = gyro_frame->getValue();

0 commit comments

Comments
 (0)