newton.actuators.parse_battery_prim#

newton.actuators.parse_battery_prim(prim)[source]#

Parse a USD battery prim into a battery class and its parameters.

The prim type selects the battery class, e.g. NewtonConstantResistanceBattery selects BatteryConstantResistance, and the authored newton: attributes become its keyword arguments; the class fills in defaults when the battery is added. The actuators that draw from the battery name it in their newton:battery relationship; parse_actuator_prim() reports it as ActuatorParsed.battery_path.

Parameters:

prim – USD prim to parse.

Returns:

The parsed battery, or None if the prim is not a battery.

Raises:

ValueError – The prim is derived from NewtonBattery but its type is not supported.

Return type:

BatteryParsed | None