Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/basic_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 4 additions & 4 deletions rotorpy/controllers/quadrotor_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,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
Expand Down Expand Up @@ -207,13 +207,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:
Expand Down
6 changes: 3 additions & 3 deletions rotorpy/vehicles/crazyflie_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
# 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)

}
Loading