Skip to content

Commit 2a69605

Browse files
committed
Yaml file updates to show all available planners
1 parent a146a92 commit 2a69605

4 files changed

Lines changed: 10 additions & 70 deletions

File tree

GEMstack/onboard/planning/trajectory_planning_component.py

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -684,68 +684,3 @@ def update(self, state: AllState):
684684
print('[DEBUG] Current Velocity of the Car: LOOK!', curr_v, self.desired_speed)
685685
print("[DEBUG] YieldTrajectoryPlanner.update: Returning trajectory with", len(traj.points), "points.")
686686
return traj
687-
688-
689-
690-
class SplinePlanner(Component):
691-
"""Follows route by smoothing coarse waypoints into a quintic spline."""
692-
def __init__(self):
693-
super().__init__()
694-
self.route_progress = None
695-
self.t_last = None
696-
697-
# how far ahead to plan (m), and sampling speed & dt
698-
self.lookahead_dist = 10.0
699-
self.v_des = 2.0
700-
self.dt = 0.02
701-
702-
# the spline engine
703-
self._spline = QuinticHermiteSplinePlanner(self.v_des, self.dt)
704-
705-
def state_inputs(self):
706-
return ['all']
707-
708-
def state_outputs(self):
709-
return ['trajectory']
710-
711-
def rate(self):
712-
return 10.0 # Hz
713-
714-
def update(self, state: AllState) -> Trajectory:
715-
t = state.t
716-
if self.t_last is None:
717-
self.t_last = t
718-
719-
# keep route_progress up to date
720-
veh = state.vehicle
721-
curr = np.array([veh.pose.x, veh.pose.y])
722-
723-
if self.route_progress is None:
724-
self.route_progress = 0.0
725-
_, new_param = state.route.closest_point_local(
726-
curr.tolist(),
727-
(self.route_progress - 5.0,
728-
self.route_progress + 5.0)
729-
)
730-
self.route_progress = new_param
731-
732-
# extract a look-ahead segment from the route
733-
seg: Path = state.route.trim(
734-
self.route_progress,
735-
self.route_progress + self.lookahead_dist
736-
)
737-
738-
pts_raw: List[List[float]] = [
739-
list(pt) for pt in seg.points
740-
]
741-
742-
spline_pts, spline_times = self._spline.build(pts_raw)
743-
744-
traj = Trajectory(
745-
frame = seg.frame,
746-
points = spline_pts.tolist(),
747-
times = spline_times.tolist()
748-
)
749-
750-
self.t_last = t
751-
return traj

launch/inspection.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ drive:
2020
state_machine: ['IDLE', 'NAV', 'INSPECT', 'FINISH']
2121
# save_lidar_data : capture_lidar_camera_data.SaveInspectionData
2222
motion_planning: longitudinal_planning.YieldTrajectoryPlanner
23+
# motion_planning: trajectory_planning_component.LongitudinalPlanner
24+
# motion_planning: trajectory_planning_component.QuinticSplineScurveTrajectoryPlanner
2325
# type: RouteToTrajectoryPlanner
2426
# args: [null] #desired speed in m/s. If null, this will keep the route untimed for the trajectory tracker
2527
trajectory_tracking:

launch/parking_simulation.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ drive:
2121
route_planning_component:
2222
type: RoutePlanningComponent
2323
motion_planning: longitudinal_planning.YieldTrajectoryPlanner
24+
# motion_planning: trajectory_planning_component.LongitudinalPlanner
25+
# motion_planning: trajectory_planning_component.QuinticSplineScurveTrajectoryPlanner
2426
# type: RouteToTrajectoryPlanner
2527
# args: [null] #desired speed in m/s. If null, this will keep the route untimed for the trajectory tracker
2628
trajectory_tracking:
@@ -104,6 +106,8 @@ variants:
104106
route_planning_component:
105107
type: RoutePlanningComponent
106108
motion_planning: longitudinal_planning.YieldTrajectoryPlanner
109+
# motion_planning: trajectory_planning_component.LongitudinalPlanner
110+
# motion_planning: trajectory_planning_component.QuinticSplineScurveTrajectoryPlanner
107111
trajectory_tracking:
108112
type: pure_pursuit.PurePursuitTrajectoryTracker
109113
args: {desired_speed: 2.5} #approximately 5mph

launch/planning.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ drive:
5353
desired_speed: 2.0
5454
deceleration: 2.0
5555
emergency_brake: 8.0
56-
# motion_planning: longitudinal_planning.YieldTrajectoryPlanner
57-
# motion_planning: yield_spline_planner.SplinePlanner
56+
# motion_planning: trajectory_planning_component.QuinticSplineScurveTrajectoryPlanner
5857
log:
5958
# Specify the top-level folder to save the log files. Default is 'logs'
6059
#folder : 'logs'
@@ -142,7 +141,7 @@ variants:
142141

143142
planning_component_example:
144143
type: PlanningComponentExample
145-
144+
146145
route_planning_component:
147146
type: RoutePlanningComponentExample
148147

@@ -152,8 +151,8 @@ variants:
152151
desired_speed: 2.0
153152
deceleration: 2.0
154153
emergency_brake: 8.0
155-
# motion_planning: longitudinal_planning.YieldTrajectoryPlanner
156-
# motion_planning: yield_spline_planner.SplinePlanner
154+
155+
# motion_planning: trajectory_planning_component.QuinticSplineScurveTrajectoryPlanner
157156

158157
trajectory_tracking:
159158
type: pure_pursuit.PurePursuitTrajectoryTracker

0 commit comments

Comments
 (0)