ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I'm having the same issue. Still working on it, will update if I find solution.
In 2020 it wasn't ported yet... https://answers.ros.org/question/357944/why-is-point_cloud2py-missing-from-sensor_msgs-in-ros2/ but it was supposed to have been finished that year. https://github.com/ros2/common_interfaces/pull/128
use sensor_msgs_py. The following assume Ubuntu 20/ROS2 Foxy.
download with: sudo apt-get install ros-foxy-sensor-msgs-py
in your script:
from sensor_msgs_py import point_cloud2
...
x_points = list(point_cloud2.read_points(pcl2_msg, field_names=('x')))
2 | No.2 Revision |
I'm having the same issue. Still working on it, will update if I find solution.
In 2020 it wasn't ported yet... https://answers.ros.org/question/357944/why-is-point_cloud2py-missing-from-sensor_msgs-in-ros2/ but it was supposed to have been finished that year. https://github.com/ros2/common_interfaces/pull/128
use sensor_msgs_py. The following assume Ubuntu 20/ROS2 Foxy.
download with: sudo apt-get install ros-foxy-sensor-msgs-py
in your script:
from sensor_msgs_py import point_cloud2
...
x_points = list(point_cloud2.read_points(pcl2_msg, field_names=('x')))
3 | No.3 Revision |
In 2020 it wasn't ported yet... https://answers.ros.org/question/357944/why-is-point_cloud2py-missing-from-sensor_msgs-in-ros2/ but it was supposed to have been finished that year. https://github.com/ros2/common_interfaces/pull/128
use sensor_msgs_py. The following assume Ubuntu 20/ROS2 Foxy.
in your script:
from sensor_msgs.msg import PointCloud2 #used as the subscription message type from sensor_msgs_py import point_cloud2 #used to read points ... self.subscription = self.create_subscription( # message_type PointCloud2, 'topic', self.listener_callback, 10 ) ... x_points = list(point_cloud2.read_points(msg, field_names=('x','y','z','intensity')))
...
x_points = list(point_cloud2.read_points(pcl2_msg, field_names=('x')))
4 | No.4 Revision |
In 2020 it wasn't ported yet... https://answers.ros.org/question/357944/why-is-point_cloud2py-missing-from-sensor_msgs-in-ros2/ but it was supposed to have been finished that year. https://github.com/ros2/common_interfaces/pull/128
use sensor_msgs_py. The following assume Ubuntu 20/ROS2 Foxy.
in your script:
from sensor_msgs.msg import PointCloud2 #used as the subscription message type
type
from sensor_msgs_py import point_cloud2 #used to read points
...
self.subscription = self.create_subscription(...
xyz_points
= list(5 | No.5 Revision |
In 2020 it wasn't ported yet... https://answers.ros.org/question/357944/why-is-point_cloud2py-missing-from-sensor_msgs-in-ros2/ but it was supposed to have been finished that year. https://github.com/ros2/common_interfaces/pull/128
use sensor_msgs_py. The following assume Ubuntu 20/ROS2 Foxy.
in your script:
from sensor_msgs.msg import PointCloud2 #used as the subscription message type
from sensor_msgs_py import point_cloud2 #used to read points
...
self.subscription = self.create_subscription( PointCloud2, 'topic', self.listener_callback, 10 )
...
xyz_points = list(point_cloud2.read_points(msg, field_names=('x','y','z')))