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 = True, enable_adjacent_collision: bool = False, disable_constraint: bool = False, max_collision_pairs: int = 300, integrator: ~genesis.constants.integrator = <gs.integrator.approximate_implicitfast: 2>, IK_max_targets: int = 6, batch_links_info: bool | None = False, batch_joints_info: bool | None = False, batch_dofs_info: bool | None = False, constraint_solver: ~genesis.constants.constraint_solver = <gs.constraint_solver.Newton: 1>, iterations: int = 50, tolerance: float = 1e-08, ls_iterations: int = 50, ls_tolerance: float = 0.01, noslip_iterations: int = 0, noslip_tolerance: float = 1e-06, sparse_solve: bool = False, contact_resolve_time: float | None = None, constraint_timeconst: float = 0.01, use_contact_island: bool = False, box_box_detection: bool | None = None, use_hibernation: bool = False, hibernation_thresh_vel: float = 0.001, hibernation_thresh_acc: float = 0.01, max_dynamic_constraints: int = 8, enable_multi_contact: bool = True, enable_mujoco_compatibility: bool = False, use_gjk_collision: bool = True)[source]#

Options configuring the RigidSolver.

Parameters:
  • 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 True.

  • enable_adjacent_collision (bool, optional) – Whether to enable collision between successive parent-child body pairs within each entity. Defaults to False.

  • disable_constraint (bool, optional) – Whether to disable all constraints. 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’. ‘Euler’ and ‘implicitfast’ are consistent with their Mujoco counterpart. ‘approximate_implicitfast’ is an even faster approximation of ‘implicitfast’, which avoid computing the inverse mass matrix twice by considering the first order correction terms of the implicit integration scheme systematically, including for computing the acceleration resulting from the constraints and external forces. Although this approximation is wrong in theory, it works resonably well in practice. 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 ‘Newton’.

  • iterations (int, optional) – Number of iterations for the constraint solver. Defaults to 50.

  • tolerance (float, optional) – Tolerance for the constraint solver. Defaults to 1e-8.

  • 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.

  • noslip_iterations (int, optional) – Number of iterations for the noslip solver. Defaults to 0 (disabled). noslip is a post-processing step after the main solver to suppress slip/drift. Recommended to set this value to 5 for manipulation tasks or when slip/drift is a big problem. This option should only be enabled if necessary because it is experimental and will slow down the simulation.

  • noslip_tolerance (float, optional) – Tolerance for the noslip solver. Defaults to 1e-6.

  • sparse_solve (bool, optional) – Whether to exploit sparsity in the constraint system. Defaults to False.

  • contact_resolve_time (float, optional) – Please note that this option will be deprecated in a future version. Use ‘constraint_timeconst’ instead.

  • constraint_timeconst (float) – Lower-bound of the default time to resolve the constraint (2*dt). The smaller the value, the more stiff the constraint. This parameter is called ‘timeconst’ in Mujoco (https://mujoco.readthedocs.io/en/latest/modeling.html#solver-parameters). Defaults to 0.01.

  • 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.

  • max_dynamic_constraints (int, optional) – Maximum number of dynamic constraints (like suction cup). Defaults to 8.

  • use_gjk_collision (bool, optional) – Whether to use GJK for collision detection instead of MPR. Defaults to True.

Warning

Hibernation hasn’t been robustly tested and will be fully supported soon.