Skip to content

Commit

Permalink
fix(hesai): set PTP lock offset only for OT128, QT128
Browse files Browse the repository at this point in the history
Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex committed Nov 29, 2024
1 parent 2561bdf commit d3c6bf4
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1075,13 +1075,17 @@ HesaiStatus HesaiHwInterface::CheckAndSetConfig(
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<int>(sensor_ptp_lock_threshold) << " to "
<< static_cast<int>(sensor_configuration_->ptp_lock_threshold));
set_ptp_lock_offset(sensor_configuration_->ptp_lock_threshold);
if (
sensor_configuration_->sensor_model == SensorModel::HESAI_PANDAR128_E4X ||

Check warning on line 1079 in nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp#L1079

Added line #L1079 was not covered by tests
sensor_configuration_->sensor_model == SensorModel::HESAI_PANDARQT128) {
uint8_t sensor_ptp_lock_threshold = get_ptp_lock_offset();

Check warning on line 1081 in nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp#L1081

Added line #L1081 was not covered by tests
if (sensor_ptp_lock_threshold != sensor_configuration_->ptp_lock_threshold) {
NEBULA_LOG_STREAM(

Check warning on line 1083 in nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp#L1083

Added line #L1083 was not covered by tests
logger_->info, "changing sensor PTP lock offset from "
<< static_cast<int>(sensor_ptp_lock_threshold) << " to "
<< static_cast<int>(sensor_configuration_->ptp_lock_threshold));
set_ptp_lock_offset(sensor_configuration_->ptp_lock_threshold);

Check warning on line 1087 in nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp#L1087

Added line #L1087 was not covered by tests
}
}

std::this_thread::sleep_for(wait_time);
Expand Down

0 comments on commit d3c6bf4

Please sign in to comment.