Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
feat(#211): fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
erlbacsi committed Mar 16, 2023
1 parent 4fbc35f commit 7b74fd1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/perception/src/lidar_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lidar_filter_utility
from sensor_msgs.msg import PointCloud2, Range


class LidarDistance():
""" See doc/06_perception/02_lidar_distance_utility.md on
how to configute this node
Expand All @@ -23,7 +24,8 @@ def callback(self, data):
"""
coordinates = ros_numpy.point_cloud2.pointcloud2_to_array(data)

# https://stackoverflow.com/questions/44295375/how-to-slice-a-numpy-ndarray-made-up-of-numpy-void-numbers
# https://stackoverflow.com/questions/44295375/how-to-slice-a-numpy-
# ndarray-made-up-of-numpy-void-numbers
bit_mask = lidar_filter_utility.bounding_box(
coordinates,
max_x=rospy.get_param('~max_x', np.inf),
Expand All @@ -45,7 +47,8 @@ def callback(self, data):
# Publish manipulated pointCloud2
self.pub_pointcloud.publish(coordinates_manipulated)

# https://stackoverflow.com/questions/1401712/how-can-the-euclidean-distance-be-calculated-with-numpy
# https://stackoverflow.com/questions/1401712/how-can-the-euclidean-
# distance-be-calculated-with-numpy
coordinates_xyz = np.array(
lidar_filter_utility.remove_field_name(coordinates, 'intensity')
.tolist()
Expand Down Expand Up @@ -82,7 +85,8 @@ def listener(self):
Range
)

rospy.Subscriber(rospy.get_param('~source_topic', "/carla/hero/LIDAR"), PointCloud2, self.callback)
rospy.Subscriber(rospy.get_param('~source_topic', "/carla/hero/LIDAR"),
PointCloud2, self.callback)

# spin() simply keeps python from exiting until this node is stopped
rospy.spin()
Expand Down

0 comments on commit 7b74fd1

Please sign in to comment.