From 328c3d37888e4b2c38e979d4dc8195aade60c979 Mon Sep 17 00:00:00 2001 From: AnaLys <76274066+ana-lys@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:22:56 +0700 Subject: [PATCH] Update drag function BaseAviary.py --- gym_pybullet_drones/envs/BaseAviary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gym_pybullet_drones/envs/BaseAviary.py b/gym_pybullet_drones/envs/BaseAviary.py index d08dbbe27..4cb661250 100755 --- a/gym_pybullet_drones/envs/BaseAviary.py +++ b/gym_pybullet_drones/envs/BaseAviary.py @@ -773,7 +773,7 @@ def _drag(self, base_rot = np.array(p.getMatrixFromQuaternion(self.quat[nth_drone, :])).reshape(3, 3) #### Simple draft model applied to the base/center of mass # drag_factors = -1 * self.DRAG_COEFF * np.sum(np.array(2*np.pi*rpm/60)) - drag = np.dot(base_rot, drag_factors*np.array(self.vel[nth_drone, :])) + drag = np.dot(base_rot.T, drag_factors*np.array(self.vel[nth_drone, :])) p.applyExternalForce(self.DRONE_IDS[nth_drone], 4, forceObj=drag,