sim.solver_sap.SolverSAP#
- class sim.solver_sap.SolverSAP(model: SapModel, *, max_rigid_contact: int = 128, fallback_mu: float | None = None, fallback_stiffness: float = 10000000000.0, contact_beta: float = 1.0, contact_sigma: float = 0.001, contact_tau_d: float | None = None, block_size: int | None = None, diag_shift: float = 0.0, max_iterations: int = 100, optimality_abs_tol: float = 1e-14, optimality_rel_tol: float = 1e-06, cost_abs_tol: float | None = None, cost_rel_tol: float | None = None, line_search_max_iterations: int = 40, armijo_c: float = 0.0001, rho: float = 0.8, line_search_relative_slop: float | None = None, line_search_variant: str = 'monotone_decay', contact_preset_variant: str | None = None, contact_weight_mode: str | None = None, contact_point_mode: str | None = None, capture_contact_jacobian_snapshots: bool = False, use_f64_boundary_pose: bool | None = None, free_motion_solve_precision: str | None = None, contact_solve_precision: str | None = None, contact_linear_solve_precision: str | None = None, sap_contact_weight_precision: str | None = None, collect_iteration_stats: bool = False, check_line_search_errors: bool = False, graph_conditional: bool = True, position_integration: str | None = None)[source]#
Bases:
objectSAP-native solver pipeline.
This solver wires together the SAP runtime components:
SapFreeMotion.compute() computes SAP-order free motion.
SapContactJacobian.compute() computes contact Jacobians and env-local dynamics matrices from SAP runtime data.
SapContactSolve.solve() solves the SAP stage2 problem in SAP-order generalized velocities.
SAP-native integration writes state_out.
- __init__(model: SapModel, *, max_rigid_contact: int = 128, fallback_mu: float | None = None, fallback_stiffness: float = 10000000000.0, contact_beta: float = 1.0, contact_sigma: float = 0.001, contact_tau_d: float | None = None, block_size: int | None = None, diag_shift: float = 0.0, max_iterations: int = 100, optimality_abs_tol: float = 1e-14, optimality_rel_tol: float = 1e-06, cost_abs_tol: float | None = None, cost_rel_tol: float | None = None, line_search_max_iterations: int = 40, armijo_c: float = 0.0001, rho: float = 0.8, line_search_relative_slop: float | None = None, line_search_variant: str = 'monotone_decay', contact_preset_variant: str | None = None, contact_weight_mode: str | None = None, contact_point_mode: str | None = None, capture_contact_jacobian_snapshots: bool = False, use_f64_boundary_pose: bool | None = None, free_motion_solve_precision: str | None = None, contact_solve_precision: str | None = None, contact_linear_solve_precision: str | None = None, sap_contact_weight_precision: str | None = None, collect_iteration_stats: bool = False, check_line_search_errors: bool = False, graph_conditional: bool = True, position_integration: str | None = None)[source]#
Methods
__init__(model, *[, max_rigid_contact, ...])close()Release solver-owned resources.
get_max_contact_count()Return the per-environment rigid-contact capacity used by the contact solve.
integrate_particles(model, state_in, ...)Integrate particle state with semi-implicit Euler using the model gravity and timestep.
notify_model_changed(flags)Refresh solver caches and work buffers after the underlying model arrays or topology have changed.
reset_runtime_state([state])Reset timestep counters and cached contact-solve guesses before starting a fresh rollout.
step(state_in, state_out, control, contacts, dt)Advance one SAP timestep from state_in to state_out using control inputs, active contacts, and the configured solver settings.
update_contacts(contacts)Update the solver contact buffer reference and resize dependent contact-stage data when needed.
Attributes
deviceReturn the Warp device used by the solver model and scratch buffers.