YuqiHuai / SORA-SVL

Local SVL Cloud
132 stars 33 forks source link

Sanfrancisco map exists a problem with SORA-SVL on Windows 10 version #49

Open meng2180 opened 1 year ago

meng2180 commented 1 year ago

Hello, I have tested the SanFrancisco_correct map, but the issue happened when simulating it on Windows 10 version. Particularly, from the beginning of the simulation (or even after clicking Start), LGSVL on Windows only showed EV with gradient background, and without any objects such as buildings, roads.

-SVL OS:Windows 10

image

DreamView seems to be normal, but there still exists a problem with LGSVL, no matter whether I modify the time in LGSVL. image image

YuqiHuai commented 1 year ago

Hi @meng2180 , thanks for posting the issue!

I am not sure what is going on with your specific case and I am unable to diagnose this problem at this moment. I have been using https://github.com/MingfeiCheng/AV-Fuzzer and I believe he is also using SanFrancisco_correct. I haven't run into problems running this implementation of AV-Fuzzer.

meng2180 commented 1 year ago

Hi @meng2180 , thanks for posting the issue!

I am not sure what is going on with your specific case and I am unable to diagnose this problem at this moment. I have been using https://github.com/MingfeiCheng/AV-Fuzzer and I believe he is also using SanFrancisco_correct. I haven't run into problems running this implementation of AV-Fuzzer.

Thanks for your reply! I just used a simple code to run the SanFrancisco_correct map (OS:Windows 10), below is the code I run (I run the same code on Ubuntu and the lgsvl works fine) :

from datetime import datetime
from environs import Env
import random
import lgsvl

'''
LGSVL__AUTOPILOT_0_HOST             IP address of the computer running the bridge to connect to
LGSVL__AUTOPILOT_0_PORT             Port that the bridge listens on for messages
LGSVL__AUTOPILOT_0_VEHICLE_CONFIG   Vehicle configuration to be loaded in Dreamview (Capitalization and spacing must match the dropdown in Dreamview)
LGSVL__AUTOPILOT_HD_MAP             HD map to be loaded in Dreamview (Capitalization and spacing must match the dropdown in Dreamview)
LGSVL__MAP                          ID of map to be loaded in Simulator
LGSVL__RANDOM_SEED                  Simulation random seed
LGSVL__SIMULATION_DURATION_SECS     How long to run the simulation for
LGSVL__SIMULATOR_HOST               IP address of computer running simulator (Master node if a cluster)
LGSVL__SIMULATOR_PORT               Port that the simulator allows websocket connections over
LGSVL__VEHICLE_0                    ID of EGO vehicle to be loaded in Simulator
'''

env = Env()

SIMULATOR_HOST = env.str("LGSVL__SIMULATOR_HOST", "127.0.0.1")
SIMULATOR_PORT = env.int("LGSVL__SIMULATOR_PORT", 8181)
BRIDGE_HOST = env.str("LGSVL__AUTOPILOT_0_HOST", "172.19.168.253")
BRIDGE_PORT = env.int("LGSVL__AUTOPILOT_0_PORT", 9090)

LGSVL__AUTOPILOT_HD_MAP = env.str("LGSVL__AUTOPILOT_HD_MAP", "SanFrancisco")
LGSVL__AUTOPILOT_0_VEHICLE_CONFIG = env.str("LGSVL__AUTOPILOT_0_VEHICLE_CONFIG", 'Lincoln2017MKZ')
LGSVL__SIMULATION_DURATION_SECS = 1800.0
LGSVL__RANDOM_SEED = env.int("LGSVL__RANDOM_SEED", 5472)

vehicle_conf = env.str("LGSVL__VEHICLE_0", lgsvl.wise.DefaultAssets.ego_lincoln2017mkz_apollo6_modular)
scene_name = env.str("LGSVL__MAP", '12da60a7-2fc9-474d-a62a-5cc08cb97fe8')
sim = lgsvl.Simulator(SIMULATOR_HOST, SIMULATOR_PORT)
try:
    print("Loading map {}...".format(scene_name))
    sim.load(scene_name, LGSVL__RANDOM_SEED) # laod map with random seed
except Exception:
    if sim.current_scene == scene_name:
        sim.reset()
    else:
        sim.load(scene_name)

sim.set_date_time(datetime(2020, 3, 22, 19, 0, 0, 0), True)

spawns = sim.get_spawn()
spawn_index = LGSVL__RANDOM_SEED % len(spawns)

state = lgsvl.AgentState()
state.transform = spawns[spawn_index]  # TODO some sort of Env Variable so that user/wise can select from list
print("Loading vehicle {}...".format(vehicle_conf))
ego = sim.add_agent(vehicle_conf, lgsvl.AgentType.EGO, state)

print("Connecting to bridge...")

ego.connect_bridge(BRIDGE_HOST, BRIDGE_PORT)

def on_collision(agent1, agent2, contact):
    raise Exception("{} collided with {}".format(agent1, agent2))
    sys.exit()

ego.on_collision(on_collision)

dv = lgsvl.dreamview.Connection(sim, ego, BRIDGE_HOST)
dv.set_hd_map(LGSVL__AUTOPILOT_HD_MAP)
dv.set_vehicle(LGSVL__AUTOPILOT_0_VEHICLE_CONFIG)

destination_index = LGSVL__RANDOM_SEED % len(spawns[spawn_index].destinations)
destination = spawns[spawn_index].destinations[destination_index] # TODO some sort of Env Variable so that user/wise can select from list

default_modules = [
    'Localization',
    'Transform',
    'Routing',
    'Prediction',
    'Planning',
    'Control',
    'Recorder'
]

dv.disable_apollo()
dv.setup_apollo(destination.position.x, destination.position.z, default_modules)
print("adding npcs")
sim.add_random_agents(lgsvl.AgentType.NPC)
sim.add_random_agents(lgsvl.AgentType.PEDESTRIAN)
sim.run(LGSVL__SIMULATION_DURATION_SECS)`
YuqiHuai commented 1 year ago

Hi @meng2180 . Looks like you are using the right map id. Unfortunately, I am not sure about how to deal with this because I didn't run into this problem. I have been using Ubuntu but I don't know why it wouldn't work on Windows.