Skip to content

Commit f15d948

Browse files
committed
Update cone_detection.py
1 parent 70076ae commit f15d948

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

GEMstack/onboard/perception/cone_detection.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,34 @@ def update(self, vehicle: VehicleState) -> Dict[str, AgentState]:
616616

617617
# If tracking not enabled, return only current frame detections
618618
if not self.enable_tracking:
619+
for agent_id, agent in self.current_agents.items():
620+
p = agent.pose
621+
rospy.loginfo(
622+
f"Agent ID: {agent_id}\n"
623+
f"Pose: (x: {p.x:.3f}, y: {p.y:.3f}, z: {p.z:.3f}, "
624+
f"yaw: {p.yaw:.3f}, pitch: {p.pitch:.3f}, roll: {p.roll:.3f})\n"
625+
f"Velocity: (vx: {agent.velocity[0]:.3f}, vy: {agent.velocity[1]:.3f}, vz: {agent.velocity[2]:.3f})\n"
626+
f"type:{agent.activity}"
627+
)
628+
619629
return self.current_agents
620630

621631
stale_ids = [agent_id for agent_id, agent in self.tracked_agents.items()
622632
if current_time - agent.pose.t > 5.0]
623633
for agent_id in stale_ids:
624634
rospy.loginfo(f"Removing stale agent: {agent_id}\n")
625635
del self.tracked_agents[agent_id]
636+
if self.enable_tracking:
637+
for agent_id, agent in self.tracked_agents.items():
638+
p = agent.pose
639+
rospy.loginfo(
640+
f"Agent ID: {agent_id}\n"
641+
f"Pose: (x: {p.x:.3f}, y: {p.y:.3f}, z: {p.z:.3f}, "
642+
f"yaw: {p.yaw:.3f}, pitch: {p.pitch:.3f}, roll: {p.roll:.3f})\n"
643+
f"Velocity: (vx: {agent.velocity[0]:.3f}, vy: {agent.velocity[1]:.3f}, vz: {agent.velocity[2]:.3f})\n"
644+
f"type:{agent.activity}"
645+
)
646+
626647

627648
return self.tracked_agents
628649

0 commit comments

Comments
 (0)