Exemple #1
0
def reset(location):
    global FPS, show_imgwidth, show_imgheight
    ''' Resets position of car to a specific location '''
    # Same conditions as below |
    dataset = Dataset(rate=FPS,
                      frame=[show_imgwidth, show_imgheight],
                      throttle=True,
                      brake=True,
                      steering=True,
                      location=True,
                      drivingMode=True,
                      speed=True,
                      yawRate=True,
                      time=True,
                      vehicles=True,
                      peds=True,
                      trafficSigns=True)
    #,yawRate=True,time=True,vehicles=True, peds=True, trafficSigns=True, direction=True, reward=True
    #[-1917.06640625, 4595.87255859375, 56.853]
    #-737.1954345703125, 1975.72265625, 133.54100036621094
    #[2723.626953125, 3224.170654296875, 54.402042388916016]
    #827.8175659179688, -1201.2620849609375, 45.51389694213867 街头竞速 没车
    scenario = Scenario(weather='EXTRASUNNY',
                        vehicle='blista',
                        time=[12, 0],
                        drivingMode=-1,
                        location=location)
    client.sendMessage(Config(scenario=scenario, dataset=dataset))
Exemple #2
0
def reset():
    ''' Resets position of car to a specific location '''
    # Same conditions as below |
    dataset = Dataset(rate=10,
                      frame=[320, 160],
                      throttle=True,
                      brake=True,
                      steering=True,
                      location=True,
                      drivingMode=True,
                      speed=True,
                      yawRate=True,
                      time=True,
                      vehicles=True,
                      peds=True,
                      trafficSigns=True,
                      reward=True)
    #,yawRate=True,time=True,vehicles=True, peds=True, trafficSigns=True, direction=True, reward=True
    scenario = Scenario(
        weather='EXTRASUNNY',
        vehicle='blista',
        time=[12, 0],
        drivingMode=[786603, 20.0],
        location=[-2573.13916015625, 3292.256103515625, 13.241103172302246])
    client.sendMessage(Config(scenario=scenario, dataset=dataset))
def reset():
    #Resets position of car to a specific location
    # Same conditions as below |
    dataset = Dataset(rate=60,
                      frame=[1920, 1080],
                      vehicles=True,
                      location=True)
    scenario = Scenario(weather='EXTRASUNNY',
                        vehicle='packer',
                        time=[9, 0],
                        drivingMode=[786603, 20.0])
    client.sendMessage(Config(scenario=scenario, dataset=dataset))
Exemple #4
0
def reset():
    dataset = Dataset(rate=rate,
                      frame=frame,
                      throttle=True,
                      brake=True,
                      steering=True,
                      speed=True,
                      drivingMode=True,
                      location=True)
    scenario = Scenario(weather='EXTRASUNNY',
                        vehicle='voltic',
                        time=[12, 0],
                        drivingMode=[1074528293, max_speed / 1.6],
                        location=[-3000, 2500])
    client.sendMessage(Config(scenario=scenario, dataset=dataset))
Exemple #5
0
def reset():
    ''' Resets position of car to a specific location '''
    # Same conditions as below |
    dataset = Dataset(
        rate=60,
        frame=[800, 600],
        throttle=True,
        brake=True,
        steering=True,
        location=True,
    )  # drivingMode=True)
    scenario = Scenario(weathers='EXTRASUNNY', vehicle='blista',
                        times=[12, 0])  #, drivingMode=[786603, 40.0])
    # , location=[-2573.13916015625, 3292.256103515625, 13.241103172302246])
    client.sendMessage(Config(scenario=scenario, dataset=dataset))
Exemple #6
0
def reset():
    # Resets position of the car to the starting location
    dataset = Dataset(rate=30,
                      frame=frame,
                      throttle=True,
                      brake=True,
                      steering=True,
                      location=True,
                      drivingMode=True)
    scenario = Scenario(weather=weather,
                        vehicle=vehicle,
                        time=time,
                        drivingMode=drivingMode,
                        location=location)
    Client.sendMessage(Config(scenario=scenario, dataset=dataset))
def change_scene(client, dataset_para, scenario_para, local_list, scene_list,
                 i):

    #fd = sys.stdin.fileno()
    #dev = InputDevice('/dev/input/enent2')
    r = select.select([sys.stdin], [], [], 0.01)
    #r = select.select([dev],[],[],0.01)
    rcode = ""
    #print("r",r)
    if len(r[0]) > 0:
        #print("get word:",r[0])
        rcode = sys.stdin.read(1)
        #rcode = dev.read(1)
        print("key word", rcode)
        if rcode == "b":
            scenario_para.location = local_list
            print("trigle b")
            print(scenario_para.location, scenario_para.vehicle,
                  scenario_para.time)
            print(dataset_para.reward, dataset_para.vehicles)
            #client.sendMessage(change_position(dataset=dataset_para,scenario=scenario_para))
            #client.sendMessage(Stop())
            #client.sendMessage(Config(dataset=dataset_para,scenario=scenario_para))
            client.sendMessage(
                change_position(dataset=dataset_para, scenario=scenario_para))
        elif rcode == "c":
            scenario_para.location = scene_list[i]
            #scenario_para.location = local_list
            print("trigle c")
            print(scenario_para.location, scenario_para.vehicle,
                  scenario_para.time)
            print(dataset_para.reward, dataset_para.vehicles)
            #client.sendMessage(change_position(dataset=dataset_para,scenario=scenario_para))
            client.sendMessage(
                Config(dataset=dataset_para, scenario=scenario_para))
            i = i + 1
            local_list = scenario_para.location

    return i, local_list
Exemple #8
0
 def __build_env(self):
     self.__init_scenairo()
     self.__prepare_datasets(open_=False)
     self.__client.sendMessage(Config(scenario=self.__scenario, dataset=self.__dataset))