Closed geopimik closed 5 months ago
Some comments how you could make the code a bit simpler
If you would bring the lines 62 and 63 out of the if and placing them just after creating the Header() https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L61-L65
You would not need to create the same thing any more here - can delete https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L100-L101
You could also skip creating this https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L67
And add detected objects straight to objects_msg.objects using append
objects_msg.objects
And then you could also delete this: https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L102
OK
Some comments how you could make the code a bit simpler
If you would bring the lines 62 and 63 out of the if and placing them just after creating the Header() https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L61-L65
You would not need to create the same thing any more here - can delete https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L100-L101
You could also skip creating this https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L67
And add detected objects straight to
objects_msg.objects
using appendAnd then you could also delete this: https://github.com/jaak-peterson/autoware_mini_practice/blob/8136687018f903b9cee09250bd1b6d785b69cf3b/practice_5/nodes/detection/lidar_cluster/cluster_detector.py#L102