Skip to content

Commit fd62f11

Browse files
committed
add yaml file for reedshepp params
1 parent dac4447 commit fd62f11

2 files changed

Lines changed: 44 additions & 21 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# vehicle info
2+
vehicle:
3+
vehicle_dim: [1.7, 3.2] # in meter
4+
vehicle_turning_radius: 3.657
5+
# algorithm parameters
6+
reeds_shepp_parking:
7+
shift_from_center_to_rear_axis: 1.25 # in meter
8+
search_step_size: 0.1 # in meter
9+
cloest: False # If True, the closest parking spot will be selected, otherwise the farthest one will be selected
10+
parking_lot_axis_shift_margin: 2.44 # in meter
11+
search_bound_threshold: 0.5
12+
clearance_step: 0.5
13+
add_static_vertical_curb_as_obstacle: True
14+
add_static_horizontal_curb_as_obstacle: True
15+
static_horizontal_curb_size: [2.44, 0.5]
16+
static_vertical_curb_size: [2.44, 24.9]
17+
compact_parking_spot_size: [2.44, 4.88] # US Compact Space for parking (2.44, 4.88)
18+

GEMstack/onboard/planning/reeds_shepp_parking.py

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
from shapely.geometry import Polygon
66
from typing import List, Tuple
77
import math
8+
import yaml
9+
810

911
Pose = Tuple[float, float, float] # (x, y, yaw)
1012
Dims = Tuple[float, float] # (width, length)
1113
Obstacle = Tuple[float, float, float, Dims] # (x, y, yaw, (width, length))
1214

1315
class ReedsSheppParking:
14-
def __init__(self, vehicle_pose = (0.0, 0.0, 0.0), vehicle_dims = (1.7, 3.2), compact_parking_spot_size = (2.44, 4.88),
16+
def __init__(self, vehicle_pose = None, vehicle_dims = (1.7, 3.2), compact_parking_spot_size = None,
1517
shift_from_center_to_rear_axis = 1.25, search_step_size = 0.1, closest = False, parking_lot_axis_shift_margin = 2.44,
1618
search_bound_threshold = 0.5,
1719
vehicle_turning_radius = 3.657,
@@ -29,36 +31,39 @@ def __init__(self, vehicle_pose = (0.0, 0.0, 0.0), vehicle_dims = (1.7, 3.2), co
2931
self.detected_cones = detected_cones
3032
self.parked_cars = []
3133
self.objects_to_avoid_collisions = []
34+
35+
yaml_path = "GEMstack/knowledge/defaults/ReedsShepp_param.yaml"
36+
with open(yaml_path,'r') as file:
37+
params = yaml.safe_load(file)
38+
39+
3240

33-
self.static_horizontal_curb_xy_coordinates = static_horizontal_curb_xy_coordinates
34-
self.static_horizontal_curb_size = static_horizontal_curb_size
35-
self.add_static_vertical_curb_as_obstacle = add_static_vertical_curb_as_obstacle
41+
self.static_horizontal_curb_xy_coordinates = None
42+
self.static_horizontal_curb_size = params['reeds_shepp_parking']['static_horizontal_curb_size']
43+
self.add_static_vertical_curb_as_obstacle = params['reeds_shepp_parking']['add_static_vertical_curb_as_obstacle']
3644

37-
self.static_vertical_curb_size = static_vertical_curb_size
38-
self.static_vertical_curb_xy_coordinates = static_vertical_curb_xy_coordinates
39-
self.add_static_horizontal_curb_as_obstacle = add_static_horizontal_curb_as_obstacle
45+
self.static_vertical_curb_size = params['reeds_shepp_parking']['static_vertical_curb_size']
46+
self.static_vertical_curb_xy_coordinates = []
47+
self.add_static_horizontal_curb_as_obstacle = params['reeds_shepp_parking']['add_static_horizontal_curb_as_obstacle']
4048

41-
self.all_parking_spots_in_parking_lot_var = all_parking_spots_in_parking_lot
49+
self.all_parking_spots_in_parking_lot_var = []
4250

43-
self.vehicle_pose = vehicle_pose
51+
self.vehicle_pose = [0,0,0] # default
4452
self.x_axis_of_search = self.vehicle_pose[0]
4553

4654

47-
self.vehicle_dims = vehicle_dims
48-
self.compact_parking_spot_size = compact_parking_spot_size # US Compact Space for parking (2.44, 4.88)
49-
self.shift_from_center_to_rear_axis = shift_from_center_to_rear_axis # TODO: Check
50-
self.search_step_size = search_step_size
51-
self.parking_lot_axis_shift_margin = parking_lot_axis_shift_margin
52-
self.search_bound_threshold = search_bound_threshold
55+
self.vehicle_dims = params['vehicle']['vehicle_dim']
56+
self.vehicle_turning_radius = params['vehicle']['vehicle_turning_radius']
57+
self.compact_parking_spot_size = params['reeds_shepp_parking']['compact_parking_spot_size']
58+
self.shift_from_center_to_rear_axis = params['reeds_shepp_parking']['shift_from_center_to_rear_axis'] # TODO: Check
59+
self.search_step_size = params['reeds_shepp_parking']['search_step_size']
60+
self.parking_lot_axis_shift_margin = params['reeds_shepp_parking']['parking_lot_axis_shift_margin']
61+
self.search_bound_threshold = params['reeds_shepp_parking']['search_bound_threshold']
5362
# TODO: Add thrid option: park in the middle
54-
self.closest = closest # If True, the closest parking spot will be selected, otherwise the farthest one will be selected
55-
self.vehicle_turning_radius = vehicle_turning_radius
56-
self.clearance_step = clearance_step
63+
self.closest = params['reeds_shepp_parking']['closest'] # If True, the closest parking spot will be selected, otherwise the farthest one will be selected
64+
self.clearance_step = params['reeds_shepp_parking']['clearance_step']
5765
self.search_axis_direction_var = False
5866

59-
60-
61-
6267

6368

6469
def reeds_shepp_path(self,start_pose, final_pose, step_size=0.1, vehicle_turning_radius=3.657):# Runing

0 commit comments

Comments
 (0)