No version for distro humble showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro jazzy showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro kilted showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro rolling showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro galactic showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro iron showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro melodic showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange

No version for distro noetic showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.0.9
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Navigator, our self-driving vehicle software stack
Checkout URI https://github.com/nova-utd/navigator.git
VCS Type git
VCS Version dev
Last Updated 2026-02-18
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A collection of conversion functions for extracting numpy arrays from messages

Additional Links

Maintainers

  • Tom Panzarella

Authors

  • Eric Wieser

ros2_numpy

This project is a fork of ros_numpy to work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed to ros2_numpy. Users are encouraged to update their application code to import the module as shown below.

ROS 2:

import ros2_numpy as rnp

ROS 1:

import ros_numpy as rnp

Prefacing your calls like rnp.numpify(...) or rnp.msgify(...) should help future proof your codebase while the ROS 1 and ROS 2 ports are API compatible.

The ROS 2 port has been bootstrapped as version 2.0.3. The MAJOR version has been set to 2 to indicate ROS 2 and the MINOR and PATCH versions match the ROS 1 version from which the ROS 2 port was bootstrapped. The reasoning behind this is to allow for creating tags in this fork that can be released into the ROS 2 distribution while not conflicting with existing tags on the upstream repository. A release into Foxy is still pending.

This module contains two core functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:
   data = np.zeros(100, dtype=[
     ('x', np.float32),
     ('y', np.float32),
     ('vectors', np.float32, (3,))
   ])
   data['x'] = np.arange(100)
   data['y'] = data['x']*2
   data['vectors'] = np.arange(100)[:,np.newaxis]

   msg = ros2_numpy.msgify(PointCloud2, data)
   
   data = ros2_numpy.numpify(msg)
   
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2
  • nav_msgs.msg.OccupancyGridnp.ma.array
  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]
  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]
  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]
  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix
  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros2_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros2_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia
CHANGELOG

Changelog for package ros2_numpy

2.0.9 (2023-01-03)

  • Fix for numpy 1.24.0
  • Contributors: Florian Vahl

2.0.8 (2022-06-12)

  • Update for ROS2 Humble (#5)
  • Contributors: Sean Kelly

2.0.7 (2022-05-16)

  • Remove unneeded array and handle bigendian (#4)
  • Contributors: Florian Vahl

2.0.6 (2022-04-15)

  • Improve speed of msgify(point_cloud_2_np) by 115x (#3)
  • Contributors: Alex Thiel

2.0.5 (2022-02-24)

2.0.4 (2021-11-02)

  • Modified transformations.py for quaternion convention (#2)
  • Added a test case for the quaternion convention
  • Fixed rosdep dependencies in package.xml
  • Contributors: Asil Orgen, Tom Panzarella

2.0.3 (2020-07-12)

  • Renamed fork to ros2_numpy
  • Start tracking changes in CHANGELOG at 2.0.3
  • Contributors: Tom Panzarella

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_numpy at Robotics Stack Exchange