@@ -66,7 +66,9 @@ def __init__(
66
66
Args:
67
67
num_envs: The number of environments to run in parallel.
68
68
time_horizon_in_seconds: The time horizon after which episodes are truncated.
69
- **kwargs: Takes arguments that are passed to the Crazyfly simulation.
69
+ physics: The crazyflow physics simulation model.
70
+ freq: The frequency at which the environment is run.
71
+ device: The device of the environment and the simulation.
70
72
"""
71
73
self .num_envs = num_envs
72
74
self .device = jax .devices (device )[0 ]
@@ -530,21 +532,3 @@ def actions(self, actions: Array) -> Array:
530
532
# Ensure actions are within the valid range of the simulation action space
531
533
rescaled_actions = np .clip (rescaled_actions , self .action_sim_low , self .action_sim_high )
532
534
return rescaled_actions
533
-
534
-
535
- def render_trajectory (viewer : MujocoRenderer | None , pos : Array ) -> None :
536
- """Render trajectory."""
537
- if viewer is None :
538
- return
539
-
540
- pos = np .array (pos [0 ]).transpose (1 , 0 , 2 )
541
- n_trace , n_drones = len (pos ) - 1 , len (pos [0 ])
542
-
543
- for i in range (n_trace ):
544
- for j in range (n_drones ):
545
- viewer .viewer .add_marker (
546
- type = mujoco .mjtGeom .mjGEOM_SPHERE ,
547
- size = np .array ([0.02 , 0.02 , 0.02 ]),
548
- pos = pos [i ][j ],
549
- rgba = np .array ([1 , 0 , 0 , 0.8 ]),
550
- )
0 commit comments