https://github.com/geson-anko/numpy_ndarray_msgs
A ROS2 package for transmitting NumPy ndarrays between ROS2 nodes.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.6%) to scientific vocabulary
Keywords
Repository
A ROS2 package for transmitting NumPy ndarrays between ROS2 nodes.
Basic Info
- Host: GitHub
- Owner: Geson-anko
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://qiita.com/GesonAnko/items/eca54b971685bd15a189
- Size: 107 KB
Statistics
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 3
Topics
Metadata Files
README.md
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
bash
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
bash
pip install ros2-ndarray-msg-utils
Usage
Python Utility Package
```python import numpy as np from ndarraymsgutils import torosmsg, fromrosmsg, 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 = torosmsg(array)
with Header
msg = torosmsg(array, timestamp=ROSClock().now(), frameid="arrayframe")
Convert back to NumPy array
restored = fromrosmsg(msg) ```
PyTorch Support
bash
pip install "ros2-ndarray-msg-utils[torch]"
```py import torch from ndarraymsgutils.torch import torosmsg, fromrosmsg
Convert PyTorch tensor to ROS2 message
tensor = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32) msg = torosmsg(tensor)
Convert back to PyTorch tensor
restored = fromrosmsg(msg) ```
License
MIT License
Owner
- Name: GesonAnko
- Login: Geson-anko
- Kind: user
- Location: VRChat
- Company: GOP co., ltd.
- Website: https://geson-anko.github.io
- Twitter: GesonAnkoVR
- Repositories: 14
- Profile: https://github.com/Geson-anko
I'm researching in AMI(Autonomous Machine Intelligence) field.
GitHub Events
Total
- Release event: 1
- Watch event: 1
- Delete event: 1
- Push event: 1
- Pull request event: 4
- Create event: 2
Last Year
- Release event: 1
- Watch event: 1
- Delete event: 1
- Push event: 1
- Pull request event: 4
- Create event: 2
Issues and Pull Requests
Last synced: 6 months ago
Packages
- Total packages: 1
-
Total downloads:
- pypi 19 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
pypi.org: ros2-ndarray-msg-utils
A ROS2 package for transmitting NumPy ndarrays between ROS2 nodes.
- Documentation: https://ros2-ndarray-msg-utils.readthedocs.io/
- License: MIT License
-
Latest release: 0.2.0
published 11 months ago