Skip to content

Commit b30ceec

Browse files
committed
merge fix w/ s2025b
1 parent 99ac1fb commit b30ceec

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

GEMstack/onboard/perception/pedestrian_detection.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,12 @@ def agents_overlap(self, curr_agent: AgentState, prev_agent: AgentState) -> bool
381381
# TODO: confirm (z -> l, x -> w, y -> h)
382382

383383
# Extract the corners of the agents:
384-
(x1_min, x1_max), (y1_min, y1_max), (z1_min, z1_max) = curr_agent.bounds() # Bounds of current agent
385-
(x2_min, x2_max), (y2_min, y2_max), (z2_min, z2_max) = prev_agent.bounds() # Bounds of previous agent
384+
x1_min, x1_max = curr_agent.pose.x - curr_agent.dimensions[0] / 2.0, curr_agent.pose.x + curr_agent.dimensions[0] / 2.0
385+
y1_min, y1_max = curr_agent.pose.y, curr_agent.pose.y + curr_agent.dimensions[1] # AGENT STATE CALCULATION
386+
z1_min, z1_max = curr_agent.pose.z - curr_agent.dimensions[2] / 2.0, curr_agent.pose.z + curr_agent.dimensions[2] / 2.0
387+
x2_min, x2_max = prev_agent.pose.x - prev_agent.dimensions[0] / 2.0, prev_agent.pose.x + prev_agent.dimensions[0] / 2.0
388+
y2_min, y2_max = prev_agent.pose.y, prev_agent.pose.y + prev_agent.dimensions[1] # AGENT STATE CALCULATION
389+
z2_min, z2_max = prev_agent.pose.z - prev_agent.dimensions[2] / 2.0, prev_agent.pose.z + prev_agent.dimensions[2] / 2.0
386390

387391
# True if they overlap, false if not
388392
return (
@@ -407,13 +411,13 @@ def create_agent_states(self, obj_centers: List[np.ndarray], obj_dims: List[np.n
407411
# Create agent in current frame:
408412
agents.append(AgentState(
409413
track_id=0, # Temporary
410-
pose=ObjectPose(t=(self.curr_time - self.t_start).total_seconds(), x=obj_centers[idx][0], y=obj_centers[idx][1], z=obj_centers[idx][2] - obj_dims[idx][2], yaw=0,pitch=0,roll=0,frame=ObjectFrameEnum.CURRENT),
414+
pose=ObjectPose(t=(self.curr_time - self.t_start).total_seconds(), x=obj_centers[idx][0], y=obj_centers[idx][1], z=obj_centers[idx][2], yaw=0,pitch=0,roll=0,frame=ObjectFrameEnum.CURRENT),
411415
# Beware: AgentState(PhysicalObject) builds bbox from
412416
# dims [-l/2,l/2] x [-w/2,w/2] x [0,h], not
413417
# [-l/2,l/2] x [-w/2,w/2] x [-h/2,h/2]
414418
# (l, w, h)
415419
# TODO: confirm (z -> l, x -> w, y -> h)
416-
dimensions=(obj_dims[idx][0], obj_dims[idx][1], obj_centers[idx][2] + obj_dims[idx][2]),
420+
dimensions=(obj_dims[idx][2], obj_dims[idx][0], obj_centers[idx][1] + obj_dims[idx][1]),
417421
outline=None,
418422
type=AgentEnum.PEDESTRIAN,
419423
activity=AgentActivityEnum.UNDETERMINED, # Temporary

0 commit comments

Comments
 (0)