From 56e00f2cc5a59e79791e17660ac3e8014e03062d Mon Sep 17 00:00:00 2001 From: emanuel Date: Thu, 13 Oct 2022 18:05:57 +0100 Subject: [PATCH] TPM: check OBU heading vs TPI angle --- src/tpm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tpm.c b/src/tpm.c index a782ede..b5494a3 100644 --- a/src/tpm.c +++ b/src/tpm.c @@ -33,9 +33,13 @@ int tpm_is_inside_zone(tolling_info_t* ti) { itss_space_unlock(); if (itss_is_inside_polygon(point, ti->zone.polygon, ti->zone.polygon_len)) { - return 1; + uint16_t da = abs((int16_t)heading - (int16_t)ti->asn->angle); + if (da <= 900 || da >= 2700) { + return 1; + } } + return 0; }