openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Transferring to MapLibre

Open bongbui321 opened this issue 1 year ago • 5 comments

Description Currently translate the codebase to maplibre-qt already.

Verification Trying to build maplibre-qt, but is currently facing an issue similar to this. Failing to build because of missing qtlocation5-private-dev package and it is not available on apt

Will test using map_renderer.py, not sure if this is a good way to test this? Probably better test with replay

bongbui321 avatar Jan 27 '24 00:01 bongbui321

Will test using map_renderer.py, not sure if this is a good way to test this? Probably better test with replay

I'd probably start with replaying the demo route and just checking the map generally works in the UI, then test the map renderer. See here for getting setup: https://github.com/commaai/openpilot/tree/master/selfdrive/navd#development

adeebshihadeh avatar Jan 27 '24 01:01 adeebshihadeh

What does full desktop support mean? We can't make this work with 5.12?

adeebshihadeh avatar Jan 27 '24 17:01 adeebshihadeh

@adeebshihadeh From the README, it is "fully supported on desktop platform" which I think for the main desktop OSes. I think it is fine since Agnos is mainly based on Ubuntu 20.04?

anything below 5.15 doesn't support Location which I think is used for getting routes and positions. I think we can kind of work around this if we have our own fork. I haven't dive deep into the codebase, but it might be possible

bongbui321 avatar Jan 27 '24 18:01 bongbui321

Ah, if there's lot of hacks, then I don't think this is worth it. We'll be switching to 24.04 in a few months when it's out anyway. If you confirm there are lots of hacks to get it working on our Qt, then we can just keep this bounty locked to you until the switch.

adeebshihadeh avatar Jan 27 '24 18:01 adeebshihadeh

Okay, I made it work with 5.12. I made a small PR that makes it compilable with Qt 5.12. We don't need Location since we are getting position and location from cereal already. so we can disable the Location option with cmake -DMLN_QT_WITH_LOCATION=OFF ..

I was trying to test with the demo route of replay but that one doesn't seem to have map enabled, is there a different route that I can test with?. I also test with map_renderer.py and got a segfault. I tried to implement the exact same function in .c here is the file: test.txt and it works just fine with no segfault, not entirely sure why it doesn't work for python implementation

bongbui321 avatar Jan 28 '24 08:01 bongbui321

Okay, I made it work with 5.12. I made a small PR that makes it compilable with Qt 5.12. We don't need Location since we are getting position and location from cereal already. so we can disable the Location option with cmake -DMLN_QT_WITH_LOCATION=OFF ..

I was trying to test with the demo route of replay but that one doesn't seem to have map enabled, is there a different route that I can test with?. I also test with map_renderer.py and got a segfault. I tried to implement the exact same function in .c here is the file: test.txt and it works just fine with no segfault, not entirely sure why it doesn't work for python implementation

Nice! I see that got merged already.

Testing it doesn't require a route with nav enabled; the map will be available if you have everything setup, such as a token.

adeebshihadeh avatar Jan 29 '24 22:01 adeebshihadeh

@adeebshihadeh it seems to work perfectly now, do you need me to upload the compiled library or do you want me to write a shell to download and set it up automatically. Here is a snapshot of the demo with maplibre. Still figuring out how to record videos :) image

bongbui321 avatar Jan 29 '24 23:01 bongbui321

Great. We always want a script to build the third_party dependencies so that they're reproducible, then you can check them in once that's done. This one is a good example https://github.com/commaai/openpilot/blob/master/third_party/acados/build.sh

adeebshihadeh avatar Jan 30 '24 00:01 adeebshihadeh

@mitchellgoffpc any validation you want to do before merging this?

adeebshihadeh avatar Jan 30 '24 01:01 adeebshihadeh

@adeebshihadeh added the build script

I also test with map_renderer.py and got a segfault. I tried to implement the exact same function in .c here is the file: test.txt and it works just fine with no segfault, not entirely sure why it doesn't work for python implementation

The UI works fine, if possible you can test it out just to make sure I didn't introduce any bug, but the map_renderer.py doesn't seem to work. I created the same code in .c file as above and it doesn't have any segfault, I'm not sure why it doesn't work

bongbui321 avatar Jan 30 '24 04:01 bongbui321

@mitchellgoffpc any validation you want to do before merging this?

Yeah we should verify that it doesn't impact model performance, will run those tests tomorrow morning.

mitchellgoffpc avatar Jan 30 '24 04:01 mitchellgoffpc

CI is passing now, but there's some issues building it on device (CMake is too old and it's missing libqconnmanbearer.so). I'll look into those when I get a chance.

adeebshihadeh avatar Jan 31 '24 01:01 adeebshihadeh

Got it working on the comma 3X, and all the tests pass except navModel replay. I'll update the refs once you verify @mitchellgoffpc.

adeebshihadeh avatar Jan 31 '24 04:01 adeebshihadeh

@adeebshihadeh lgtm, model behavior appears to be pretty much identical

mitchellgoffpc avatar Feb 01 '24 21:02 mitchellgoffpc

While I understand that DevContainers is the preferred method for Comma, I would like to continue to use OP tools, natively on Apple hardware. This merge breaks the OP tools build (PJ plugins) on the Apple platform due to missing Darwin library files. 'third_party/maplibre-native-qt/Darwin/lib' not found

SurferSD avatar Feb 07 '24 16:02 SurferSD

@SurferSD please use the build script, and i think its better to open an issue rather than commenting on Pr since it mostly relates to development

bongbui321 avatar Feb 07 '24 17:02 bongbui321