Skip to content
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

remove timezone from timed.py #32665

Merged
merged 7 commits into from
Jun 20, 2024
Merged

Conversation

BBBmau
Copy link
Contributor

@BBBmau BBBmau commented Jun 8, 2024

Resolves #32662

Unfortunately when looking into the response we get when getting route info their isn't any mention of timezone ids. however we can use tilequery which does return the timezone id based on the coordinates, this can be another request within calculate_route in the RouteEngine class. I've started the implementation but also was curious as to whether this is fine since this does require making another request after the routeRequest is successful.

Copy link
Contributor

github-actions bot commented Jun 8, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

@adeebshihadeh
Copy link
Contributor

Hmm, the API docs mention that this API is for extracting information from the tiles without rendering them... however we only care about knowing the timezone when rendering the map. Can we get them in the UI somehow when rendering the map?

@BBBmau
Copy link
Contributor Author

BBBmau commented Jun 9, 2024

Hmm, the API docs mention that this API is for extracting information from the tiles without rendering them... however we only care about knowing the timezone when rendering the map. Can we get them in the UI somehow when rendering the map?

looked into being able to use the existing api for rendering like you said but again it didn't look like it provided the timezone information like how tilequery does.

I went ahead and used the tilequery still and was able to get it to use param.get("Timezone") when initializing map_eta which is only done when map_panel is initialized.

Marking ready for review since tests are passing and I verified that it eta works fine by running ./replay --demo && ./ui locally.

@BBBmau BBBmau marked this pull request as ready for review June 9, 2024 20:52
@BBBmau
Copy link
Contributor Author

BBBmau commented Jun 9, 2024

Not sure what's causing simulator test to fail?

@maxime-desroches
Copy link
Contributor

@BBBmau #32684 fixed the simulator

Copy link
Contributor

@adeebshihadeh adeebshihadeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including the timezone in the nav packet, instead of using the Timezone param, has the added benefit of this codepath being hit every time. For example, if the timezone getting code broke, most people wouldn't notice until they reset the device or crossed a timezone borundary.

selfdrive/navd/navd.py Outdated Show resolved Hide resolved
teleoprtc_repo Outdated Show resolved Hide resolved
selfdrive/ui/qt/maps/map_eta.cc Outdated Show resolved Hide resolved
@adeebshihadeh adeebshihadeh marked this pull request as draft June 11, 2024 01:11
@BBBmau BBBmau force-pushed the remove-tz-dep branch 2 times, most recently from 779ca43 to 545e319 Compare June 11, 2024 05:32
@BBBmau BBBmau marked this pull request as ready for review June 11, 2024 05:56
@BBBmau BBBmau marked this pull request as draft June 11, 2024 06:54
@BBBmau BBBmau marked this pull request as ready for review June 12, 2024 05:37
@adeebshihadeh adeebshihadeh added this to the 0.9.8 milestone Jun 12, 2024
@adeebshihadeh
Copy link
Contributor

Added to the 0.9.8 milestone. Might be a little bit before we get to it, but looks good at first glance

@adeebshihadeh
Copy link
Contributor

Slight change of plans, this won't be needed after #32773. Let's just trim this down to removing timezone handling from timed, and I'll merge it after I merge #32773.

@BBBmau
Copy link
Contributor Author

BBBmau commented Jun 20, 2024

Slight change of plans, this won't be needed after #32773. Let's just trim this down to removing timezone handling from timed, and I'll merge it after I merge #32773.

makes sense, was thinking about this after seeing the work done on removing navigation.

@BBBmau BBBmau force-pushed the remove-tz-dep branch 2 times, most recently from 8e0afb4 to 9b92d8c Compare June 20, 2024 02:47
@BBBmau BBBmau changed the title ui: use TZID from tilequery mapbox api remove timezone from timed.py Jun 20, 2024
panda Outdated Show resolved Hide resolved
@BBBmau BBBmau force-pushed the remove-tz-dep branch 2 times, most recently from c6ca958 to 6f9612f Compare June 20, 2024 03:27
@adeebshihadeh adeebshihadeh merged commit 7013eed into commaai:master Jun 20, 2024
13 of 14 checks passed
Edison-CBS pushed a commit to Edison-CBS/openpilot that referenced this pull request Sep 15, 2024
* use timezone from tilequery mapbox api

* add timezone into cereal

* better clean

* more

* one line

* poetry lock
old-commit-hash: 7013eed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[$100 bounty] Remove timezonefinder dependency
4 participants