def stop(): print('stopping') # send a short burst if some of them don't arrive for i in range(10): pedalPositionRequest = messages.opendlv_proxy_PedalPositionRequest() pedalPositionRequest.position = 0 session.send(1086, pedalPositionRequest.SerializeToString()) time.sleep(0.1)
print('waitForCar -> waitAtIntersection', seeCar, time.time() - startedWaitingTime) state = 'waitAtIntersection' if state == "waitAtIntersection": pedalPosition = 0 groundSteering = steeringOffset if not seeCar and time.time() - startedWaitingTime > waitTimeout: print('waitAtIntersection -> continueAfterIntersection') state = "continueAfterIntersection" if state == "continueAfterIntersection": if steer == None: continue pedalPosition = calcPedalPosition(steer) groundSteering = calcGroundSteering(steer) if not seeIntersection: totalSteer = 0 print('continueAfterIntersection -> drive') state = "drive" groundSteeringRequest = messages.opendlv_proxy_GroundSteeringRequest() groundSteeringRequest.groundSteering = groundSteering session.send(1090, groundSteeringRequest.SerializeToString()) pedalPositionRequest = messages.opendlv_proxy_PedalPositionRequest() pedalPositionRequest.position = pedalPosition session.send(1086, pedalPositionRequest.SerializeToString())