Skip to main content

ContactGridScenario

Robotics scenarios · Implementation: mlsysim/engine/scenario_definitions/robotics/demonstrations.py.

Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.

A contact task binned by contact angle and normal force, and the cells each archive occupies.

archives maps a name to (angle_low, angle_high, force_low, force_high, held-out RMS action error); each archive’s occupied region is a rectangle of whole bins.

Notes

Equation: Cells=angle_bins*force_bins; archive support is its rectangular bin span.

Assumptions: Archive boundaries align with angle/force bins and the supplied RMS errors are external inputs.

Excludes: Interpolation accuracy or probability mass within occupied bins.

References

Derivation: Aligned angular and force bins form a Cartesian product. Each archive is represented by a rectangle whose angular count times force count gives occupied cells; the RMS error is carried from the input and is not inferred from occupancy.

Examples

The named registry scenario supplies the stated inputs; this is a modeled calculation, not a new measurement.

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.ContactAngleCoverage
>>> scenario.cells
600

Attributes

Name Description
angle_bin
angle_bins Integer angular bins spanning the declared angle range; rounds range divided by bin width.
angle_max
angle_min
archives
cells Total contact grid cells: angular bins times force bins.
force_bin
force_bins Integer force bins from zero to force_max, rounding the ratio to force_bin.
force_max
record_rate
records

Methods

Name Description
bin_span Archive rectangle as (first_angle, angle_count, first_force, force_count) integer bin coordinates; assumes edges align with the grid.
empty Number of grid cells outside archive name’s rectangle.
empty_share Fraction of grid cells outside the archive’s declared rectangular support.
occupied Grid-cell count in archive name’s rectangular support, from its angular and force bin counts.
rms_error Supplied RMS-error entry for archive name; returns the input value without estimating or extrapolating error.
share Fraction of the grid occupied by archive name’s rectangle; no distribution within it is modeled.

bin_span

engine.scenario_types.ContactGridScenario.bin_span(name)

Archive rectangle as (first_angle, angle_count, first_force, force_count) integer bin coordinates; assumes edges align with the grid.

Equation: The calculation follows the stated accounting rule; the method body shows each intermediate term.

empty

engine.scenario_types.ContactGridScenario.empty(name)

Number of grid cells outside archive name’s rectangle.

Equation: self.cells - self.occupied(name)

empty_share

engine.scenario_types.ContactGridScenario.empty_share(name)

Fraction of grid cells outside the archive’s declared rectangular support.

Equation: self.empty(name) / self.cells

occupied

engine.scenario_types.ContactGridScenario.occupied(name)

Grid-cell count in archive name’s rectangular support, from its angular and force bin counts.

Equation: The calculation follows the stated accounting rule; the method body shows each intermediate term.

rms_error

engine.scenario_types.ContactGridScenario.rms_error(name)

Supplied RMS-error entry for archive name; returns the input value without estimating or extrapolating error.

Equation: self.archives[name][4]

share

engine.scenario_types.ContactGridScenario.share(name)

Fraction of the grid occupied by archive name’s rectangle; no distribution within it is modeled.

Equation: self.occupied(name) / self.cells

angle_min

Type: Quantity.

Declared default: required.

angle_max

Type: Quantity.

Declared default: required.

angle_bin

Type: Quantity.

Declared default: required.

force_max

Type: Quantity.

Declared default: required.

force_bin

Type: Quantity.

Declared default: required.

records

Type: int.

Declared default: required.

record_rate

Type: Quantity.

Declared default: required.

archives

Type: Dict[str, Any].

Declared default: required.

angle_bins

engine.scenario_types.ContactGridScenario.angle_bins

Integer angular bins spanning the declared angle range; rounds range divided by bin width.

Equation: int(round(((self.angle_max - self.angle_min) / self.angle_bin).to(’’).magnitude))

force_bins

engine.scenario_types.ContactGridScenario.force_bins

Integer force bins from zero to force_max, rounding the ratio to force_bin.

Equation: int(round((self.force_max / self.force_bin).to(’’).magnitude))

cells

engine.scenario_types.ContactGridScenario.cells

Total contact grid cells: angular bins times force bins.

Equation: self.angle_bins * self.force_bins

Back to top