![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged numpy_ndarray_msgs at Robotics Stack Exchange
![]() |
numpy_ndarray_msgs package from numpy_ndarray_msgs reponumpy_ndarray_msgs |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.2.0 |
License | MIT |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/Geson-anko/numpy_ndarray_msgs.git |
VCS Type | git |
VCS Version | stable |
Last Updated | 2025-03-27 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Geson-anko
Authors
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
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
std_msgs |