points_all=[]# Create an empty List for the Arrays of points from the Sensors
count=0# Set the Counter to Zero. The Counter is needed to rotate the sensor Points in the self.create_plc_from_distance function
forkey,arrayindata.items():# a for-Loop that goes through the arrays of data from each sensor
points_all.append(self.create_pcd_from_distance(np.array(array).reshape(8,8),count*45))# in this line we create an 8x8 np.array from the sensor data list, then we feed it into the the create_plc_from_distance() with the angle we want the points to be rotated around the z-axis
count=count+1# the counter counts one up
points_all.append(self.create_pcd_from_distance(np.array(array).reshape(8,8),key))# in this line we create an 8x8 np.array from the sensor data list, then we feed it into the the create_plc_from_distance() with the angle we want the points to be rotated around the z-axis
self.points=np.vstack(points_all)# stacking the sensor 64x3 arrays to one (count*64)x3 vertically
self.pcd=self.point_cloud(self.points,'vl53l7cx_link')# converting the np.array to pointcloud data with the parent_frame. The parent_frame has to be edited in the future to suit the use-case
self.pcd_publisher.publish(self.pcd)# publishing the pointcloud2 topic
...
...
@@ -45,24 +67,14 @@ class SerialListPublisher(Node):