MCPcopy Create free account
hub / github.com/PJLab-ADG/OASim / model_move_step

Method model_move_step

hmi/routeEdit/gui.py:229–256  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

227 self.timer.start(10)
228
229 def model_move_step(self):
230 if not self.model.tpEnd and self.model.is_gui_running:
231 self.model.moveStep()
232 if self.model.tpStart and self.model.timeStep > 20:
233 self.genNewFrame.emit(self.model.timeStep - 20)
234 if self.model.timeStep % 5 == 0:
235 roadgraph, vehicles = self.model.exportSce()
236 if self.model.tpStart and roadgraph:
237 trajectories = self.planner.plan(
238 self.model.timeStep * 0.1, roadgraph, vehicles
239 )
240 if len(trajectories) == 0:
241 self.showError()
242 self.model.tpEnd = 1
243 # print('Sorry. Route planning failed. Please choose another route.')
244 else:
245 self.model.setTrajectories(trajectories)
246 else:
247 self.model.ego.exitControlMode()
248 if not self.model.tpEnd:
249 self.model.updateVeh()
250 else:
251 self.timer.stop()
252 for i in range(10):
253 self.genNewFrame.emit(self.model.timeStep - 19 + i)
254 self.model.destroy()
255 # sys.exit(1)
256 self.resume()
257
258 def showError(self):
259 msgBox = QMessageBox()

Callers

nothing calls this directly

Calls 9

showErrorMethod · 0.95
resumeMethod · 0.95
exitControlModeMethod · 0.80
moveStepMethod · 0.45
exportSceMethod · 0.45
planMethod · 0.45
setTrajectoriesMethod · 0.45
updateVehMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected