Skip to content

Commit d38bb5c

Browse files
committed
Add max_visual_geom parameter
1 parent 60c4c04 commit d38bb5c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crazyflow/sim/sim.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def __init__(
6161
self.n_worlds = n_worlds
6262
self.n_drones = n_drones
6363
self.freq = freq
64+
self.max_visual_geom = 1000
6465

6566
# Initialize MuJoCo world and data
6667
self._xml_path = xml_path or self.default_path
@@ -302,7 +303,7 @@ def thrust_control(self, cmd: Array):
302303
def render(self):
303304
if self.viewer is None:
304305
patch_viewer()
305-
self.viewer = MujocoRenderer(self.mj_model, self.mj_data, max_geom=1000)
306+
self.viewer = MujocoRenderer(self.mj_model, self.mj_data, max_geom=self.max_visual_geom)
306307
self.mj_data.qpos[:] = self.data.mjx_data.qpos[0, :]
307308
self.mj_data.mocap_pos[:] = self.data.mjx_data.mocap_pos[0, :]
308309
self.mj_data.mocap_quat[:] = self.data.mjx_data.mocap_quat[0, :]

crazyflow/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def patch_viewer():
7878
the rendering pipeline between `mjv_updateScene`, which deletes all previous markers, and
7979
`mjr_render`, so if we want to add markers to the scene, we need to do it here. The patch
8080
ensures that markers are added correctly to the scene.
81+
82+
If you want to add more markers than the default limit, you can increase the `max_visual_geom`
83+
parameter in the `Sim` class.
8184
"""
8285

8386
def _add_marker_to_scene(self: BaseRender, marker: dict):

0 commit comments

Comments
 (0)