Skip to content

Per-contact force on scene objects #219

Description

@jbae49

I'm using ProtoMotions on IsaacLab to train an object-interaction policy and would like to feed per-contact wrench (force + torque, ideally with contact point and normal) on the scene rigid object back into the policy / reward, rather than just a per-link net force.

What I've checked so far:

  • The IsaacLab spawn path in protomotions/simulator/isaaclab/utils/scene.py already creates a ContactSensor for each scene object with filter_prim_paths_expr set to the robot bodies, and protomotions/simulator/isaaclab/simulator.py reads force_matrix_w. That gives one net force per (object body, robot link) pair.
  • Setting track_contact_points=True / track_friction_forces=True on the same ContactSensorCfg exposes contact_pos_w and friction_forces_w, but those buffers are shaped (num_envs, num_bodies, num_filter_shapes, 3) (one representative point and friction vector per (body, filter), not one entry per actual contact). For my use case (multiple contacts on the same box face from one hand) that still aggregates the information I need.
  • The only IsaacLab API I've found that exposes truly per-contact data (point, normal, separation, force) is contact_sensor.contact_physx_view.get_contact_data(dt) on the underlying physx.RigidContactView. This might be more of an IsaacLab question than a ProtoMotions one, but I'd really appreciate any guidance you can share.

Two questions:

  1. Is get_contact_data() considered reliable / stable across IsaacLab + IsaacSim versions for production training? The IsaacLab docstring on contact_physx_view says "Use this view with caution. It requires handling of tensors in a specific way.", which makes me a little nervous about depending on it for every-step reward shaping at 4096 envs.

  2. Is there a recommended ProtoMotions-side pattern for this — e.g. wrapping get_contact_data() in the simulator and surfacing a per-contact wrench tensor on simulator_state? If not, do you consider per-contact data out of scope for ProtoMotions, in which case I should look at a sim with first-class contact arrays (e.g. mjlab)?

For context, the alternative could be moving to mjlab where MuJoCo's contact array seems like first-class, but I'd much rather stay on the ProtoMotions stack if get_contact_data() is solid in practice.

Any pointers, advice, or confirmation would be a huge help. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions