Best way to integrate ndarray into ros2 [closed]
Hello, I have a numpy ndarray, and when I try and publish it, I get this error:
AssertionError: The 'data' field must be a set or sequence and each value of type 'float'
Searching around, I see references to numpy in ros1, and also in the ros2 ros2idl_generator_py
, however the only way I can seem to publish the array is to convert to a python list, which is expensive. Given that a numpy array is a sequence, is there any way to avoid this conversion?
Thank you for your time!