-
Notifications
You must be signed in to change notification settings - Fork 779
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
KeyError: 'latitude' #1767
Comments
When you run the simulation again with the custom sensor it works? |
I believe @gorkemkrdmn was speaking figuratively when saying it crashed. @gorkemkrdmn can you provide us with the simulation player log ( |
Yes, crash was a figure of speech. I will provide the log files. I think for some reason pythonapi can’t acces the gps data once in a two run as I mentioned. |
I'm having a very similar problem. I'm using a script to run multiple simulations in a for loop. In each iteration, new lgsvl.Simulator and dreamview.Connection objects are generated. In the first iteration, everything runs fine, but in the second iteration, the Python script halts with KeyError, the simulator itself does not crash but it stops as the sim.run call in the python script does not run. The exact error I get is:
The script that causes this problem is almost same as the example provided in the docs. The setup is:
The Player.log file is at: Player.log |
Are you completely toggling off Apollo's modules? I'll ping @revati-naik to see if they have seen this error. |
This sounds like it could be a known issue where Apollo doesn't like the car to "teleport" (back) to the original spawn location; the fix (as @EricBoiseLGSVL alluded to above) is to restart the Apollo modules (specifically the Routing module, IIRC, or maybe the Planning module). You can reproduce this problem by manually setting a destination in Dreamview and letting Apollo drive there, then hit F12 to reset the active (ego) vehicle location. You'll see that routing and planning do not plan a new route until (one or both) are restarted in the Dreamview module control view. |
Thanks @lemketron . We also have a few fixes coming in the next release and it may help with the KeyError. I would also try this when it's out next week. |
I wonder if API responses get out of sync somehow and the response is actually an object missing the key |
@lemketron @EricBoiseLGSVL toggling just Routing and Planning did not have any effect, but toggling all modules caused a similar error, but interestingly on the previous line of the dreamview.py file, still in
I think @heeen may be right about the out of sync condition. I suppose it also explains how adding the Any ideas on how to debug this synchronization error? I am already using the clock sensor for communicating with Apollo. |
@EricBoiseLGSVL the custom sensor that causes the problem is |
Are you running this on a Mac? It is concerning that MacOSX folders are here with duplicate cs files. Also, are you creating a prefab for the class? |
So that sensor sends an event using apimanager addcustom which eventually ends up in sendresult. I am thinking this will mix with the regular api call results and confuse the unexpecting receiver in agent state get. |
We'll look into this, thanks for posting |
@EricBoiseLGSVL I am working on the Mac but I run the code on linux (cloud). Yes, I am creating a prefab for the class. |
Have you tried this with 2021.3? We have some issues with 2021.2 running multiple iterations in python. |
@EricBoiseLGSVL Yes, I have tried this with 2021.3. The issue is still not resolved. |
Are you trying to access the original vehicle ref after a reset? ApiManager on reset deletes and removes the vehicle and all sensors so a call to set destination on the old ref will fail. Have you tried setting the EGO state instead of a reset? |
As a workaround, can you try to stop sending events using AddCustom when the simulation is paused? e.g. |
can you post your python script? Events are sent as the response to the simulator/run api, but that call blocks, so I wonder how you can issue another api command after that that gets confused by the events message |
When I use PythonAPI with Apollo Dreamview on the svl simulator, simulation crashes. The error message is:
The thing is, this happens when I run the simulation with a custom sensor-equipped car. In contrast, when I run the simulation with one of the default sensor configurations it runs without a problem. Furthermore, when I run the simulation again the problem disappears. So, it throws an error in every two runs. Any ideas?
The text was updated successfully, but these errors were encountered: