def listener_callback(self, msg):
        data = rnp.numpify(msg)
        print(type(data))
        print(data['x'].shape)
        print(data['y'].shape)
        print(data['z'].shape)

        # access the point:
        x_value = data[0][0]
        y_value = data[0][1]
        z_value = data[0][2]
        intensity_value = data[0][3]

        print(data[0])
        print(x_value, y_value, z_value, intensity_value)

        print("******************************")
Exemplo n.º 2
0
 def subscription(self, msg):
     msg = ros2_numpy.numpify(msg)
     self._poc_array = ros2_numpy.point_cloud2.get_xyz_points(
         msg, remove_nans=True)
     self._poc_image = ros2_numpy.point_cloud2.get_xyz_points(
         msg, remove_nans=False)