newton.actuators.ControllerNeuralMLP#
- class newton.actuators.ControllerNeuralMLP(model_path)[source]#
Bases:
ControllerMLP-based neural network controller.
Uses a pre-trained MLP to compute joint effort from concatenated, scaled position-error and joint-velocity history. The output is multiplied by
effort_scaleto convert from network units to physical effort [N or N·m].Configuration parameters (
input_order,input_idx,pos_scale,vel_scale,effort_scale) are read from checkpoint metadata, falling back to defaults when absent..onnxcheckpoints run through Warp-NN. Torch checkpoints keep the Torch backend and accept pt2 archives (.pt2saved withtorch.export.save; preferred) and the deprecated TorchScript (.ptsaved withtorch.jit.save) and module-bundle ({"model": <network module>, "metadata": {...}}saved withtorch.save) formats.- classmethod resolve_arguments(args)#
- __init__(model_path)#
Initialize MLP controller from a checkpoint file.
- Parameters:
model_path (str) – Path to the
.onnx,.pt2,.pt, or.pthcheckpoint.
- compute(positions, velocities, target_pos, target_vel, feedforward, pos_indices, vel_indices, target_pos_indices, target_vel_indices, forces, state, dt, device=None)#
- finalize(device, num_actuators)#
- is_graphable()#
- is_stateful()#
- state(num_actuators, device)#
- update_state(current_state, next_state)#