From 3007f2dfd8c55a2c27cba84c428cdc699513cf03 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Fri, 29 Nov 2024 16:18:07 +0900 Subject: [PATCH] fix(hesai): set PTP lock offset only for OT128, QT128 Signed-off-by: Max SCHMELLER --- .../hesai_hw_interface.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp b/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp index c0f349da..b1287223 100644 --- a/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp +++ b/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp @@ -1087,13 +1087,17 @@ HesaiStatus HesaiHwInterface::check_and_set_config( t.join(); logger_->debug("Thread finished"); - uint8_t sensor_ptp_lock_threshold = get_ptp_lock_offset(); - if (sensor_ptp_lock_threshold != sensor_configuration_->ptp_lock_threshold) { - NEBULA_LOG_STREAM( - logger_->info, "changing sensor PTP lock offset from " - << static_cast(sensor_ptp_lock_threshold) << " to " - << static_cast(sensor_configuration_->ptp_lock_threshold)); - set_ptp_lock_offset(sensor_configuration_->ptp_lock_threshold); + if ( + sensor_configuration_->sensor_model == SensorModel::HESAI_PANDAR128_E4X || + sensor_configuration_->sensor_model == SensorModel::HESAI_PANDARQT128) { + uint8_t sensor_ptp_lock_threshold = get_ptp_lock_offset(); + if (sensor_ptp_lock_threshold != sensor_configuration_->ptp_lock_threshold) { + NEBULA_LOG_STREAM( + logger_->info, "changing sensor PTP lock offset from " + << static_cast(sensor_ptp_lock_threshold) << " to " + << static_cast(sensor_configuration_->ptp_lock_threshold)); + set_ptp_lock_offset(sensor_configuration_->ptp_lock_threshold); + } } std::this_thread::sleep_for(wait_time);