Skip to content

Commit f5399b8

Browse files
Merge pull request #199 from MenesesPT/main
Fix zone target count when a zone intercepts 0,0
2 parents 51477ea + 94ae0aa commit f5399b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/ld2450-base.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ uart:
710710
int zone4_begin_y_value = id(zone4_begin_y).state;
711711
int zone4_end_y_value = id(zone4_end_y).state;
712712
713-
if (p1_distance < max_distance) {
713+
if (p1_distance > 0 && p1_distance <= max_distance) {
714714
if(installation_angle != 0){
715715
p1_x = p1_distance * cos((p1_angle - installation_angle)/RADIANS_TO_DEGREES);
716716
p1_y = p1_distance * sin((p1_angle - installation_angle)/RADIANS_TO_DEGREES);
@@ -779,7 +779,7 @@ uart:
779779
}
780780
}
781781
782-
if (p2_distance < max_distance) {
782+
if (p2_distance > 0 && p2_distance <= max_distance) {
783783
if(installation_angle != 0){
784784
p2_x = p2_distance * cos((p2_angle - installation_angle)/RADIANS_TO_DEGREES);
785785
p2_y = p2_distance * sin((p2_angle - installation_angle)/RADIANS_TO_DEGREES);
@@ -848,7 +848,7 @@ uart:
848848
}
849849
}
850850
851-
if (p3_distance < max_distance) {
851+
if (p3_distance > 0 && p3_distance <= max_distance) {
852852
if(installation_angle != 0){
853853
p3_x = p3_distance * cos((p3_angle - installation_angle)/RADIANS_TO_DEGREES);
854854
p3_y = p3_distance * sin((p3_angle - installation_angle)/RADIANS_TO_DEGREES);

0 commit comments

Comments
 (0)