Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Dm control Mocap Prop

From Leeroopedia
Knowledge Sources
Domains Robotics, Motion Capture
Last Updated 2026-02-15 04:00 GMT

Overview

The Prop class is a Composer entity that constructs physical prop objects (spheres and boxes) from motion capture protobuf definitions for use in locomotion tracking tasks.

Description

The Prop class extends composer.Entity and builds an MJCF model from a prop_proto protobuf message. It creates a geom with the specified shape (sphere or box, mapped from the proto's shape enum), size, and mass. The prop's color is automatically determined by mass, interpolating between a gold color for light props (3 kg) and a red color for heavy props (10 kg) using the _default_prop_rgba helper function.

The class supports optional priority_friction mode, which enables enhanced contact dynamics by setting the geom's priority to 1, condim to 6 (enabling torsional and rolling friction), and computing friction coefficients scaled to the prop's size. Position and orientation are tracked via framepos and framequat MJCF sensors. The companion Observables class exposes these sensors as standard MJCFFeature observables for agent observation.

Props are typically created by Trajectory.create_props() from trajectory protobuf data and managed by reference pose tracking tasks that involve object manipulation alongside locomotion.

Usage

Use the Prop class when working with motion capture tracking tasks that involve physical objects. Props are instantiated from protobuf data via Trajectory.create_props() rather than being constructed directly in most use cases. Enable priority_friction when realistic contact interactions with the prop are important for the task.

Code Reference

Source Location

Signature

class Prop(composer.Entity):
    def _build(self, prop_proto, rgba=None, priority_friction=False):
    def _build_observables(self):
    def mjcf_model(self):  # property
    def update_with_new_prop(self, prop):
    def geom(self):  # property
    def after_compile(self, physics, random_state):
    def body_geom_ids(self):  # property
    def position(self):  # property
    def orientation(self):  # property

class Observables(composer.Observables):
    def position(self):  # observable
    def orientation(self):  # observable

Import

from dm_control.locomotion.mocap.props import Prop

I/O Contract

Inputs

Name Type Required Description
prop_proto mocap_pb2.Prop Yes Protobuf message containing prop shape, size, mass, and name
rgba array-like No RGBA color override; if None, computed from prop mass
priority_friction bool No If True, enables enhanced contact friction with torsional and rolling components (default: False)

Outputs

Name Type Description
mjcf_model mjcf.RootElement The MJCF model root element for this prop
geom mjcf element The prop's geom element
position mjcf sensor Framepos sensor for ground truth position
orientation mjcf sensor Framequat sensor for ground truth orientation
body_geom_ids tuple of int Tuple containing the prop geom's element ID after compilation

Usage Examples

from dm_control.locomotion.mocap import props as mocap_props

# Props are typically created via Trajectory.create_props()
# rather than direct construction:
trajectory = loader.get_trajectory('some_key')
prop_entities = trajectory.create_props(priority_friction=True)

# Or with a custom prop factory:
prop_entities = trajectory.create_props(prop_factory=mocap_props.Prop)

# Accessing prop sensors
for prop in prop_entities:
    print(prop.position)      # framepos sensor
    print(prop.orientation)   # framequat sensor
    print(prop.geom)          # the underlying MuJoCo geom

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment