-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could this repo now support co-emulation with Apollov7 #15
Comments
Hi, do you have any source for more related information? I haven't heard anything related to this before. |
I realized you meant "co-simulation". Yes, this project is intended to work for co-simulation and I have tried to use this with Apollo 7. |
Hi. I am trying to use Python API to do "co-simulation" with Apollo r7.0.0 branch. I am trying the code snippet at here. I disable the
Have you seen cases like this before? Did you have any additional changes on the Apollo r7.0.0 branch, or this repo, or python snippet? Thank you! |
Hi @GiantSeaweed yes I’ve seen similar problem. Are you using the right mode and the right vehicle on dreamview? |
I do not manually change anything on dreamview. They are all set by the python snippet. The mode is Here is the code: I change the original Am I using the wrong id in import os
import lgsvl
from environs import Env
env = Env()
sim = lgsvl.Simulator(
env.str("LGSVL__SIMULATOR_HOST", lgsvl.wise.SimulatorSettings.simulator_host),
env.int("LGSVL__SIMULATOR_PORT", lgsvl.wise.SimulatorSettings.simulator_port)
)
if sim.current_scene == lgsvl.wise.DefaultAssets.map_borregasave:
sim.reset()
else:
sim.load(lgsvl.wise.DefaultAssets.map_borregasave)
spawns = sim.get_spawn()
state = lgsvl.AgentState()
state.transform = spawns[0]
print("Adding agent")
ego = sim.add_agent(lgsvl.wise.DefaultAssets.ego_lincoln2017mkz_apollo5, lgsvl.AgentType.EGO, state)
ego.connect_bridge(
env.str("LGSVL__AUTOPILOT_0_HOST", lgsvl.wise.SimulatorSettings.bridge_host),
env.int("LGSVL__AUTOPILOT_0_PORT", lgsvl.wise.SimulatorSettings.bridge_port)
)
# Dreamview setup
print('Connecting to dv')
dv = lgsvl.dreamview.Connection(sim, ego, env.str("LGSVL__AUTOPILOT_0_HOST", "127.0.0.1"))
dv.set_hd_map('Borregas Ave')
dv.set_vehicle('Lincoln2017MKZ_LGSVL')
modules = [
'Localization',
# 'Perception',
'Transform',
'Routing',
'Prediction',
'Planning',
# 'Camera',
# 'Traffic Light',
'Control'
]
destination = spawns[0].destinations[0]
print('DV setting up apollo')
dv.setup_apollo(destination.position.x, destination.position.z, modules)
print('Sim start running')
sim.run() |
@GiantSeaweed I belive you have to call https://github.com/lgsvl/PythonAPI/blob/9bc29c9aee5e98d4d99e6a410c04b153b8f7feef/lgsvl/dreamview/dreamview.py#L204 to change mode to "Mkz Lgsvl". The default is "Mkz Standard Debug" which always fails for me. You can try adding Also for set up vehicle I don't think there is a |
Hi @YuqiHuai I set the mode to About the But I got some new problems:
Thank you very much! |
I’m reopening this issue so I can track and work on resolving it. |
@GiantSeaweed sorry for the late reply. I have tested the following code and I am able to get it working with Apollo 7.0 but not 8.0. I am not sure about the root cause yet. import os
import lgsvl
from environs import Env
env = Env()
sim = lgsvl.Simulator(
env.str("LGSVL__SIMULATOR_HOST", lgsvl.wise.SimulatorSettings.simulator_host),
env.int("LGSVL__SIMULATOR_PORT", lgsvl.wise.SimulatorSettings.simulator_port)
)
if sim.current_scene == lgsvl.wise.DefaultAssets.map_borregasave:
sim.reset()
else:
sim.load(lgsvl.wise.DefaultAssets.map_borregasave)
spawns = sim.get_spawn()
state = lgsvl.AgentState()
state.transform = spawns[0]
ego = sim.add_agent('2e966a70-4a19-44b5-a5e7-64e00a7bc5de', lgsvl.AgentType.EGO, state)
# source: https://github.com/MingfeiCheng/AV-Fuzzer/blob/aa0f96c35088502189f7a9343d9ec7b0cee46b55/simulation/simulator.py#L12
ego.connect_bridge(
env.str("LGSVL__AUTOPILOT_0_HOST", lgsvl.wise.SimulatorSettings.bridge_host),
env.int("LGSVL__AUTOPILOT_0_PORT", lgsvl.wise.SimulatorSettings.bridge_port)
)
# Dreamview setup
dv = lgsvl.dreamview.Connection(sim, ego, env.str("LGSVL__AUTOPILOT_0_HOST", "127.0.0.1"))
dv.set_hd_map('Borregas Ave')
dv.set_vehicle('Lincoln2017MKZ')
modules = [
'Localization',
'Perception',
'Transform',
'Routing',
'Prediction',
'Planning',
'Traffic Light',
'Control'
]
destination = spawns[0].destinations[0]
dv.setup_apollo(destination.position.x, destination.position.z, modules)
sim.run(30) |
Hi @YuqiHuai . Thanks for your reply! It works with your script!! I found the only difference is the Btw, it seems that dreamview will remember some settings. If I succeed running via your id, then I can have another execution by my original id. (But the reversed order doesn't work), Also, I still need to click the |
Hi @GiantSeaweed . No worries! Glad it helps. Right, I am using the ID provided by Mingfei, who implemented a working version of AV-FUZZER (https://github.com/MingfeiCheng/AV-Fuzzer/blob/aa0f96c35088502189f7a9343d9ec7b0cee46b55/simulation/simulator.py#L12) and I have been using his configuration for a while. What you are observing is so weird, I don't have an explanation as to why this might be happening. Maybe you can try to compare sensor configuration of the different IDs. I also noticed I needed to click the |
Thanks for your help. Yeah. But just need to click for the first time.:) |
@GiantSeaweed, You are welcome! Yes, it is the same for me as well, only the first time. |
Hi, YuqiHuai May I ask where should I edit in this code if I want to run Apollo on another computer with LGSVL? I've tried only to change the ip address from 172.0.0.1 to the Apollo computer's ip, but the simulator said disconnected (screenshot as follow). I used to succeed in co-simulating on two computers but with Apollo 6 (code as follow, is edited from Python-API/examples/SampleTestCases/random-traffic-local.py). Do you have any ideas about this problem? Thank you so much!
|
@yellinshadows hi. Sorry I don’t have 2 machines to test this out. But temporarily maybe you can try using a previous version of SVL (2020.06). I talked with another person and he mentioned that version did not depend on having the cloud so maybe that is the simplest solution unless you have to use 2021.03. |
Hi @YuqiHuai, I have tried your script and it can be run on Apollo 7.0. However, the car you use is '2e966a70-4a19-44b5-a5e7-64e00a7bc5de', this car uses 3D ground Truth, which means it directly transfers the simulator's detecting data(NPC, Ped) to the Apollo. But in a real-world case, Apollo should collect the camera/Lidar data first and analysis it with a perception module like what Apollo 5.0 do on LGSVL (start from 31:43 https://www.youtube.com/watch?v=Ucr0aM334_k). On apollo 6.0, seems there is a problem with camera, so lgsvl uses module-testing configuration such as 2e966a70-4a19-44b5-a5e7-64e00a7bc5de to avoid this problem. But what if Apollo 7.0 has fixed camera's problem, how could we use the appropriate configuration to make Apollo can run full-analysis on lgsvl (I have tried the original Apollo 5.0's configuration '47b529db-0593-4908-b3e7-4b24a32a0f70' but seems not working )? Do you have some advice? Thanks in advance! |
Hi @JasonBourne1998 The first time I started using SVL was when I discovered ADFuzz (might also be known as AutoFuzz), and that project is suggesting the ID ( I decided to investigate whether this flickering problem is Apollo's fault, but I saw posts like SVL Issue 1719 and Apollo Issue 14072. These issues make me believe SVL isn't working with Apollo's perception, but no one knows if this is an Apollo problem or an SVL problem. Even in the YouTube video you shared, at 36:52, many cars are in the junction, but Apollo seems to have detected none. It is very hard for me to believe Apollo's perception module is this bad. A few seconds later in the video, obstacles are detected, but I did not see what was changed between the 2 simulations. With SVL sunsetted, I cannot figure out the root cause of the perception issue. Before anyone has any concrete evidence of this perception issue being solely Apollo's responsibility, I actually suggest relying on 3D ground truth to test the prediction module and the planning module. Everything I said here is also why I choose to rely on 3D ground truth for now and keep suggesting vehicle ID |
I have got your opinion, thanks! BTW, have you tried carla's Apollo 7.0 (https://github.com/guardstrikelab/carla_apollo_bridge) ? Carla can support full-analysis of Apollo 7.0, but I thinks Carla's problem is that its inner map is too simple, for ADS testing, I think San_Francsico in LGSVL is a good map. Since SVL sunsetted, I think the most feasible way is to create some complex maps in carla ? |
@JasonBourne1998 I am aware of this Carla-Apollo bridge but I haven't had the time to try it yet. San_Francisco is definitely a good map! The work that I focus on relies on using Apollo's |
As the title says
Thank you
The text was updated successfully, but these errors were encountered: