Skip to content

Commit c2f8ca9

Browse files
committed
Fix outdated physics modes
1 parent 285560e commit c2f8ca9

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ The simulation is built as a pipeline of functions that are composed at initiali
3030

3131
#### Physics Backends
3232
Multiple physics models are supported:
33-
- analytical: A first-principles model based on physical equations
34-
- sys_id: A system-identified model trained on real drone data
33+
- first_principles: A first-principles model based on physical equations
34+
- so_rpy: A system-identified model trained on real drone data
35+
- so_rpy_rotor: An enhanced system-identified model that includes thrust dynamics
36+
- so_rpy_rotor_drag: A system-identified model that includes thrust dynamics and drag effects
3537

3638
#### Control Modes
3739
Different control interfaces are available:

benchmark/op_count.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
def main():
66
"""Main entry point for profiling."""
7-
sim = Sim(n_worlds=1, n_drones=1, physics="analytical", control="attitude")
7+
sim = Sim(n_worlds=1, n_drones=1, physics="first_principles", control="attitude")
88

99
compiled_reset = sim._reset.lower(sim.data, sim.default_data, None).compile()
1010
compiled_step = sim._step.lower(sim.data, 1).compile()

benchmark/performance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def main():
7777
sim_config = config_dict.ConfigDict()
7878
sim_config.n_worlds = 1
7979
sim_config.n_drones = 1
80-
sim_config.physics = "analytical"
80+
sim_config.physics = "first_principles"
8181
sim_config.control = "attitude"
8282
sim_config.device = device
8383

crazyflow/randomize/randomize.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ def randomize_mass(sim: Sim, mass: Array, mask: Array | None = None):
1515
mass: The new masses. The shape always needs to be (n_worlds, n_drones).
1616
mask: Boolean array of shape (n_worlds, ) that indicates which worlds to reset. If None,
1717
all worlds are reset.
18-
19-
Warning:
20-
This currently only works for analytical dynamics.
2118
"""
2219
sim.data = _randomize_mass_params(sim.data, mass, mask)
2320

@@ -32,7 +29,7 @@ def randomize_inertia(sim: Sim, J: Array, mask: Array | None = None):
3229
all worlds are reset.
3330
3431
Warning:
35-
This currently only works for analytical dynamics.
32+
This only works for first_principles dynamics.
3633
"""
3734
if not J.shape == (sim.n_worlds, sim.n_drones, 3, 3):
3835
raise ValueError(f"Inertia tensor must have shape (n_worlds, n_drones, 3, 3), is {J.shape}")

examples/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def main():
1212
sim = Sim(n_worlds=n_worlds, n_drones=n_drones, physics=Physics.so_rpy, device="cpu")
1313
fps = 60
1414
cmd = np.zeros((sim.n_worlds, sim.n_drones, 4))
15-
cmd[..., 3] = sim.data.params.mass[0, 0, 0] * 9.81 * 0.5
15+
cmd[..., 3] = sim.data.params.mass[0, 0, 0] * 9.81
1616
rgbas = np.random.default_rng(0).uniform(0, 1, (n_drones, 4))
1717
rgbas[..., 3] = 1.0
1818

0 commit comments

Comments
 (0)