Skip to content

Commit 5a2afe8

Browse files
weird simulation behavior
1 parent c356e7a commit 5a2afe8

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

GEMstack/onboard/planning/parking_planning.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ def neighbors(self, node):
137137
next_state = np.append(next_state, node[5] + self.vehicle_sim.T)
138138
next_state = np.round(next_state, 3)
139139
if self.is_valid_neighbor([next_state]):
140-
print(f"Accepted: {next_state}")
140+
# print(f"Accepted: {next_state}")
141141
neighbors.append(tuple(next_state))
142-
else:
143-
print(f"Rejected (collision): {next_state}")
142+
# else:
143+
# print(f"Rejected (collision): {next_state}")
144144
return neighbors
145145

146146
def is_valid_neighbor(self, path):
@@ -196,8 +196,8 @@ def state_to_polygon(self, state):
196196

197197
def generate_action_set():
198198
return [
199-
(1.0, -0.3), (1.0, 0.0), (1.0, 0.3),
200-
(-1.0, -0.3), (-1.0, 0.0), (-1.0, 0.3)
199+
(0.25, -0.3), (0.25, 0.0), (0.25, 0.3),
200+
(-0.25, -0.3), (-0.25, 0.0), (-0.25, 0.3)
201201
]
202202

203203
# @TODO Need to change the functions here to use VehicleState
@@ -250,6 +250,7 @@ def is_goal_reached(self, current: List[float], goal: List[float]):
250250
# return np.linalg.norm(np.array([current[0], current[1]]) - np.array([goal[0], goal[1]])) < 0.5
251251
pos_dist = np.linalg.norm([current[0] - goal[0], current[1] - goal[1]])
252252
yaw_dist = abs((current[2] - goal[2] + np.pi) % (2 * np.pi) - np.pi)
253+
print("Reach The Goal")
253254
return pos_dist < 0.5 and yaw_dist < 0.3
254255

255256
def heuristic_cost_estimate(self, state_1, state_2):
@@ -314,10 +315,10 @@ def neighbors(self, node):
314315
next_state = np.append(next_state, node[3] + self.vehicle_sim.T)
315316
next_state = np.round(next_state, 3)
316317
if self.is_valid_neighbor([next_state]):
317-
print(f"Accepted: {next_state}")
318+
# print(f"Accepted: {next_state}")
318319
neighbors.append(tuple(next_state))
319-
else:
320-
print(f"Rejected first order (collision): {next_state}")
320+
# else:
321+
# print(f"Rejected first order (collision): {next_state}")
321322
return neighbors
322323

323324
def is_valid_neighbor(self, path):

GEMstack/onboard/planning/parking_route_planner.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
from typing import List, Tuple, Union, Dict
22
from ..component import Component
33
from ...state import AllState, VehicleState, Path, Trajectory, Route, ObjectFrameEnum, AgentState, Obstacle, ObjectPose, PhysicalObject
4-
from ...utils import serialization, settings
5-
from ...mathutils.transforms import vector_madd
6-
from ...mathutils import quad_root
74
from GEMstack.mathutils.dubins import DubinsCar, SecondOrderDubinsCar, DubinsCarIntegrator
85
from ...mathutils.dynamics import IntegratorControlSpace
96
from ...mathutils import collisions
107
from .astar import AStar
11-
from .longitudinal_planning import longitudinal_plan
12-
from testing.reeds_shepp_path import path_length
13-
import reed_shepp
8+
# from testing.reeds_shepp_path import path_length
9+
from .reed_shepp import get_optimal_path
10+
from .reed_shepp import path_length
11+
1412

1513

1614
import numpy as np
@@ -296,9 +294,9 @@ def reed_shepp(self, state_1, state_2):
296294
goal = (x2, y2, theta2)
297295

298296
# Calculate Reeds-Shepp path length
299-
path = reed_shepp.get_optimal_path(start, goal)
297+
path = get_optimal_path(start, goal)
300298

301-
return reed_shepp.path_length(path) # Using turning radius of 1.0
299+
return path_length(path) # Using turning radius of 1.0
302300

303301
def terminal_cost_estimate(self, state_1, state_2):
304302
"""computes the 'direct' distance between two (x,y) tuples"""

launch/parking.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ variants:
102102
type: StaticRoutePlanner
103103
args: [!relative_path '../GEMstack/knowledge/routes/parking.csv','start']
104104
motion_planning:
105-
type: parking_planning.ParkingPlanner
105+
type: parking_route_planner.ParkingPlanner
106106

107107

108108

0 commit comments

Comments
 (0)