novaphy.solvers.VBDConfig¶
Configuration object consumed by novaphy.solvers.SolverVBD.
Attributes¶
| Attribute | Description |
|---|---|
dt |
Fixed-step time step. |
gravity |
Gravity vector. |
iterations |
Inner VBD / AVBD iteration count. |
max_contacts_per_pair |
Contact cap per shape/body pair. |
alpha, gamma |
AVBD solver parameters. |
beta_linear, beta_angular |
Penalty growth for contact and joint constraints. |
initial_penalty |
Initial augmented penalty value. |
velocity_smoothing |
Velocity smoothing factor. |
primal_relaxation |
Primal relaxation factor. |
lhs_regularization |
Regularization applied to the left-hand side solve. |
backend |
VbdBackend, CPU or CUDA. |
Example¶
import novaphy
cfg = novaphy.solvers.VBDConfig()
cfg.dt = 1.0 / 60.0
cfg.iterations = 4
solver = novaphy.solvers.SolverVBD(model, cfg)
state = model.state()
control = model.control()
pipeline = novaphy.CollisionPipeline(model)
contacts = pipeline.contacts()
for _ in range(120):
pipeline.collide(state, contacts)
solver.step(state, state, control, contacts, cfg.dt)