Skip to content

Commit e2c7a02

Browse files
committed
debug cruising speed
1 parent 29a9d4e commit e2c7a02

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

GEMstack/onboard/planning/longitudinal_planning.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,19 +144,12 @@ def detect_collision(curr_x: float, curr_y: float, curr_v: float, obj: AgentStat
144144
print("The object will pass through our front before we drive normally and reach it")
145145
return False, 0.0
146146

147-
distance_to_move = distance_with_buffer + time_to_pass * obj_v_y
147+
distance_to_move = distance_with_buffer + time_to_pass * obj_v_x
148148

149149
if curr_v**2/(2*distance_to_move) >= COMFORT_DECELERATION:
150150
return True, curr_v**2/(2*distance_to_move)
151-
time_to_max_v = (max_speed - curr_v)/acceleration
152-
153-
if time_to_max_v > time_to_pass:
154-
if curr_v*time_to_pass + 0.5 * acceleration * time_to_pass**2 > distance_to_move:
155-
return False, 0.0
156-
else:
157-
if (max_speed**2 - curr_v**2)/(2*acceleration) + (time_to_pass - time_to_max_v) * max_speed >= distance_to_move:
158-
return False, 0.0
159-
151+
152+
print("Calculating cruising speed")
160153
return True, [distance_to_move, time_to_pass]
161154

162155

@@ -1024,7 +1017,7 @@ def update(self, state : AllState):
10241017
deceleration = 1.5
10251018
print("@@@@@ YIELDING", desired_speed)
10261019
route_yield = route.trim(closest_parameter,closest_parameter + distance_collision)
1027-
traj = longitudinal_plan(route_yield, self.acceleration, deceleration, desired_speed, curr_v)
1020+
traj = longitudinal_plan(route_yield, self.acceleration, deceleration, desired_speed, curr_v, self.planner)
10281021
return traj
10291022
else:
10301023
if detected and deceleration > 0:

launch/pedestrian_detection.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ variants:
102102
visualization: !include "klampt_visualization.yaml"
103103
drive:
104104
perception:
105-
agent_detection : pedestrian_detection.FakePedestrianDetector2D
106-
# agent_detection : OmniscientAgentDetector #this option reads agents from the simulator
105+
# agent_detection : pedestrian_detection.FakePedestrianDetector2D
106+
agent_detection : OmniscientAgentDetector #this option reads agents from the simulator
107107
state_estimation : OmniscientStateEstimator
108108
planning:
109109
motion_planning:

0 commit comments

Comments
 (0)