Skip to content

Commit 2d328a4

Browse files
committed
fixes to get stuff working on board
1 parent 173e14d commit 2d328a4

5 files changed

Lines changed: 21 additions & 18 deletions

File tree

GEMstack/knowledge/defaults/computation_graph.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ components:
5757
outputs: route
5858
- route_planning_component: # one way
5959
inputs: all
60-
outputs: trajectory
60+
outputs: route
6161
- motion_planning:
6262
inputs: all
6363
outputs: trajectory

GEMstack/onboard/planning/longitudinal_planning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def longitudinal_plan(path, acceleration, deceleration, max_speed, current_speed
8989
if DEBUG:
9090
print(f"[DEBUG] Phase 2 - Cruise: distance = {cruise_distance:.2f}")
9191
print(f"[DEBUG] Phase 3 - Final Decel: distance = {final_decel_distance:.2f}")
92-
92+
9393
times = []
9494
for s in s_vals:
9595
if s <= initial_decel_distance: # Phase 1: Initial deceleration to max_speed

GEMstack/onboard/planning/parking_planning.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def vehicle_state_to_first_order(self, vehicle_state: VehicleState) -> Tuple[flo
465465

466466
return (x,y,theta,t)
467467

468-
def update(self, state : AllState) -> Trajectory:
468+
def update(self, state : AllState) -> Route:
469469
"""_summary_
470470
471471
Args:
@@ -511,10 +511,10 @@ def update(self, state : AllState) -> Trajectory:
511511
print("===========================")
512512
print(f"Points: {points}")
513513
print(f"Times: {times}")
514-
# route = Path(frame=vehicle.pose.frame, points=points)
514+
route = Path(frame=vehicle.pose.frame, points=points)
515515
# traj = longitudinal_plan(route, 2, -2, 10, vehicle.v, "milestone")
516516
print(traj)
517-
return traj
517+
return route
518518

519519

520520
from rospy.exceptions import ROSInitException

GEMstack/onboard/planning/route_planning_component.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def state_inputs(self):
2626
return ["all"]
2727

2828
def state_outputs(self) -> List[str]:
29-
return ['trajectory']
29+
return ['route']
3030

3131
def rate(self):
3232
return 10.0 # very high for our computation ability
@@ -44,12 +44,14 @@ def update(self, state: AllState):
4444
if state.mission_plan.planner_type.name == "PARKING":
4545
print("I am in PARKING mode")
4646
# Not sure where I should construct this object
47-
if isinstance(self.planner, StraightLineMotion): # we are transitioning from scanning to parking
47+
# if isinstance(self.planner, StraightLineMotion): # we are transitioning from scanning to parking
4848

49-
# Check if the car is still in motion from scanning behavior
50-
# if it is, we need to stop it before parking
51-
self.planner.brake() # get car totally stopped before parking
52-
state.vehicle.pose.yaw = 0 # needed this to avoid a weird error in the parking planner
49+
# # Check if the car is still in motion from scanning behavior
50+
# # if it is, we need to stop it before parking
51+
52+
# # print("I AM BRAKING")
53+
# self.planner.brake() # get car totally stopped before parking
54+
state.vehicle.pose.yaw = 0 # needed this to avoid a weird error in the parking planner
5355

5456
self.planner = ParkingPlanner()
5557

@@ -72,11 +74,11 @@ def update(self, state: AllState):
7274
# print("Vehicle y:", state.vehicle.pose.y)
7375
# print("Vehicle yaw:", state.vehicle.pose.yaw)
7476
desired_points = [(state.vehicle.pose.x, state.vehicle.pose.y),
75-
(state.vehicle.pose.x + 10, state.vehicle.pose.y)]
77+
(state.vehicle.pose.x + 1, state.vehicle.pose.y)]
7678
desired_path = Path(state.vehicle.pose.frame, desired_points)
7779

7880
# @TODO these are constants we need to get from settings
79-
return longitudinal_plan(desired_path,1,1,3,state.vehicle.v)
81+
return desired_path
8082
# self.planner.update_speed()
8183

8284
# We want to just go straight

launch/parking_detection.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ drive: # Full pipeline on board
3232
planning:
3333
parking_component:
3434
type: ParkingSim
35-
# route_planning_component:
36-
# type: RoutePlanningComponent
37-
# trajectory_tracking:
38-
# type: pure_pursuit.PurePursuitTrajectoryTracker
39-
# print: False
35+
route_planning_component:
36+
type: RoutePlanningComponent
37+
motion_planning: longitudinal_planning.YieldTrajectoryPlanner
38+
trajectory_tracking:
39+
type: pure_pursuit.PurePursuitTrajectoryTracker
40+
print: False
4041
#usually can keep this constant
4142
computation_graph: !include "../GEMstack/knowledge/defaults/computation_graph.yaml"
4243

0 commit comments

Comments
 (0)