Skip to content

Commit 9882b70

Browse files
committed
Test: cannot trace the route due to offset
1 parent d7b3ddf commit 9882b70

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

GEMstack/onboard/planning/route_planning_component.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,27 @@ def update(self, state: AllState):
280280
else:
281281
# COMMENT OUT BECAUSE SOMETIMES REROUTES COMPLETELY DIFFERENT PATHS
282282
# self.reedssheppparking.find_collision_free_trajectory(self.parked_cars, self.current_pose, True)
283-
self.waypoints_to_go = self.reedssheppparking.waypoints_to_go
283+
284+
self.waypoints_to_go = self.reedssheppparking.waypoints_to_go
284285
self.route = Route(frame=ObjectFrameEnum.START, points=self.waypoints_to_go.tolist())
285-
# print("Route:", self.route)
286286

287-
print(state.trajectory)
287+
# waypoints_to_go = self.reedssheppparking.waypoints_to_go
288+
# # Remove the waypoints from the beginning to the current position
289+
# current_closest_index = 0
290+
# for i, waypoint in enumerate(waypoints_to_go):
291+
# if math.dist((state.vehicle.pose.x, state.vehicle.pose.y), waypoint[:2]) < 1.0:
292+
# current_closest_index = i
293+
# self.waypoints_to_go = waypoints_to_go[current_closest_index:]
294+
295+
# self.route = Route(frame=ObjectFrameEnum.START, points=self.waypoints_to_go.tolist())
296+
# print("Route:", self.route)
288297

289298
# Stop if the current state is close to the goal
290299
# TODO: Move the parameter to config file
291-
if (state.vehicle.pose.x - self.waypoints_to_go[-1][0])**2 < 1.0:
292-
print("I am close to the goal, stop.")
293-
self.parking_finished = True
300+
# if (state.vehicle.pose.x - self.waypoints_to_go[-1][0])**2 < 0.5:
301+
# if len(self.waypoints_to_go) < 3:
302+
# print("I am close to the goal, stop.")
303+
# self.parking_finished = True
294304

295305

296306
else:

GEMstack/onboard/planning/summoning_mission_planning.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def update(self, state: AllState):
111111
goal_location = [10, 0] # for simlulation test only
112112
goal_frame = 'start'
113113
else:
114-
goal_location = [1, 0] # for simulation test only
114+
goal_location = [10, 0] # for simulation test only
115+
# goal_location = [1, 0] # for simulation test only
115116
goal_frame = 'start'
116117

117118

0 commit comments

Comments
 (0)