From 042e9f907d653324d543915cfe166bf7715ccd09 Mon Sep 17 00:00:00 2001 From: Bartok9 Date: Sat, 25 Jul 2026 05:22:48 -0400 Subject: [PATCH] fix(python): avoid shared empty-list defaults on RotorStates/ProjectionMatrix Class-level `[]` is a mutable default shared by all instances. Use None so local construction cannot cross-contaminate rotors/matrix before RPC fill. Signed-off-by: Bartok9 --- PythonClient/airsim/types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PythonClient/airsim/types.py b/PythonClient/airsim/types.py index 7aef005549..57464f9956 100644 --- a/PythonClient/airsim/types.py +++ b/PythonClient/airsim/types.py @@ -404,10 +404,12 @@ class MultirotorState(MsgpackMixin): class RotorStates(MsgpackMixin): timestamp = np.uint64(0) - rotors = [] + # None avoids a shared mutable class default; RPC fills a list of rotor states. + rotors = None class ProjectionMatrix(MsgpackMixin): - matrix = [] + # None avoids a shared mutable class default; RPC fills nested matrix lists. + matrix = None class CameraInfo(MsgpackMixin): pose = Pose()