Skip to content

Commit 8ecdd6b

Browse files
committed
Improve render example with constants
1 parent 2d0f4af commit 8ecdd6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/render.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from numpy.typing import NDArray
88
from scipy.spatial.transform import Rotation as R
99

10+
from crazyflow.constants import GRAVITY, MASS
1011
from crazyflow.sim import Physics, Sim
1112

1213

@@ -15,7 +16,8 @@ def main():
1516
n_worlds, n_drones = 1, 25
1617
sim = Sim(n_worlds=n_worlds, n_drones=n_drones, physics=Physics.sys_id, device="cpu")
1718
fps = 60
18-
cmd = np.array([[[0.3, 0, 0, 0] for _ in range(sim.n_drones)]])
19+
cmd = np.zeros((sim.n_worlds, sim.n_drones, 4))
20+
cmd[..., 0] = MASS * GRAVITY * 1.2
1921

2022
pos = deque(maxlen=16)
2123
rot = deque(maxlen=15)

0 commit comments

Comments
 (0)