Skip to content

Commit f021b81

Browse files
committed
update
1 parent 0559e86 commit f021b81

6 files changed

Lines changed: 35 additions & 26 deletions

File tree

GEMstack/onboard/planning/leave_parking_trajectory_planning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def update(self, state: AllState):
5454
vehicle = state.vehicle
5555
roadgraph = state.roadgraph
5656

57-
print('Input:')
57+
print('Input states:')
5858
print(intent)
5959
print(mission)
6060

@@ -74,7 +74,7 @@ def update(self, state: AllState):
7474
intent.intent = VehicleIntentEnum.DRIVING
7575
mission.type = MissionEnum.DRIVE
7676

77-
print('Output:')
77+
print('Output states:')
7878
print(intent)
7979
print(mission)
8080

GEMstack/onboard/planning/longitudinal_planning.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def update(self, state: AllState):
303303
mission = state.mission
304304
t = state.t
305305

306-
print('Input:')
306+
print('Input states:')
307307
print(mission)
308308

309309
traj = None
@@ -405,7 +405,9 @@ def update(self, state: AllState):
405405
zero_path = [[0, 0, 0]]
406406
traj = Trajectory(frame=frame, points=zero_path, times=[0])
407407

408-
print('Output:')
408+
print('Output states:')
409409
print(mission)
410+
print('Trajectory:')
411+
print(traj)
410412

411413
return traj, mission

GEMstack/onboard/planning/mission_planning.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
class SummoningMissionPlanner(Component):
11+
def __init__(self):
12+
self.count = 0
13+
1114
def state_inputs(self):
1215
return ['all']
1316

@@ -18,16 +21,20 @@ def rate(self):
1821
return 0.5
1922

2023
def update(self, state: AllState):
24+
self.count += 1
25+
print('Counting:', self.count)
26+
2127
task = state.task
2228
mission = state.mission
2329

24-
print('Input:')
30+
print('Input states:')
2531
print(task)
2632
print(mission)
2733

2834
# TODO: Modify to a GET request to get task phase from the server
2935
if task.phase == TaskEnum.IDLE:
30-
task.phase = TaskEnum.START
36+
if self.count == 3:
37+
task.phase = TaskEnum.START
3138

3239
elif mission.type == MissionEnum.IDLE and task.phase == TaskEnum.START:
3340
mission.type = MissionEnum.PLAN
@@ -40,7 +47,7 @@ def update(self, state: AllState):
4047

4148
# TODO: POST update status to the server
4249

43-
print('Output:')
50+
print('Output states:')
4451
print(task)
4552
print(mission)
4653

GEMstack/onboard/planning/parking_planning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def update(self, state: AllState):
3434
intent = state.intent
3535
roadgraph = state.roadgraph
3636

37-
print('Input:')
37+
print('Input states:')
3838
print(intent)
3939
print(mission)
4040

@@ -44,7 +44,7 @@ def update(self, state: AllState):
4444
elif mission.type == MissionEnum.UNPARK:
4545
intent = leave_parking_plan(roadgraph)
4646

47-
print('Output:')
47+
print('Output states:')
4848
print(intent)
4949

5050
return intent

GEMstack/onboard/planning/parking_trajectory_planning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def update(self, state: AllState):
5555
vehicle = state.vehicle
5656
roadgraph = state.roadgraph
5757

58-
print('Input:')
58+
print('Input states:')
5959
print(intent)
6060
print(mission)
6161

@@ -75,7 +75,7 @@ def update(self, state: AllState):
7575
intent.intent = VehicleIntentEnum.IDLE
7676
mission.type = MissionEnum.IDLE
7777

78-
print('Output:')
78+
print('Output states:')
7979
print(intent)
8080
print(mission)
8181

GEMstack/onboard/planning/route_planning.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,25 @@ def update(self, state: AllState):
155155
route = state.route
156156
mission = state.mission
157157

158-
print('Input:')
158+
print('Input states:')
159159
print(mission)
160160

161161
if mission.type == MissionEnum.PLAN:
162162
mission.type = MissionEnum.UNPARK
163163
print('Output:')
164164
print(mission)
165-
return self.route, mission
166-
elif route:
167-
pass
168-
# else: # avoid error
169-
# route = Route(frame=ObjectFrameEnum.START,points=[[0, 0],[0.1, 0], [0.2, 0]])
165+
route = self.route
170166

171-
print('Output:')
167+
elif route is None:
168+
route = Route(frame=ObjectFrameEnum.START, points=[[0, 0]])
169+
170+
# route = self.route
171+
172+
print('Output states:')
172173
print(mission)
174+
print('Route:')
175+
print(route)
176+
173177
return route, mission
174178

175179

@@ -202,7 +206,7 @@ def update(self, state: AllState):
202206
mission = state.mission
203207
current_pose = state.vehicle.pose
204208

205-
print('Input:')
209+
print('Input states:')
206210
print(mission)
207211

208212
# TODO: get from the server
@@ -241,14 +245,10 @@ def update(self, state: AllState):
241245
else:
242246
raise ValueError("Unknown frame argument")
243247

244-
elif route:
245-
pass
246-
247-
else:
248-
route = Route(frame=ObjectFrameEnum.START,points=[[0, 0],[1, 0], [2, 0]])
249-
return route, mission
248+
elif route is None:
249+
route = Route(frame=ObjectFrameEnum.START,points=[[0, 0]])
250250

251-
print('Output:')
251+
print('Output states:')
252252
print(mission)
253253

254254
return route, mission

0 commit comments

Comments
 (0)