Skip to content

[Feature]: history_length support for ContactForceSensor #2646

@jsw7460

Description

@jsw7460

What feature or enhancement are you proposing?

When using decimation > 1 (i.e. multiple physics steps per control step), ContactForceSensor currently returns only the instantaneous force from the final physics step of each control interval. Transient contacts that occur during earlier physics steps within the same control interval are silently dropped. A history_length parameter that accumulates per-physics-step force snapshots across a control interval — analogous to mjlab's ContactSensorCfg.history_length — would make it possible to reliably detect these transient events.

Motivation

In RL with decimation > 1, I want to access per-physics-step contact force history, because transient self-collisions that occur mid-interval are silently dropped by the current instantaneous readout.

Potential Benefit

Reliable reward function implementation for RL

What is the expected outcome of the implementation work?

A history_length parameter on ContactForceSensor that returns accumulated contact forces for each physics step within a control interval, with shape (num_envs, num_links, history_length, 3).

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions