fix: harden timestamp CSV logger lifecycle and synced IMU setup

This commit is contained in:
slz
2026-08-25 16:34:22 +08:00
parent 09990b6bf1
commit 4d5b3a7370
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -820,11 +820,6 @@ void OBCameraNode::clean() noexcept {
is_running_.store(false); is_running_.store(false);
is_camera_node_initialized_.store(false); is_camera_node_initialized_.store(false);
if (timestamp_csv_logger_) {
timestamp_csv_logger_->shutdown();
timestamp_csv_logger_.reset();
}
// Stop diagnostic timer and updater first BEFORE acquiring device_lock to prevent deadlock // Stop diagnostic timer and updater first BEFORE acquiring device_lock to prevent deadlock
try { try {
if (diagnostic_timer_) { if (diagnostic_timer_) {
@@ -884,6 +879,11 @@ void OBCameraNode::clean() noexcept {
RCLCPP_DEBUG_STREAM(logger_, "Exception while stopping streams"); RCLCPP_DEBUG_STREAM(logger_, "Exception while stopping streams");
} }
if (timestamp_csv_logger_) {
timestamp_csv_logger_->shutdown();
timestamp_csv_logger_.reset();
}
// Clean up d2c_viewer_ before cleaning buffers // Clean up d2c_viewer_ before cleaning buffers
RCLCPP_DEBUG_STREAM(logger_, "Clean d2c_viewer"); RCLCPP_DEBUG_STREAM(logger_, "Clean d2c_viewer");
try { try {
+1 -1
View File
@@ -30,7 +30,7 @@ TimestampCsvLogger::TimestampCsvLogger(Config config, rclcpp::Logger logger)
} }
} }
if (config.csv_file_path.empty() || (!config.accel_enabled && !config.gyro_enabled)) { if (config.csv_file_path.empty()) {
return; return;
} }