diff --git a/crazyflow/sim/sim.py b/crazyflow/sim/sim.py index 005c6ac..c868734 100644 --- a/crazyflow/sim/sim.py +++ b/crazyflow/sim/sim.py @@ -61,6 +61,7 @@ def __init__( self.n_worlds = n_worlds self.n_drones = n_drones self.freq = freq + self.max_visual_geom = 1000 # Initialize MuJoCo world and data self._xml_path = xml_path or self.default_path @@ -302,7 +303,7 @@ def thrust_control(self, cmd: Array): def render(self): if self.viewer is None: patch_viewer() - self.viewer = MujocoRenderer(self.mj_model, self.mj_data, max_geom=1000) + self.viewer = MujocoRenderer(self.mj_model, self.mj_data, max_geom=self.max_visual_geom) self.mj_data.qpos[:] = self.data.mjx_data.qpos[0, :] self.mj_data.mocap_pos[:] = self.data.mjx_data.mocap_pos[0, :] self.mj_data.mocap_quat[:] = self.data.mjx_data.mocap_quat[0, :] diff --git a/crazyflow/utils.py b/crazyflow/utils.py index a2784a3..e509a5a 100644 --- a/crazyflow/utils.py +++ b/crazyflow/utils.py @@ -78,6 +78,9 @@ def patch_viewer(): the rendering pipeline between `mjv_updateScene`, which deletes all previous markers, and `mjr_render`, so if we want to add markers to the scene, we need to do it here. The patch ensures that markers are added correctly to the scene. + + If you want to add more markers than the default limit, you can increase the `max_visual_geom` + parameter in the `Sim` class. """ def _add_marker_to_scene(self: BaseRender, marker: dict):