Repository navigation
Description
Summary
ROS 2 (Robot Operating System 2) is how most robots connect their parts. Camera drivers, models and motor controllers run as separate nodes and exchange messages. Today, to run an exported PyTorch policy (a .pte file) with ExecuTorch in ROS, you install the Python wheel or build ExecuTorch from source, and then write your own node.
We propose 3 pieces:
executorch_vendor: the ExecuTorch C++ runtime as a ROS package, sorosdep installbrings it in, the wayonnxruntime_vendordoes for ONNX Runtime.- An inference node that loads any
.pte, maps topics to the program's inputs and outputs, and keeps GPU data on the GPU. - A
ros2_controlcontroller that runs a small.ptepolicy inside the control loop.
The problem
- ROS installs dependencies with
rosdepfrom released packages. ExecuTorch is not one of them. Its 1.6 wheel also requirestorch==2.15.0, so installing it on a robot pulls in PyTorch, which the robot does not need ([RFC] Run a.ptefrom Python without PyTorch: drop the PyTorch requirement and load CUDA on demand #24820 proposes dropping that). - Every team writes the same node: load a program, turn messages into tensors, run it, publish the result.
- So robot projects default to ONNX. ROS has
onnxruntime_vendorfor Humble through Rolling, an ONNX Runtime conversion plugin under review inrosidl_buffer_backends, and, since Nov 4, an ONNX policy controller inros2_control_demos. NVIDIA's Isaac ROS runs TensorRT engines built from ONNX. A PyTorch user has no ExecuTorch equivalent, even though ExecuTorch runs the same policies without LibTorch on CPU, CUDA and TensorRT.
Proposal
flowchart LR
subgraph WS["Workstation with PyTorch"]
M["PyTorch policy"] -->|"export"| P["policy.pte"]
end
subgraph R["Robot running ROS 2, no PyTorch"]
C["Camera driver"] -->|"image or tensor, GPU memory on Lyrical"| N["ExecuTorch inference node"]
J["Joint states"] --> N
N -->|"actions"| K["ros2_control"]
K -->|"or: small policy runs in the controller"| A["Motors"]
V["executorch_vendor"] -.-> N
V -.-> K
end
P -.->|"copied to the robot"| N
Z["C++ SDK archive (#24816)"] -.->|"downloaded at build time"| V
1. executorch_vendor
- Provides the runtime and its CMake targets. One package for CPU, and a CUDA variant that adds the CUDA backend, so CPU users do not need a CUDA toolkit.
- Downloads the C++ SDK archive proposed in [RFC] Ship the ExecuTorch C++ SDK as a standalone archive with each release, starting with 1.6.0 #24816 for the right architecture and checks a pinned SHA-256. Until that archive exists, it unpacks the C++ part of the pinned wheel, as the vendor packages in ros2/rosidl_buffer_backends#36 already do.
- An optional TensorRT package with the ExecuTorch TensorRT delegate from Torch-TensorRT 2.15 (
torch-tensorrt-executorch-runtime), without PyTorch or Torch-TensorRT itself. - Released for Humble, Jazzy, Lyrical and Rolling. A package name can come from only one repository per ROS distribution, so these packages need one home (see "Where the code lives").
2. Inference node
- A C++ lifecycle node, also registered as a component. It can share a process with a camera driver and receive messages without copies. It loads and warms up the program in
on_configureand opens topics inon_activate. - Tensor mode: tensors in, tensors out, with
isaac_ros_tensor_msgs/TensorListand the parameter names of the Isaac ROS TensorRT node where they apply. So the ExecuTorch node can replace that node in an existing graph. - Policy mode: read the policy's description of its observations and actions, map observations to topics (camera images,
JointState), keep a queue of actions, and publish one per control tick. The description format should follow what LeRobot adopts for its export. - Backends: XNNPACK and CUDA built in. Delegates that ship outside ExecuTorch, like TensorRT, load at run time from a parameter.
- GPU messages: on Lyrical and Rolling, the node uses
ExperimentalTensorwith the CUDA buffer backend, through the conversions in rosidl_buffer_backends#36, so camera frames and actions stay in GPU memory. On Jazzy and Humble, it uses ordinary messages. - Tests: a launch test that runs a small
.pteon CPU, and a CUDA test that skips without a GPU.
3. ros2_control controller
Small reinforcement learning policies, like walking and balance, run hundreds of times a second inside the controller's update(). A separate node adds latency there, so a controller plugin runs the .pte on XNNPACK inside the loop. It follows the ONNX controller in the demos (example 18, Open Duck Mini walking) and keeps the robot-specific observation code out of the generic part. On small policies like these, ExecuTorch with XNNPACK had about the same latency as ONNX Runtime in our tests on Jetson Thor, Jetson Orin Nano and x86, with about 4x less memory and more than 10x faster loading.
How people use it
Package and launch names are placeholders.
Install, with executorch_vendor listed in your package.xml:
rosdep install --from-paths src --ignore-src -y
colcon buildRun an exported policy on CUDA:
executorch_node:
ros__parameters:
model_file_path: /models/policy/model.pte
data_file_paths: [/models/policy/aoti_cuda_blob.ptd]
input_topics: [/camera/image, /joint_states]
output_topics: [/policy/action]ros2 launch executorch_ros executorch_node.launch.py params_file:=policy.yamlTo replace an Isaac ROS TensorRT node, keep its TensorList topics and parameters, and point the node at a .pte exported with the TensorRT delegate.
Plan
- Agree where the code lives.
- Release the vendor packages for Rolling and Lyrical, then Jazzy and Humble.
- Build the controller and check it with a small walking policy on XNNPACK.
- Build tensor mode of the node, with launch files, tests and docs.
- Add policy mode and check it with an ACT policy on CUDA.
- Add the TensorRT package and check the same ACT policy on TensorRT with CUDA.
- Switch the vendor download to the C++ SDK archive once [RFC] Ship the ExecuTorch C++ SDK as a standalone archive with each release, starting with 1.6.0 #24816 ships.
Scope
- Linux on x86_64 and aarch64, where ROS ships binaries. CUDA where the ExecuTorch CUDA build supports it.
- The node runs programs. Export stays on a machine with PyTorch.
- No new message types. The node uses existing ROS messages and the experimental tensor message.
Where the code lives
We suggest a separate repository in the pytorch organization, for example pytorch/executorch_ros, with a CI job in this repository that builds it against the current runtime. ExecuTorch already did this for Arduino (meta-pytorch/executorch-arduino), and it is how onnxruntime_vendor ships.
| Option | For | Against |
|---|---|---|
| Separate repository | released through the ROS build farm like onnxruntime_vendor; a layout ROS developers know |
a second repository to maintain |
extension/ros in this repository |
close to the runtime; tested by ExecuTorch CI | bloom imports the whole large repository at each release; source builds need --base-paths extension/ros, because colcon sees the root setup.py; ROS releases follow ExecuTorch's cycle |
Inside rosidl_buffer_backends |
already the home of the GPU message conversions | Lyrical and Rolling only; a general node is not that repository's job |
The GPU message conversions stay in rosidl_buffer_backends in every case.
Open questions
- Separate repository, or
extension/roshere? - Should we support Humble? Its Ubuntu ships CMake 3.22, while the ExecuTorch CMake targets need 3.28 (3.19 works through the
EXECUTORCH_*variables). - Which observation and action description should policy mode read? Should it follow the data collection and inference contract that the ROS Physical AI SIG working groups plan to write?
- Who maintains the vendor package releases in rosdistro?
- On Jetson, should the TensorRT package use the TensorRT that JetPack installs, or the version the delegate was built for? They can differ, and a TensorRT engine only loads with the version that built it.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTo triage
Activity
digantdesai commentedon Nov 10, 2026
FWIW, we did the #2 (second repo) for Arduino - https://github.com/meta-pytorch/executorch-arduino
[-][RFC] ExecuTorch for ROS 2: an installable runtime package and a general inference node[/-][+][RFC] ExecuTorch for ROS 2: a rosdep package, an inference node and a ros2_control controller[/+]shoumikhin commentedon Nov 19, 2026
I tried the tensor mode from section 2 inside Isaac ROS: NVIDIA-ISAAC-ROS/isaac_ros_dnn_inference#69 (draft). It's an ExecuTorch node that can replace Isaac's TensorRT node in a graph, with the same topics and tensor name parameters. In Isaac ROS 5.1's DOPE graph, with only the inference node swapped:
What I learned along the way:
I think the PR is a good starting point for the general node.