From bd0d9a95f267b362aa20220cbf67668e12ff385b Mon Sep 17 00:00:00 2001 From: Joao Pedro Leal Date: Thu, 7 Mar 2024 18:35:22 -0300 Subject: [PATCH] fix(univector field): make weighted_sum private --- NeonPathPlanning/univector_field.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NeonPathPlanning/univector_field.py b/NeonPathPlanning/univector_field.py index b835c59..332650a 100644 --- a/NeonPathPlanning/univector_field.py +++ b/NeonPathPlanning/univector_field.py @@ -144,7 +144,7 @@ def __check_border(self, p): return False - def weighted_sum(self, ang_guide, *args, wmax=2, wmin=1): + def __weighted_sum(self, ang_guide, *args, wmax=2, wmin=1): """ Calculate the weighted mean between the angle of any number of vectors The weight of each vector is calculated based on the angle of a guide vector @@ -228,7 +228,7 @@ def compute(self, p): # check if the position is close to one of the borders on_border = self.__check_border(p) if on_border: - new_angle = self.weighted_sum(ang_pg, ang_pg, angle_f_p) + new_angle = self.__weighted_sum(ang_pg, ang_pg, angle_f_p) return reduce_angle(new_angle) for pos, margin in self.obstacles.values(): @@ -244,9 +244,9 @@ def compute(self, p): if abs(angle_between(pos, p) - angle_f_p) > math.pi: margin_ang = reduce_angle(margin_ang + math.pi) if ang_bo1: - return reduce_angle(self.weighted_sum(margin_ang, margin_ang, ang_pg, wmax=3)) + return reduce_angle(self.__weighted_sum(margin_ang, margin_ang, ang_pg, wmax=3)) if ang_bo2: - return reduce_angle(self.weighted_sum(margin_ang, ang_pg, margin_ang, wmax=3)) + return reduce_angle(self.__weighted_sum(margin_ang, ang_pg, margin_ang, wmax=3)) return margin_ang # check if the line pg is secant to the obstacle