@@ -39,27 +39,9 @@ def update(self, state: AllState):
3939 if state .mission_plan .planner_type .value == PlannerEnum .PARKING .value :
4040 print ("I am in PARKING mode" )
4141 # Return a route after doing some processing based on mission plan REMOVE ONCE OTHER PLANNERS ARE IMPLEMENTED
42- base_path = os .path .dirname (__file__ )
43- file_path = os .path .join (base_path , "../../knowledge/routes/forward_15m_extra.csv" )
44-
45- waypoints = np .loadtxt (file_path , delimiter = ',' , dtype = float )
46- if waypoints .shape [1 ] == 3 :
47- waypoints = waypoints [:,:2 ]
48- print ("waypoints" , waypoints )
49- self .route = Route (frame = ObjectFrameEnum .START ,points = waypoints .tolist ())
42+
5043 elif state .mission_plan .planner_type .value == PlannerEnum .RRT_STAR .value :
5144 print ("I am in RRT mode" )
52- start = (state .vehicle .pose .x + 1 , state .vehicle .pose .y + 1 )
53- goal = (state .mission_plan .goal_x , state .mission_plan .goal_y ) #When we implement kinodynamic, we need to include target_yaw also
54- x_bounds = (0 ,20 )
55- y_bounds = (0 ,20 )
56- step_size = 1.0
57- max_iter = 2000
58- occupancy_grid = np .zeros ((20 , 20 ), dtype = int )
59- occupancy_grid [5 :10 , 5 :10 ] = 1
60- self .planner = RRTStar (start , goal , x_bounds , y_bounds , max_iter = max_iter , step_size = step_size , vehicle_width = 1 , occupancy_grid = occupancy_grid )
61- rrt_resp = self .planner .plan ()
62- self .route = Route (frame = ObjectFrameEnum .START , points = rrt_resp )
6345 else :
6446 print ("Unknown mode" )
6547
0 commit comments