The repository or configuration that created this release differ from a previous release. View details.
ROS2 NDArray Message
A ROS2 package for transmitting NumPy ndarrays between ROS2 nodes.
Features
- Custom ROS2 message type for numpy.ndarray
- Bi-directional conversion between NumPy arrays and ROS2 messages
- Multi-dimensional array support with various data types
- Type-safe Python utilities with full type hints
Requirements
- ROS2 Humble or higher
- Python 3.10+
Installation
cd ~/ros2_ws/src
git clone https://github.com/Geson-anko/numpy_ndarray_msgs.git
cd ../
colcon build --packages-select numpy_ndarray_msgs
source install/setup.sh
Install Python Utility Package
pip install ros2-ndarray-msg-utils
Usage
Python Utility Package
import numpy as np
from ndarray_msg_utils import to_ros_msg, from_ros_msg, NDArray
from rclpy.clock import ROSClock
# Convert NumPy array to ROS2 message
array = np.array([[1, 2], [3, 4]], dtype=np.float32)
# Type Hint
msg: NDArray
msg = to_ros_msg(array)
# with Header
msg = to_ros_msg(array, timestamp=ROSClock().now(), frame_id="array_frame")
# Convert back to NumPy array
restored = from_ros_msg(msg)
PyTorch Support
pip install "ros2-ndarray-msg-utils[torch]"
import torch
from ndarray_msg_utils.torch import to_ros_msg, from_ros_msg
# Convert PyTorch tensor to ROS2 message
tensor = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32)
msg = to_ros_msg(tensor)
# Convert back to PyTorch tensor
restored = from_ros_msg(msg)
License
MIT License
Metadata
Release files for ros2-ndarray-msg-utils 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Change of provenance
The repository or configuration that created these release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ros2_ndarray_msg_utils-0.2.0.tar.gz | 43.7 kB | With provenance | Details for ros2_ndarray_msg_utils-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ros2_ndarray_msg_utils-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ros2_ndarray_msg_utils-0.2.0-py3-none-any.whl |
Total release size: 49.6 kB
Release files / ros2_ndarray_msg_utils-0.2.0.tar.gz
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | ros2_ndarray_msg_utils-0.2.0.tar.gz |
|---|---|
| Size | 43.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a0d1f11bb503ae7a810ce873e61bf46b6717257161ebb2962e677b0046f8f3d
|
|
BLAKE2b-256 checksum How to use checksums |
f85f31d4dbf826212037481b8a598c3213211b5e5d94bd31c3d638850de91d65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 27, 2025.
Transparency logRelease files / ros2_ndarray_msg_utils-0.2.0-py3-none-any.whl
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | ros2_ndarray_msg_utils-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
624cc24e1af92326c2107b80043e730dd957956564bc49fb1034437ca0c7c6da
|
|
BLAKE2b-256 checksum How to use checksums |
7c71376b8887b7fbeffe2f73eda263fe7579300b01008f617547858223eee21b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 27, 2025.
Transparency logSecurity for ros2-ndarray-msg-utils 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Change of provenance
The repository and configuration that created this release differ from a previous release.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Repository
- Removed 0.1.1 github.com/Geson-anko/ndarray_msg
- Added 0.2.0 github.com/Geson-anko/numpy_ndarray_msgs
Attestation for ros2_ndarray_msg_utils-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 27, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.