Skip to content

Commit b47ca38

Browse files
author
Aadarsh
committed
renaming parking goal for clarity + adding on board launch functionality
1 parent ac2a80d commit b47ca38

6 files changed

Lines changed: 17 additions & 21 deletions

File tree

GEMstack/knowledge/defaults/computation_graph.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ components:
2323
outputs: vehicle_lane
2424
- parking_detection:
2525
inputs: obstacles
26-
outputs: [goal, obstacles]
26+
outputs: [parking_goal, obstacles]
2727
- sign_detection:
2828
inputs: [vehicle, roadgraph]
2929
outputs: roadgraph.signs

GEMstack/onboard/perception/parking_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def state_inputs(self) -> list:
7676
return ['obstacles']
7777

7878
def state_outputs(self) -> list:
79-
return ['goal', 'obstacles']
79+
return ['parking_goal', 'obstacles']
8080

8181

8282
def visualize(self,

GEMstack/onboard/planning/parking_component.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ def update(self, state: AllState):
2424
# Calculate elapsed time since initialization.
2525
elapsed_time = time.time() - self.start_time
2626

27-
# Reading goal from state
28-
# print(f"\n AllState (parking goal): {state.goal} \n")
29-
# print(f"AllState (parking obstacles): {state.obstacles} \n")
30-
3127
# After a goal is detected, change the mission plan to use PARKING.
32-
if state.goal:
28+
if state.parking_goal:
3329
print("\n Parking goal available. Entering PARKING mode......")
34-
mission_plan = MissionObjective(PlannerEnum.PARKING, state.goal)
30+
mission_plan = MissionObjective(PlannerEnum.PARKING, state.parking_goal)
3531
else:
3632
print("\n Entering SCANNING mode......")
3733
mission_plan = MissionObjective(PlannerEnum.SCANNING)

GEMstack/onboard/planning/parking_route_planner.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ def __init__(self, vehicle=None, obstacles=None, actions=None):
3636
self._vehicle = None
3737

3838
# settings
39-
self.T = settings.get("run.drive.planning.route_planning_component.dubins.integrator.time_step", 1.5)
40-
self.dt = settings.get("run.drive.planning.route_planning_component.dubins.integrator.dt", .25)
41-
self.max_v = settings.get("run.drive.planning.route_planning_component.dubins.actions.max_velocity", 0.75)
42-
self.max_turn_rate = settings.get("run.drive.planning.route_planning_component.dubins.actions.max_turn_rate", 0.3)
43-
self.tolerance = settings.get("run.drive.planning.route_planning_component.dubins.tolerance", 0.5)
44-
self.heuristic_string = settings.get("run.drive.planning.route_planning_component.astar.heuristic", "reeds_shepp")
39+
self.T = settings.get("run.drive.planning._route_planner.dubins.integrator.time_step", 1.5)
40+
self.dt = settings.get("run.drive.planning._route_planner.dubins.integrator.dt", .25)
41+
self.max_v = settings.get("run.drive.planning._route_planner.dubins.actions.max_velocity", 0.75)
42+
self.max_turn_rate = settings.get("run.drive.planning._route_planner.dubins.actions.max_turn_rate", 0.3)
43+
self.tolerance = settings.get("run.drive.planning._route_planner.dubins.tolerance", 0.5)
44+
self.heuristic_string = settings.get("run.drive.planning._route_planner.astar.heuristic", "reeds_shepp")
4545

4646
self.vehicle = DubinsCar() #x = (tx,ty,theta) and u = (fwd_velocity,turnRate).
4747
self.vehicle_sim = DubinsCarIntegrator(self.vehicle, self.T, self.dt)
@@ -255,7 +255,7 @@ def __init__(self):
255255
# self.planner = ParkingSolverSecondOrderDubins()
256256
self.planner = ParkingSolverFirstOrderDubins()
257257

258-
self.iterations = settings.get("run.drive.planning.route_planning_component.astar.iterations", 200)
258+
self.iterations = settings.get("run.drive.planning._route_planner.astar.iterations", 200)
259259

260260
def state_inputs(self):
261261
return ['all']
@@ -335,7 +335,7 @@ def update(self, state : AllState) -> Route:
335335
all_obstacles = {**agents, **obstacles}
336336
# print(f"Obstacles {obstacles}")
337337
print(f"Agents {agents}")
338-
goal_pose = state.goal
338+
goal_pose = state.parking_goal
339339
assert goal_pose.frame == ObjectFrameEnum.CURRENT
340340
print("Checking VALUE: ", state.start_vehicle_pose)
341341
print("Checking VALUE: ", state.vehicle)

GEMstack/onboard/planning/route_planning_component.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def rate(self):
3535
def update(self, state: AllState):
3636

3737
if state.mission_plan.type.name == "PARKING" and not self.compute_parking_route:
38-
print("I am in BRAKING mode")
38+
# print("I am in BRAKING mode")
3939

4040
desired_points = [(state.vehicle.pose.x, state.vehicle.pose.y),
4141
(state.vehicle.pose.x, state.vehicle.pose.y)]
@@ -48,7 +48,7 @@ def update(self, state: AllState):
4848
return desired_path
4949

5050
elif state.mission_plan.type.name == "PARKING" and self.compute_parking_route and not self.done_computing:
51-
print("I am in PARKING mode")
51+
# print("I am in PARKING mode")
5252
state.vehicle.pose.yaw = 0 # needed this to avoid a weird error in the parking planner
5353

5454
if not self.already_computed:
@@ -58,11 +58,11 @@ def update(self, state: AllState):
5858
self.route = self.route.to_frame(ObjectFrameEnum.START, current_pose=state.vehicle.pose, start_pose_abs=state.start_vehicle_pose)
5959
self.planner.visualize_trajectory(self.route)
6060
self.already_computed = True
61-
61+
self.route.points = self.route.points[:-2] # temporary fix to avoid going too far into the parking space, next perception PR will resolve
6262
return self.route
6363

6464
elif state.mission_plan.type.name == "SCANNING":
65-
print("I am in SCANNING mode")
65+
# print("I am in SCANNING mode")
6666
desired_points = [(state.vehicle.pose.x, state.vehicle.pose.y),
6767
(state.vehicle.pose.x + 1, state.vehicle.pose.y)]
6868
desired_path = Path(ObjectFrameEnum.START, desired_points)

GEMstack/state/all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class AllState(SceneState):
2424
agent_intents : Dict[str,AgentIntentMixture] = field(default_factory=dict)
2525
relations : List[EntityRelation] = field(default_factory=list)
2626
predicates : PredicateValues = field(default_factory=PredicateValues)
27-
goal: ObjectPose = None
27+
parking_goal: ObjectPose = None
2828

2929
# planner-output state
3030
mission : MissionObjective = field(default_factory=MissionObjective)

0 commit comments

Comments
 (0)