ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Initialize your Twist
and Pose
object before creating subscribers. Therefore you should move the following lines just below def __init__(self):
self.move = Twist()
self.object = Pose()
Please initialize self.object_1
to None
just below the initialization of the Twist
and Pose
objects,
self.object_1 = None
Please use the conditional statement if (self.length == 2) and (self.object_1 < 5.4):
only after ensuring that self.object_1
is not None
.
On a side note, if lidar_distance
and /info
topics are running at a similar frequency, you may couple and receive them together in a single callback. Thus your logic will become much cleaner.
2 | No.2 Revision |
Initialize your Twist
and Pose
object before creating subscribers. Therefore you should move the following lines just below def __init__(self):
self.move = Twist()
self.object = Pose()
Please initialize self.object_1
to None
just below the initialization of the Twist
and Pose
objects,
self.object_1 = None
Please use the conditional statement if (self.length == 2) and (self.object_1 < 5.4):
only after ensuring that self.object_1
is not None
.
On a side note, if lidar_distance
and /info
topics are running at a similar frequency, you may couple and receive them together in a single callback. Thus your logic will become much cleaner.
The question has been updated completely. I am not sure if it is good practice to modify it entirely. Never mind, following is the error:
ValueError: min() arg is an empty sequence
The error is coming from this line mini_data = min(xyz_array[:,0])
. So, please check the shape of xyz_array
before indexing over it.