Skip to content

Commit

Permalink
feat(hesai): set PTP lock offset on configure, for all sensors except…
Browse files Browse the repository at this point in the history
… AT128

Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex committed Nov 27, 2024
1 parent c9e5590 commit c353192
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "nebula_common/hesai/hesai_common.hpp"
#include "nebula_common/hesai/hesai_status.hpp"
#include "nebula_common/loggers/logger.hpp"
#include "nebula_common/nebula_common.hpp"
#include "nebula_common/nebula_status.hpp"
#include "nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp"
Expand Down Expand Up @@ -1074,6 +1075,15 @@ 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);
}

std::this_thread::sleep_for(wait_time);
} else { // AT128 only supports PTP setup via HTTP
logger_->info("Trying to set SyncAngle via HTTP");
Expand Down

0 comments on commit c353192

Please sign in to comment.