Add ONNX Runtime tensor conversions
@yuanknv is already working on this.
Since Aug 28, 2026.
Assessment
This issue has not been assessed yet.
Description
Description
Add an ONNX Runtime conversion package, analogous to torch_conversions, for converting tensor_msgs/msg/ExperimentalTensor to ONNX Runtime Ort::Value tensors.
Motivation
The repository currently provides torch_conversions, which bridges ExperimentalTensor and at::Tensor. Supporting ONNX Runtime would enable the same underlying buffer infrastructure to be used for inference deployments that do not want to depend on PyTorch or LibTorch.
The Special Interest Group for Physical AI is interested in running inference with ONNX as part of our demos in addition to pytorch based inference.
Design / Implementation Considerations
A target pipeline would look like:
ROS publisher
|
ExperimentalTensor
|
rosidl::Buffer
|
ONNX Runtime conversion
|
Ort::Value
|
ONNX Runtime session
The package could expose APIs similar in spirit to torch_conversions, for example:
Ort::Value from_input_tensor_msg(
const tensor_msgs::msg::ExperimentalTensor & msg,
const Ort::MemoryInfo & memory_info);
Ort::Value from_output_tensor_msg(
tensor_msgs::msg::ExperimentalTensor & msg,
const Ort::MemoryInfo & memory_info);
Additional helpers could allocate an appropriately sized ExperimentalTensor for a given ONNX element type and shape.
Additional Information
ExperimentalTensor can represent DLPack-style shape, stride, and byte-offset metadata. ONNX Runtime's tensor API generally represents dense tensor storage and does not provide an equivalent arbitrary-strided tensor view.
For an initial implementation, rejecting unsupported layouts may be preferable to introducing hidden copies.
- Dominant language
- C++
- Stars
- 27
- Forks
- 13
- Avg merge
- 21d 23h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros2/rosidl_buffer_backends
-
cuda_buffer: late import of a reused VMM block passes the UID staleness check and reads the next frameMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
-
cuda_buffer: please release #12 (0.1.2 segfaults in get_endpoint_manager after a context restart)Possibly taken @yuanknv claimed this 3 days ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 15/100
ros2/rosidl_buffer_backends#42 · 1 reaction · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Subscription accepting the cuda backend receives no messages when the cuda_buffer_backend plugin is not available in its processMay be free again @nvcyc claimed this 28 days ago, and no pull request is open. Open
ros2/rosidl_buffer_backends#34 · 1 assignee ·
All issues in ros2/rosidl_buffer_backends
Similar issues
-
arch-based bug niri
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
noctalia-dev/noctalia#5552 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
EchoTools/nevr-runtime#2912 ·
Maintainers usually reply within 1 day
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yugabyte/yugabyte-db#39462 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
meshtastic/firmware#12519 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day