Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neka-nat/ros_np_multiarray
Convert between numpy ndarray and ros multiarray
https://github.com/neka-nat/ros_np_multiarray
numpy ros
Last synced: 3 months ago
JSON representation
Convert between numpy ndarray and ros multiarray
- Host: GitHub
- URL: https://github.com/neka-nat/ros_np_multiarray
- Owner: neka-nat
- Created: 2018-07-09T16:55:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-23T12:46:22.000Z (over 2 years ago)
- Last Synced: 2024-05-02T01:53:39.602Z (9 months ago)
- Topics: numpy, ros
- Language: CMake
- Size: 8.79 KB
- Stars: 16
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ros_np_multiarray
Convert between numpy ndarray and ros multiarray message.
## Usage
This is a simple example.
```py
from ros_np_multiarray import ros_np_multiarray as rnm
import numpy as npprint(rnm.to_multiarray_f32(np.array([[[1.0, 2.0], [3.0, 4.0]]], dtype=np.float32)))
```We get the data converted to 'std_msgs/Float32MultiArray'.
```
layout:
dim:
-
label: "dim0"
size: 1
stride: 4
-
label: "dim1"
size: 2
stride: 8
-
label: "dim2"
size: 2
stride: 8
data_offset: 0
data: [1.0, 2.0, 3.0, 4.0]
```