Skip to content

Commit

Permalink
chore(hesai): enable PTP lock threshold setting for XT series sensors (
Browse files Browse the repository at this point in the history
…#265)

Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex authored Feb 18, 2025
1 parent 8efeaf0 commit ad0e988
Showing 1 changed file with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1080,17 +1080,24 @@ HesaiStatus HesaiHwInterface::check_and_set_config(
t.join();
logger_->debug("Thread finished");

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<int>(sensor_ptp_lock_threshold) << " to "
<< static_cast<int>(sensor_configuration_->ptp_lock_threshold));
set_ptp_lock_offset(sensor_configuration_->ptp_lock_threshold);
switch (sensor_configuration_->sensor_model) {
case SensorModel::HESAI_PANDAR128_E4X:
case SensorModel::HESAI_PANDARQT128:
case SensorModel::HESAI_PANDARXT16:
case SensorModel::HESAI_PANDARXT32:
case SensorModel::HESAI_PANDARXT32M: {
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);
}
break;
}
default:
break;
}

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

0 comments on commit ad0e988

Please sign in to comment.