Skip to main content

TorqueHalfSpaceProjectionScenario

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

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

A torque proposal against one barrier half-space normal . u <= bound: the least-change projection (calc_cbf_qp_orthogonal_projection) against a per-axis clamp.

Torques are in N m, stored as plain floats like the projection helper’s inputs.

Notes

Equation: projection is the worked quantity; each property below states its equation and units.

Assumptions: One linear half-space constrains Euclidean torque correction; scalars represent N m.

Excludes: Jointly enforcing actuator limits; actuator_limit is descriptive and the projection is unconstrained otherwise.

References

Derivation: The scenario binds declared inputs to calc_cbf_qp_orthogonal_projection. Those implementations document their derivations and sources.

Examples

Execute the registered worked inputs; this is a modeled calculation.

>>> from mlsysim import Scenarios
>>> case = Scenarios.TwoJointTorqueProjection
>>> value = case.projection
>>> [round(item, 3) for item in value["u_projected"]]
[1.5, 2.0]

Attributes

Name Description
actuator_limit
bound
breach Signed proposal constraint violation; positive means outside the half-space.
clamp
clamp_penetration Signed clamped proposal violation; positive means clamping still violates the barrier.
clamp_value Clamped torque dot barrier normal, in the bound’s scalar units.
normal
projected_value Projected torque dot barrier normal for checking the half-space inequality.
projection Least-change torque projection from the shared single-half-space helper.
proposal
proposal_value Proposed torque dot barrier normal, in the bound’s scalar units.

Methods

Name Description
angle_deg Planar angle in degrees from the first two torque components.

angle_deg

engine.scenario_types.TorqueHalfSpaceProjectionScenario.angle_deg(u)

Planar angle in degrees from the first two torque components.

Equation: import math return math.degrees(math.atan2(u[1], u[0]))

proposal

Type: List[float].

Declared default: required.

normal

Type: List[float].

Declared default: required.

bound

Type: float.

Declared default: required.

clamp

Type: List[float].

Declared default: required.

actuator_limit

Type: float.

Declared default: required.

projection

engine.scenario_types.TorqueHalfSpaceProjectionScenario.projection

Least-change torque projection from the shared single-half-space helper.

Equation: return calc_cbf_qp_orthogonal_projection(self.proposal, self.normal, self.bound)

proposal_value

engine.scenario_types.TorqueHalfSpaceProjectionScenario.proposal_value

Proposed torque dot barrier normal, in the bound’s scalar units.

Equation: return self._dot(self.normal, self.proposal)

breach

engine.scenario_types.TorqueHalfSpaceProjectionScenario.breach

Signed proposal constraint violation; positive means outside the half-space.

Equation: return self.proposal_value - self.bound

clamp_value

engine.scenario_types.TorqueHalfSpaceProjectionScenario.clamp_value

Clamped torque dot barrier normal, in the bound’s scalar units.

Equation: return self._dot(self.normal, self.clamp)

clamp_penetration

engine.scenario_types.TorqueHalfSpaceProjectionScenario.clamp_penetration

Signed clamped proposal violation; positive means clamping still violates the barrier.

Equation: return self.clamp_value - self.bound

projected_value

engine.scenario_types.TorqueHalfSpaceProjectionScenario.projected_value

Projected torque dot barrier normal for checking the half-space inequality.

Equation: return self._dot(self.normal, self.projection[‘u_projected’])

Back to top