gs.options.RigidOptions#
gs.options.RigidOptions 提供了刚体仿真器的配置选项。
- class genesis.options.solvers.RigidOptions(*, dt: float | None = None, gravity: tuple | None = None, enable_collision: bool = True, enable_joint_limit: bool = True, enable_self_collision: bool = False, max_collision_pairs: int = 100, integrator: integrator = integrator.approximate_implicitfast, IK_max_targets: int = 6, constraint_solver: constraint_solver = constraint_solver.CG, iterations: int = 100, tolerance: float = 1e-05, ls_iterations: int = 50, ls_tolerance: float = 0.01, sparse_solve: bool = False, contact_resolve_time: float | None = None, use_contact_island: bool = False, use_hibernation: bool = False, hibernation_thresh_vel: float = 0.001, hibernation_thresh_acc: float = 0.01)[源代码]#
Options configuring the RigidSolver.
- 参数:
dt (float, optional) – Time duration for each simulation step in seconds. If none, it will inherit from SimOptions. Defaults to None.
gravity (tuple, optional) – Gravity force in N/kg. If none, it will inherit from SimOptions. Defaults to None.
enable_collision (bool, optional) – Whether to enable collision detection. Defaults to True.
enable_joint_limit (bool, optional) – Whether to enable joint limit. Defaults to True.
enable_self_collision (bool, optional) – Whether to enable self collision within each entity. Defaults to False.
max_collision_pairs (int, optional) – Maximum number of collision pairs. Defaults to 100.
integrator (gs.integrator, optional) – Integrator type. Current supported integrators are ‘gs.integrator.Euler’, ‘gs.integrator.implicitfast’ and ‘gs.integrator.approximate_implicitfast’. Defaults to ‘approximate_implicitfast’.
IK_max_targets (int, optional) – Maximum number of IK targets. Increasing this doesn’t affect IK solving speed, but will increase memory usage. Defaults to 6.
constraint_solver (gs.constraint_solver, optional) – Constraint solver type. Current supported constraint solvers are ‘gs.constraint_solver.CG’ (conjugate gradient) and ‘gs.constraint_solver.Newton’ (Newton’s method). Defaults to ‘CG’.
iterations (int, optional) – Number of iterations for the constraint solver. Defaults to 100.
tolerance (float, optional) – Tolerance for the constraint solver. Defaults to 1e-5.
ls_iterations (int, optional) – Number of line search iterations for the constraint solver. Defaults to 50.
ls_tolerance (float, optional) – Tolerance for the line search. Defaults to 1e-2.
sparse_solve (bool, optional) – Whether to exploit sparsity in the constraint system. Defaults to False.
contact_resolve_time (float, optional) – Time to resolve a contact. The smaller the value, the more stiff the constraint. Defaults to 0.02. (called timeconst in https://mujoco.readthedocs.io/en/latest/modeling.html#solver-parameters)
use_contact_island (bool, optional) – Whether to use contact island to speed up contact resolving. Defaults to False.
use_hibernation (bool, optional) – Whether to enable hibernation. Defaults to False.
hibernation_thresh_vel (float, optional) – Velocity threshold for hibernation. Defaults to 1e-3.
hibernation_thresh_acc (float, optional) – Acceleration threshold for hibernation. Defaults to 1e-2.
警告
Hibernation hasn’t been robustly tested and will be fully supported soon.