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

Enable editing of turn restrictions in the LTN tool #1091

Merged
merged 107 commits into from
Sep 6, 2023

Conversation

andrewphilipsmith
Copy link
Collaborator

No description provided.

@andrewphilipsmith
Copy link
Collaborator Author

Here is a preview of of turn restriction editing:

first-cut-turn-restriction-editing.mp4

@andrewphilipsmith
Copy link
Collaborator Author

andrewphilipsmith commented Aug 18, 2023

Remaining tasks to complete this:

  • add more tests
  • fix awareness of one-way restrictions on connected roads
  • enable undo actions for turn restrictions
  • meaningful tooltips
  • hoverover rendering of FocusedTurns
  • panel text
  • rendering of intersections to match the thickness of neighbouring roads
  • save turn restriction edits as part of a proposal
  • fix color palette on orange button to match the other buttons.
  • consistent language permitted/allowed/prohibited/restricted/banned etc

Optional (could be moved to future PRs)

  • check compatibility with bus routes
  • intelligent interaction between turn restrictions and one-way streets (similar to filters and one-ways)
  • detect when turn restrictions create de-facto dead end, oneway street or unreachable cell.

@andrewphilipsmith
Copy link
Collaborator Author

Hi @dustin. I'm marking this as ready for review. I'm not sure it's quite ready to merge, but I would appreciate a second opinion on where I've got to so far.

In no particular order, here are some specific things I like some help with:

  1. After editing, it is possible that the turn restrictions stored at road level (e.g. in road.turn_restrictions may not be consistent with those derived from lane-level), leaving the map in an inconsistent state. Does this matter? If the edits only get saved in a proposal file (and not the map's .bin), then will/can it cause problems for other parts of abstreet?

    At one point, I started altering make::turns::make_all_turns to work at lane-level turns but gave up when I found it didn't seem to be necessary. I think the options are:
    - Revert the changes to the Lane-level logic where it is unused (trivial).
    - Complete the changes to the Lane-level logic, so that Lane-level and Road-level turn restrictions remain consistent (tricky);

  2. At present, when the turn restrictions change, it's necessary to force the re-rendering of the icons (e.g. this is not picked up the EditOutcome::UpdateAll or EditOutcome::UpdatePanelAndWorld). The current method works, but it feels very procedural and inelegant. See apps/ltn/src/pages/design_ltn/mod.rs:L141 and apps/ltn/src/pages/design_ltn/turn_restrictions.rs:L295. Is there somewhere better this call could go? (maybe here?)

  3. I'm sure I'm not getting the various imports correct. I seem to need to declare things as pub more often than a lot of the surrounding code. e.g. /apps/ltn/src/logic/mod.rs#L6. I'll check it more systematically, but if you can see anything obvious, that would be great.

  4. In EditRoad.get_orig_from_osm() (map_model/src/edits/mod.rs:L115), how/where are the turn_restictions read from osm tags? Where is this already parsed? The current code using turn_restrictions: Vec::new() seems to work, but I'm not quite sure why.

@andrewphilipsmith andrewphilipsmith marked this pull request as ready for review August 31, 2023 08:28
@dabreegster
Copy link
Collaborator

Starting to review! One quick request -- would you mind rebasing against main? There's a binary incompatibility for map files, meaning you'll have to do cargo run --release --bin updater -- download or rebuild maps yourself, after that

This *should* highlight possible destinations on mouseover events. However, it is not working correctly and fails often.
- Improve visual consistency
- remove the use of FocusedRoad from mouseover logic
- separate visual effects of mouseover and clicked-on events
@andrewphilipsmith
Copy link
Collaborator Author

One quick request -- would you mind rebasing against main?

Done

andrewphilipsmith and others added 28 commits September 6, 2023 15:37
This *should* highlight possible destinations on mouseover events. However, it is not working correctly and fails often.
- Improve visual consistency
- remove the use of FocusedRoad from mouseover logic
- separate visual effects of mouseover and clicked-on events
Updates turn restrictions icons in `redraw_all_filters()`.
Renames `redraw_all_filters()` ==> `redraw_all_icons()`.
This error inadvertently allowed non-drivable roads into possible_destination_roads.
@andrewphilipsmith andrewphilipsmith merged commit 7000260 into main Sep 6, 2023
1 check passed
@andrewphilipsmith andrewphilipsmith deleted the ltn-turn-restriction-edits branch September 6, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants