Skip to content

Commit d999c99

Browse files
changed id field name reflection in code
1 parent 381ed93 commit d999c99

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

kf_hungarian_tracker/kf_hungarian_tracker/kf_hungarian_node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ def callback(self, msg):
165165
marker_list = []
166166
# add current active obstacles
167167
for obs in filtered_obstacle_list:
168-
(r, g, b) = colorsys.hsv_to_rgb(obs.msg.id.int % 360 / 360., 1., 1.) # encode id with rgb color
168+
(r, g, b) = colorsys.hsv_to_rgb(obs.msg.uuid.int % 360 / 360., 1., 1.) # encode id with rgb color
169169
# make a cube
170170
marker = Marker()
171171
marker.header = msg.header
172-
marker.ns = str(obs.msg.id)
172+
marker.ns = str(obs.msg.uuid)
173173
marker.id = 0
174174
marker.type = 1 # CUBE
175175
marker.action = 0
@@ -186,7 +186,7 @@ def callback(self, msg):
186186
# make an arrow
187187
arrow = Marker()
188188
arrow.header = msg.header
189-
arrow.ns = str(obs.msg.id)
189+
arrow.ns = str(obs.msg.uuid)
190190
arrow.id = 1
191191
arrow.type = 0
192192
arrow.action = 0
@@ -239,7 +239,7 @@ def death(self, obj_ind, num_of_obstacle):
239239
if self.obstacle_list[obs].dying < self.death_threshold:
240240
new_object_list.append(self.obstacle_list[obs])
241241
else:
242-
dead_object_list.append(self.obstacle_list[obs].msg.id)
242+
dead_object_list.append(self.obstacle_list[obs].msg.uuid)
243243

244244
# add newly born obstacles
245245
for obs in range(num_of_obstacle, len(self.obstacle_list)):

kf_hungarian_tracker/kf_hungarian_tracker/obstacle_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ObstacleClass:
1717
def __init__(self, obstacle_msg, top_down, measurement_noise_cov, error_cov_post, process_noise_cov):
1818
'''Initialize with an Obstacle msg and an assigned id'''
1919
self.msg = obstacle_msg
20-
self.msg.id = uuid.uuid4()
20+
self.msg.uuid = uuid.uuid4()
2121
position = np.array([[obstacle_msg.position.x, obstacle_msg.position.y, obstacle_msg.position.z]]).T # shape 3*1
2222
velocity = np.array([[obstacle_msg.velocity.x, obstacle_msg.velocity.y, obstacle_msg.velocity.z]]).T
2323

0 commit comments

Comments
 (0)