novaphy.solvers.SolverNotifyFlags¶
Cache invalidation flags. Pass to solver.notify_model_changed(flags) after
mutating model data that a solver may cache.
| Member | Typical use |
|---|---|
None_ |
No invalidation. |
JointProperties |
Joint topology / type / transform metadata changed. |
JointDofProperties |
Per-DOF limits, drives, armature, damping, friction, or effort/velocity limits changed. |
BodyProperties |
Body pose / body-level metadata changed. |
BodyInertialProperties |
Body mass, inertia, or center-of-mass data changed. |
ShapeProperties |
Shape geometry, material, flags, or collision filters changed. |
ModelProperties |
Global model properties such as gravity changed. |
ConstraintProperties |
Equality or mimic constraint parameters changed. |
TendonProperties |
MuJoCo tendon parameters changed. |
ActuatorProperties |
MuJoCo actuator gains, biases, limits, or gear changed. |
All |
Rebuild all solver caches. |
The bound enum does not implement Python's | operator directly. To combine
members, OR their integer values and construct a SolverNotifyFlags from the
result before calling notify_model_changed.
Example¶
import numpy as np
import novaphy
model.set_gravity(np.array([0, 0, 0], dtype=np.float32), world=0)
solver.notify_model_changed(novaphy.solvers.SolverNotifyFlags.ModelProperties)
F = novaphy.solvers.SolverNotifyFlags
combined = F(int(F.ModelProperties) | int(F.ShapeProperties))
solver.notify_model_changed(combined)