Skip to content

Commit ea749b1

Browse files
committed
Update planner logic with real-time detection
1 parent 63f0555 commit ea749b1

3 files changed

Lines changed: 1145 additions & 15 deletions

File tree

GEMstack/onboard/planning/racing_planning.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -517,26 +517,26 @@ def update(self, agents: Dict[str, AgentState], vehicle: VehicleState):
517517
for id, agent in agents.items():
518518
if agent.type == AgentEnum.CONE:
519519
# ===== RUNNING ONBOARD =====
520-
cones.append({
521-
'id': id,
522-
'x': agent.pose.x,
523-
'y': agent.pose.y,
524-
'orientation': agent.activity
525-
})
526-
# ===== TESTING ONBOARD in BASIC SIM =====
527-
# if n % 2 == 0:
528-
# curr_activity = 'LEFT'
529-
# elif n % 2 == 1:
530-
# curr_activity = 'RIGHT'
531-
# else:
532-
# curr_activity = 'STANDING'
533520
# cones.append({
534521
# 'id': id,
535522
# 'x': agent.pose.x,
536523
# 'y': agent.pose.y,
537-
# 'orientation': curr_activity
524+
# 'orientation': agent.activity
538525
# })
539-
# n = n + 1
526+
# ===== TESTING ONBOARD in BASIC SIM =====
527+
if n % 2 == 0:
528+
curr_activity = 'LEFT'
529+
elif n % 2 == 1:
530+
curr_activity = 'RIGHT'
531+
else:
532+
curr_activity = 'STANDING'
533+
cones.append({
534+
'id': id,
535+
'x': agent.pose.x,
536+
'y': agent.pose.y,
537+
'orientation': curr_activity
538+
})
539+
n = n + 1
540540

541541
vehicle_dict = {
542542
'position': [vehicle.pose.x, vehicle.pose.y],

0 commit comments

Comments
 (0)