diff --git a/web/pose_3d.js b/web/pose_3d.js index b8f2d51..06f8d0e 100644 --- a/web/pose_3d.js +++ b/web/pose_3d.js @@ -229,7 +229,6 @@ const state = { }, front_tags: { // overlay tag visibili dalla camera D435i frontale group: null, // THREE.Group child del d435 parent (cloud-like transform) - in_flight: false, // evita richieste sovrapposte se il fetch supera il poll }, }; @@ -796,12 +795,9 @@ async function pollState() { // soft fail: log + segna lo stato console.warn('pose_3d /state fail:', e.message); } - // Front-camera tag overlay: piggyback sul ciclo poll dello state, no - // timer separato. Se il flag e' on aggiorniamo il rendering ad ogni tick. - if ($('p3ShowFrontTags')?.checked && !state.front_tags.in_flight) { - state.front_tags.in_flight = true; - pollFrontTags().finally(() => { state.front_tags.in_flight = false; }); - } + // NB: il front-tag overlay NON viene aggiornato qui. La detection ArUco + // gira solo al cambio dell'immagine (pulsante Acquisisci -> acquireClouds) + // e al toggle on del flag, non ad ogni tick del poll dello state. } function refreshPoseSelect() { @@ -1769,6 +1765,9 @@ async function acquireClouds() { // Memorizza i parametri usati in questa acquisizione (best-effort, // non blocca il rendering del cloud se il save fallisce). saveCloudParamsToConfig(); + // Nuova immagine acquisita: se l'overlay tag e' attivo ri-esegui la + // detection una volta sola, sul frame appena acquisito. + if ($('p3ShowFrontTags')?.checked) pollFrontTags(); } catch (e) { $('p3CloudStatus').textContent = `errore: ${e.message}`; $('p3CloudStatus').style.color = 'var(--danger)';