From 3473fa1e1d0daad804201416d07107f60ed0f41e Mon Sep 17 00:00:00 2001 From: marvin-oh <62216628+marvin-oh@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:31:54 +0900 Subject: [PATCH] Fix: missing gravity term in set_trajectory() function --- sciencebirdsagents/Utils/trajectory_planner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sciencebirdsagents/Utils/trajectory_planner.py b/sciencebirdsagents/Utils/trajectory_planner.py index e4201f9..5f2dae9 100644 --- a/sciencebirdsagents/Utils/trajectory_planner.py +++ b/sciencebirdsagents/Utils/trajectory_planner.py @@ -152,10 +152,13 @@ def set_trajectory(self, sling, release_point): # find the launch angle self._theta = atan2(self._release.Y - self._ref.Y, self._ref.X - self._release.X) + # gravity + g = 0.48 * 9.81 / self.scale_factor + # work out initial velocities and coefficients of the parabola self._ux = self._velocity * cos(self._theta) self._uy = self._velocity * sin(self._theta) - self._a = -0.5 / (self._ux * self._ux) + self._a = -0.5 / (self._ux * self._ux) * g self._b = self._uy / self._ux # work out points of the trajectory