File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
from threading import Lock
2
2
from mujoco_py.generated import const
3
3
4
+
4
5
cdef class MjRenderContext(object ):
5
6
"""
6
7
Class that encapsulates rendering functionality for a
@@ -35,6 +36,7 @@ cdef class MjRenderContext(object):
35
36
maxgeom = 1000
36
37
mjv_makeScene(self ._model_ptr, & self ._scn, maxgeom)
37
38
mjv_defaultCamera(& self ._cam)
39
+ mjv_defaultPerturb(& self ._pert)
38
40
mjv_defaultOption(& self ._vopt)
39
41
mjr_defaultContext(& self ._con)
40
42
@@ -55,8 +57,11 @@ cdef class MjRenderContext(object):
55
57
self .cam = WrapMjvCamera(& self ._cam)
56
58
self .vopt = WrapMjvOption(& self ._vopt)
57
59
self .con = WrapMjrContext(& self ._con)
60
+
58
61
self ._pert.active = 0
59
62
self ._pert.select = 0
63
+ self ._pert.skinselect = - 1
64
+
60
65
self .pert = WrapMjvPerturb(& self ._pert)
61
66
62
67
self ._markers = []
Original file line number Diff line number Diff line change @@ -105,6 +105,13 @@ cdef class MjSim(object):
105
105
with wrap_mujoco_warning():
106
106
mj_forward(self .model.ptr, self .data.ptr)
107
107
108
+ def set_constants (self ):
109
+ """
110
+ Set constant fields of mjModel, corresponding to qpos0 configuration.
111
+ """
112
+ with wrap_mujoco_warning():
113
+ mj_setConst(self .model.ptr, self .data.ptr)
114
+
108
115
def step (self , with_udd = True ):
109
116
"""
110
117
Advances the simulation by calling ``mj_step``.
You can’t perform that action at this time.
0 commit comments