From 93f6bcfb04ac0450f0d6a7061417002623f83a62 Mon Sep 17 00:00:00 2001 From: spencerfolk Date: Sun, 16 Aug 2026 21:02:14 -0400 Subject: [PATCH 1/3] Fixed tuning for CF. --- examples/basic_usage.py | 2 +- rotorpy/controllers/quadrotor_control.py | 4 ++-- rotorpy/vehicles/crazyflie_params.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/basic_usage.py b/examples/basic_usage.py index 6663442..244c8a4 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -60,7 +60,7 @@ # An instance of the simulator can be generated as follows: sim_instance = Environment(vehicle=Multirotor(quad_params), # vehicle object, must be specified. controller=SE3Control(quad_params), # controller object, must be specified. - trajectory=TwoDLissajous(), # trajectory object, must be specified. + trajectory=ThreeDCircularTraj(radius=np.array([3, 3, 0]), freq=np.array([0.15, 0.15, 0])), # trajectory object, must be specified. wind_profile=SinusoidWind(), # OPTIONAL: wind profile object, if none is supplied it will choose no wind. sim_rate = 100, # OPTIONAL: The update frequency of the simulator in Hz. Default is 100 Hz. imu = None, # OPTIONAL: imu sensor object, if none is supplied it will choose a default IMU sensor. diff --git a/rotorpy/controllers/quadrotor_control.py b/rotorpy/controllers/quadrotor_control.py index e203485..6250b5b 100644 --- a/rotorpy/controllers/quadrotor_control.py +++ b/rotorpy/controllers/quadrotor_control.py @@ -55,8 +55,8 @@ def __init__(self, quad_params): # Gains self.kp_pos = np.array([6.5,6.5,15]) self.kd_pos = np.array([4.0, 4.0, 9]) - self.kp_att = 544 - self.kd_att = 46.64 + self.kp_att = quad_params.get("kp_att", 310) + self.kd_att = quad_params.get("kd_att", 57.0) self.kp_vel = 0.1*self.kp_pos # P gain for velocity controller (only used when the control abstraction is cmd_vel) # Linear map from individual rotor forces to scalar thrust and vector diff --git a/rotorpy/vehicles/crazyflie_params.py b/rotorpy/vehicles/crazyflie_params.py index 0d345b8..cf57f41 100644 --- a/rotorpy/vehicles/crazyflie_params.py +++ b/rotorpy/vehicles/crazyflie_params.py @@ -58,10 +58,10 @@ 'rotor_speed_max': 2500, # rad/s 'motor_noise_std': 0.0, # rad/s - # Lower level controller properties (for higher level control abstractions) - 'k_w': 1, # The body rate P gain (for cmd_ctbr) + # Lower level controller properties + 'k_w': 200, # The body rate P gain (for cmd_ctbr) 'k_v': 10, # The *world* velocity P gain (for cmd_vel) - 'kp_att': 1030, # The attitude P gain (for cmd_vel, cmd_acc, and cmd_ctatt) - 'kd_att': 51, # The attitude D gain (for cmd_vel, cmd_acc, and cmd_ctatt) + 'kp_att': 310, # The attitude P gain (for cmd_vel, cmd_acc, and cmd_ctatt) + 'kd_att': 57.0, # The attitude D gain (for cmd_vel, cmd_acc, and cmd_ctatt) } \ No newline at end of file From aeead3168caf2c3bb30a20081c36949611daecbc Mon Sep 17 00:00:00 2001 From: spencerfolk Date: Mon, 17 Aug 2026 23:32:24 -0400 Subject: [PATCH 2/3] Bump version to 2.1.3 for hotfix. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2120c69..1aada32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rotorpy" -version = "2.1.2" +version = "2.1.3" description = "A multirotor simulator with aerodynamics for education and research." readme = "README.md" requires-python = ">=3.8" From 8c61b34b17bb2167884c97004db967a3c7f1153f Mon Sep 17 00:00:00 2001 From: spencerfolk Date: Sun, 23 Aug 2026 15:12:27 -0400 Subject: [PATCH 3/3] Patched BatchedSE3Control with gain tuning fix. --- rotorpy/controllers/quadrotor_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rotorpy/controllers/quadrotor_control.py b/rotorpy/controllers/quadrotor_control.py index 6250b5b..d4d0816 100644 --- a/rotorpy/controllers/quadrotor_control.py +++ b/rotorpy/controllers/quadrotor_control.py @@ -204,13 +204,13 @@ def __init__(self, batch_params, num_drones, device, kp_pos=None, kd_pos=None, k else: self.kd_pos = kd_pos.to(self.device).double() if kp_att is None: - self.kp_att = torch.tensor([544], device=device).repeat(num_drones, 1).double() + self.kp_att = batch_params.kp_att.to(self.device).double() else: self.kp_att = kp_att.to(self.device).double() if len(self.kp_att.shape) < 2: self.kp_att = self.kp_att.unsqueeze(-1) if kd_att is None: - self.kd_att = torch.tensor([46.64], device=device).repeat(num_drones, 1).double() + self.kd_att = batch_params.kd_att.to(self.device).double() else: self.kd_att = kd_att.to(self.device).double() if len(self.kd_att.shape) < 2: