Skip to main content

Ant

superdex_gym/Ant-v0 · superdex.lab.gym.envs.benchmarks.ant_env.AntEnv

Ant

Description​

Ant provides quadrupedal locomotion. The reward favors forward progress and penalizes control effort and contact-wrench magnitude.

Action Space​

The action is an (8,) Box. The element control is bounded [-1.0, 1.0] and applied as external forces on DOFs 6-13 with a force scale of 150.

Observation Space​

The observation is an (81,) Box with the default configuration, flattened in alphabetical key order:

KeyShapeMeaning
contact_forces54Six contact-wrench components for each of 9 bodies. Omitted when include_contact_in_observation=False
pose13num_dofs (14) - 2 excluded positions, +1 for the quaternion representation
vel14One per DOF

Turning off exclude_current_positions_from_observation adds 2, turning off include_contact_in_observation removes 54, and setting use_rotation_vector=True removes 1.

Rewards​

The scalar reward is the sum of four terms:

TermValue
forwardx_velocity * forward_reward_weight
ctrl-control_cost_weight * dot(control, control)
contact-contact_cost_weight * squared norm of the clipped contact wrench
survivehealthy_reward while healthy, else 0

Starting State​

The scene is restored to its captured initial state, then uniform reset noise scaled by reset_noise_scale (default 0.1) is added to the pose and velocity.

Episode End​

The episode terminates (terminated_reason = "Unhealthy") when the torso height leaves healthy_y_range, unless terminate_when_unhealthy=False. It truncates at steps_per_episode.

Arguments​

In addition to the shared MochiEnvCfg fields (see the Authoring guide's base configuration section), AntEnvCfg accepts:

FieldDefaultMeaning
control_frequency20Control frequency [Hz]
simulation_frequency100Simulation frequency [Hz]; 5 substeps per control step
steps_per_episode1000Truncation limit
reset_noise_scale0.1Scale of the uniform reset noise
forward_reward_weight1Weight of the forward-progress term
control_cost_weight0.5Weight of the control-cost penalty
contact_cost_weight5e-4Weight of the contact-cost penalty
healthy_reward1.0Per-step bonus while healthy
terminate_when_unhealthyTrueTerminate when the torso leaves the healthy range
healthy_y_range(0.2, 1.0)Torso height band [m]
contact_force_range(-1.0, 1.0)Per-component clip range for each body's contact wrench
exclude_current_positions_from_observationTrueOmit x and z, keeping policies translation-invariant
include_contact_in_observationTrueInclude the contact-wrench observation
use_rotation_vectorFalseRepresent rotations with a rotation vector

Scene identity​

uid_fields = (use_damping, use_gravity, use_low_friction, use_high_friction).

Variants​

AntFullObservation​

superdex_gym/AntFullObservation-v0

FieldValue
exclude_current_positions_from_observationFalse

AntNoContact​

superdex_gym/AntNoContact-v0

FieldValue
include_contact_in_observationFalse

AntRotationVector​

superdex_gym/AntRotationVector-v0

FieldValue
use_rotation_vectorTrue