mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 12:07:46 +08:00
fixed imu frame id.
This commit is contained in:
@@ -1221,8 +1221,7 @@ void OBCameraNode::onNewIMUFrameSyncOutputCallback(const std::shared_ptr<ob::Fra
|
||||
auto imu_msg = sensor_msgs::msg::Imu();
|
||||
setDefaultIMUMessage(imu_msg);
|
||||
|
||||
std::string imu_optical_frame_id ="camera_gyro_accel_optical_frame";
|
||||
imu_msg.header.frame_id = imu_optical_frame_id;
|
||||
imu_msg.header.frame_id = imu_optical_frame_id_;
|
||||
auto timestamp = frameTimeStampToROSTime(accelframe->systemTimeStamp());
|
||||
imu_msg.header.stamp = timestamp;
|
||||
auto gyro_frame = gryoframe->as<ob::GyroFrame>();
|
||||
@@ -1429,14 +1428,16 @@ void OBCameraNode::calcAndPublishStaticTransform() {
|
||||
publishStaticTF(tf_timestamp, zero_trans, quaternion_optical, frame_id_[stream_index],
|
||||
optical_frame_id_[stream_index]);
|
||||
}
|
||||
for (const auto &stream_index : HID_STREAMS) {
|
||||
if (enable_stream_[stream_index]) {
|
||||
publishStaticTF(tf_timestamp, zero_trans, zero_rot, camera_link_frame_id_,
|
||||
frame_id_[stream_index]);
|
||||
publishStaticTF(tf_timestamp, zero_trans, quaternion_optical, frame_id_[stream_index],
|
||||
optical_frame_id_[stream_index]);
|
||||
}
|
||||
}
|
||||
// for (const auto &stream_index : HID_STREAMS) {
|
||||
// if (enable_stream_[stream_index]) {
|
||||
// publishStaticTF(tf_timestamp, zero_trans, zero_rot, camera_link_frame_id_,
|
||||
// frame_id_[stream_index]);
|
||||
// publishStaticTF(tf_timestamp, zero_trans, quaternion_optical, frame_id_[stream_index],
|
||||
// optical_frame_id_[stream_index]);
|
||||
// }
|
||||
// }
|
||||
publishStaticTF(tf_timestamp, zero_trans, zero_rot, camera_link_frame_id_, imu_frame_id_);
|
||||
publishStaticTF(tf_timestamp, zero_trans, quaternion_optical, imu_frame_id_, imu_optical_frame_id_);
|
||||
}
|
||||
|
||||
void OBCameraNode::publishStaticTransforms() {
|
||||
|
||||
Reference in New Issue
Block a user