https://github.com/geson-anko/numpy_ndarray_msgs

A ROS2 package for transmitting NumPy ndarrays between ROS2 nodes.

https://github.com/geson-anko/numpy_ndarray_msgs

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

messaging numpy python ros2
Last synced: 6 months ago · JSON representation

Repository

A ROS2 package for transmitting NumPy ndarrays between ROS2 nodes.

Basic Info
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 3
Topics
messaging numpy python ros2
Created about 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Contributing License

README.md

ROS2 Humble ROS2 Jazzy Python 3.10+ License: MIT Document Style Lint & Format / Test

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.

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

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 68
  • Total Committers: 1
  • Avg Commits per committer: 68.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 68
  • Committers: 1
  • Avg Commits per committer: 68.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Geson-anko 5****o 68

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.

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 19 Last month
Rankings
Dependent packages count: 9.4%
Forks count: 31.6%
Average: 33.9%
Stargazers count: 41.5%
Dependent repos count: 53.0%
Maintainers (1)
Last synced: 6 months ago