Utility Scripts · Physical Controls
Direct Torque
Direct torque applies a persistent signed effort to Wheel/Crank without regulating speed or position.
control.set_torque_mode(options)
control.get_torque_mode()| Item | Meaning / default |
|---|---|
| enabled | true |
| torque | Default 0 N·m; finite positive, negative or zero value within the native input range. |
| active | Getter only: current drive ownership. |
Example#
wheel = jolt_control_wheel({torque_mode: {torque: 0.5}});
// Change torque direction later:
wheel.set_torque_mode({torque: -0.5});
// Zero torque does not brake:
wheel.set_torque_mode({torque: 0});
wheel.set_torque_mode({enabled: false});Torque acts around mounting +Z using the right-hand rule, independently of the sign of current speed. Each native substep applies angular impulse torque × dt. A Dynamic parent receives the opposite reaction. There is no max_torque or automatic speed correction: torque is the directly applied value. Resistance can reduce or hold the resulting motion.
New related workflows#
Verified operation contracts#
These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.
| Symbol / owner | Signature | Operation contract |
|---|---|---|
| JoltControl.get_torque_mode | JoltControl.get_torque_mode() | Wheel/Crank; config enabled defaults true, finite signed torque N·m defaults 0. Setter Boolean, getter {enabled, torque, active} or undefined. Enabled and actually active differ. |
| JoltControl.set_torque_mode | JoltControl.set_torque_mode(options) | Wheel/Crank; config enabled defaults true, finite signed torque N·m defaults 0. Setter Boolean, getter {enabled, torque, active} or undefined. Enabled and actually active differ. |