修改避障日志

This commit is contained in:
lidg
2026-11-12 14:39:30 +08:00
parent 2226bf9b85
commit b5969dee83
4 changed files with 26 additions and 6 deletions
+3 -1
View File
@@ -247,7 +247,9 @@ void VisionService::finishAvoidance(int code, const QJsonObject &result)
if (!m_avoidanceDiscarded && m_avoidanceEnabled && !m_shuttingDown && !m_releasing) {
const double distance = result.value("distance_mm").toDouble();
const bool warning = distance < m_config.warningDistanceMm;
if (code != HVG_OK) {
if (code == HVG_DISTANCE_UNKNOWN) {
m_avoidanceLogKey.clear();
} else if (code != HVG_OK) {
logAvoidance("ERROR", QString("避障检测失败(code=%1):%2")
.arg(code).arg(result.value("message").toString()));
if (code == HVG_NOT_READY || code == HVG_DEVICE_ERROR || code == HVG_CONFIG_ERROR)