Closed xiaofanliang closed 1 year ago
Hi,
Thanks for reporting the bugs, and welcome to the project!
Specifically, both abort me when I was requested to press the triangle bottom to show I understand how to start and pause a simulation.
I can reproduce this on task 5 (which you can jump to quickly by running with --tutorial=5
from the command line, for debugging: https://a-b-street.github.io/docs//tech/dev/index.html#development-tips). The error is:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Can't find OriginalRoad(https://www.openstreetm
ap.org/way/158782224 from https://www.openstreetmap.org/node/9167872280 to https://www.openstreetmap.org/node/53128052'
, apps/game/src/sandbox/gameplay/tutorial.rs:1057:30
The tutorial is hardcoded to start some agents moving around specific streets. Every time we update the OpenStreetMap data or change some of the map importing code, these hardcoded IDs can change a bit. In the short-term, we could fix the IDs in https://github.com/a-b-street/abstreet/blob/9f6211d1b842353077b3104dc8838d92e6661f3f/apps/game/src/sandbox/gameplay/tutorial.rs#L1053, using an older version of the game to figure out what the previous behavior was.
Longer-term, I'd love to revisit how the tutorial works, because this kind of thing breaks every so often, and is a hassle to maintain. It's also tough to automate any tests to catch this kind of problem.
Another consistent abort incident is when I try to choose "trips between home and work" scenario for an imported new city OSM
Hmm, I can't reproduce this one with the latest version. Seeing the error message would be super helpful. If we can't figure out how to get that to show up on Mac, maybe you could send the coordinates from geojson.io you're pasting in?
but my output.txt seems to stop updating for a while
Really strange. So the file is partly filled out, but then the last messages before the app crashes don't show up? All of the messages the code prints should be flushed immediately to STDOUT/STDERR; there's no weird buffering going on. The 1> ../output.txt 2>&1
part of the script is just standard Unix shell magic to redirect both STDOUT and STDERR to a file. You could try running just ./game
in a terminal and seeing if the stack trace and error messages show up.
Thanks for your patience working through the bugs!
Thanks for the speedy turnaround! I figured out the output.txt issue. For some reason, my output.txt is generated outside the abstreet_mac_v0_3_38 folder. The one inside the abstreet_mac_v0_3_38 folder is not updating.
Here is the error message when I clicked "trips between home and work" scenario.
create blank sim... plus 0.5101s
create blank sim took 0.6413s
[2023-01-27T17:18:35Z INFO abstutil::time] - create blank sim took 0.6413s
[2023-01-27T17:18:35Z INFO abstutil::time] - setup offstreet parking (116,112)... 0.1312s
[2023-01-27T17:18:35Z INFO abstutil::time] - ... plus 0.5101s
load scenario...
create people...
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
stack backtrace:
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
thread '<unnamed>' panicked at 'must_get_sidewalk broken by DirectedRoadID(29714, forwards)', map_model/src/objects/road.rs:105:13
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: map_model::objects::road::DirectedRoadID::must_get_sidewalk
3: map_model::pathfind::walking::SidewalkPathfinder::pathfind
4: map_model::pathfind::pathfinder::Pathfinder::pathfind_with_params
5: map_model::map::<impl map_model::Map>::pathfind_v2
6: map_model::map::<impl map_model::Map>::pathfind
7: synthpop::make::activity_model::create_prole
8: <F as scoped_threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/runner/work/abstreet/abstreet/abstutil/src/time.rs:376:47
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
4: scoped_threadpool::Pool::scoped
5: abstutil::time::Timer::parallelize
6: synthpop::make::activity_model::<impl synthpop::make::generator::ScenarioGenerator>::proletariat_robot
7: game::sandbox::gameplay::GameplayMode::scenario
8: widgetry::event_ctx::EventCtx::loading_screen
9: <game::sandbox::SandboxLoader as widgetry::app_state::State<game::app::App>>::event
10: widgetry::event_ctx::EventCtx::no_op_event
11: widgetry::event_ctx::EventCtx::no_op_event
12: widgetry::event_ctx::EventCtx::no_op_event
13: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
14: widgetry::runner::State<A>::event
15: widgetry::runner::run::{{closure}}
16: <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event
17: winit::platform_impl::platform::app_state::Handler::handle_nonuser_event
18: winit::platform_impl::platform::app_state::AppState::cleared
19: winit::platform_impl::platform::observer::control_flow_end_handler
20: <unknown>
21: <unknown>
22: <unknown>
23: <unknown>
24: <unknown>
25: <unknown>
26: <unknown>
27: <unknown>
28: <unknown>
29: <unknown>
30: objc::rc::autorelease::autoreleasepool
31: winit::platform_impl::platform::event_loop::EventLoop<T>::run
32: winit::event_loop::EventLoop<T>::run
33: widgetry::runner::run
34: game::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SendError { .. }', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:219:72
stack backtrace:
0: 0x10108f3d4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7d80e14dd19335c9
1: 0x1010af77b - core::fmt::write::h1709d0255080e28a
2: 0x101089388 - std::io::Write::write_fmt::hecc56b5639d319e7
3: 0x101090aed - std::panicking::default_hook::{{closure}}::had4d1cd22a173020
4: 0x10109083e - std::panicking::default_hook::h42aa124509888735
5: 0x101091028 - std::panicking::rust_panic_with_hook::h2b231e816574a23a
6: 0x101090f63 - std::panicking::begin_panic_handler::{{closure}}::h9da8d88b7a4c9d5e
7: 0x10108f857 - std::sys_common::backtrace::__rust_end_short_backtrace::h10dbf1377dfaf877
8: 0x101090c3a - _rust_begin_unwind
9: 0x101111f03 - core::panicking::panic_fmt::hde1544b10dc8b4d3
10: 0x101112065 - core::result::unwrap_failed::h0a3d20f5459baffe
11: 0x100f83a5d - scoped_threadpool::Scope::join_all::h27705d966afadbe4
12: 0x1008c70e0 - scoped_threadpool::Pool::scoped::haba496b5762a8178
13: 0x1008b6e92 - abstutil::time::Timer::parallelize::h68eeed9508eef4c1
14: 0x1008cd472 - synthpop::make::activity_model::<impl synthpop::make::generator::ScenarioGenerator>::proletariat_robot::ha529374dcbe8653d
15: 0x1003e1f62 - game::sandbox::gameplay::GameplayMode::scenario::he2473393de58b99a
16: 0x10053ed59 - widgetry::event_ctx::EventCtx::loading_screen::h992cdf16aaf21df9
17: 0x10035cf80 - <game::sandbox::SandboxLoader as widgetry::app_state::State<game::app::App>>::event::h04b77a9a4fb3c26b
18: 0x100539dfe - widgetry::event_ctx::EventCtx::no_op_event::h4c0e3fd90f5f262e
19: 0x100539e55 - widgetry::event_ctx::EventCtx::no_op_event::h4c0e3fd90f5f262e
20: 0x100539e55 - widgetry::event_ctx::EventCtx::no_op_event::h4c0e3fd90f5f262e
21: 0x1001bba91 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h8499c9850485f695
22: 0x100194c09 - widgetry::runner::State<A>::event::h4a831ae24081bbf1
23: 0x100499aca - widgetry::runner::run::{{closure}}::ha5fda6e33a825c91
24: 0x10016b362 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::h2d8fd15aff7208a9
25: 0x10096825e - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h08e747f74ea73530
26: 0x10096a587 - winit::platform_impl::platform::app_state::AppState::cleared::h550d0d5ae9e5d484
27: 0x1009617f5 - winit::platform_impl::platform::observer::control_flow_end_handler::h2376b2ede1d718b0
28: 0x7ff81c4aaef8 - <unknown>
29: 0x7ff81c4aad94 - <unknown>
30: 0x7ff81c4aa366 - <unknown>
31: 0x7ff81c4a9809 - <unknown>
32: 0x7ff8255163e1 - <unknown>
33: 0x7ff825516137 - <unknown>
34: 0x7ff825515ed5 - <unknown>
35: 0x7ff81edfb8f0 - <unknown>
36: 0x7ff81edf9f5c - <unknown>
37: 0x7ff81edec359 - <unknown>
38: 0x10018163b - objc::rc::autorelease::autoreleasepool::haff1633ebced4a06
39: 0x1004881f1 - winit::platform_impl::platform::event_loop::EventLoop<T>::run::h5f5e342f37c1e318
40: 0x100192699 - winit::event_loop::EventLoop<T>::run::hb6b0f24385841180
41: 0x1001955e1 - widgetry::runner::run::h4bd55a72bfb6ef5e
42: 0x100282a56 - game::main::hd664bfb0a7e6167a
43: 0x100094f36 - std::sys_common::backtrace::__rust_begin_short_backtrace::h627a712924a43dd3
44: 0x100094f0c - std::rt::lang_start::{{closure}}::hb56b6b84f7758a5a
45: 0x1010831fb - std::rt::lang_start_internal::h18b571735d69908e
46: 0x100094ef9 - _main
thread panicked while panicking. aborting.
This is the geojson bounding box that I used to pull OSM data. Thanks for looking into these!
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"FID": 0
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-84.57345517299996,
33.55455603300004
],
[
-84.57345517299996,
33.72778556800006
],
[
-84.31261736099998,
33.72778556800006
],
[
-84.31261736099998,
33.55455603300004
],
[
-84.57345517299996,
33.55455603300004
]
]
]
}
}
]
}
Can I also ask two questions that are irrelevant to this post? Sorry I know this usually should go to different posts, but not sure it is worth it to have new posts for these newbie questions.
1) Is there a way to add your own GIS data or visualize the existing polygons (buildings) based on attributes? I saw that there are layers of amenities that visualize polygons on food, shopping etc., but these visuals go away when I run simulations, so I cannot see what the agents have passed through. I also have my own GIS files with land use for building polygons, and I did not find a way to replace the polygons in the OSM base map. I know that I can do some individual edits in OSM and update the base maps accordingly, but I cannot do it on a large-scale. Another scenario that I want to upload my own is that I have a new proposal (e.g., new bike/trail plan) in GIS format, but I currently have to manually update each street segment to align with the proposal.
2) Is there a way to show the proposal in a zoomed-out view? For example, after adding a bike lane to a street segment, when I zoomed out in the simulation, I cannot see where I added the bike lane anymore.
I am aware of the ungap_the_map version of bike lane simulation and I am exploring it to see if it can solve some of these issues.
First the crash with scenarios... in debug mode, you can jump to a road by numeric ID. must_get_sidewalk
is blowing up here, because there's more than 2 sidewalks. This is a familiar problem... reopened https://github.com/a-b-street/osm2streets/issues/105#issuecomment-1407469622
Questions here are fine, we can split out separate issues for any long-term work. There's also Discord and Slack if you prefer.
I saw that there are layers of amenities that visualize polygons on food, shopping etc., but these visuals go away when I run simulations, so I cannot see what the agents have passed through
You can run the traffic simulation while the amenity layer (hotkey l, a) is open. Especially over a huge area, I'm not sure if there'd be patterns easy to spot. What's the goal or question you're trying to answer? The traffic simulation itself is nowhere near trustworthy or meaningful (or working). There are separate, simpler tools for things like understanding patterns of where people are going to/from, like the "commuter pattern" layer, but for the "home to work" scenario, they're just going to show all the destinations being buildings with some kind of non-residential use.
I also have my own GIS files with land use for building polygons, and I did not find a way to replace the polygons in the OSM base map
Unfortunately it's hard to do regular GIS stuff on top of A/B Street, because it's not built with the usual web map stack in mind. Something like a satellite basemap would be so useful! The direction I've been exploring lately is to build apps on top of MapLibre GL or Leaflet, use regular JS stuff for the UIs (recently been using Svelte to make that nicer), and pull in components of A/B Street as independent modules using WASM. Can you share more about the bigger picture of what you're trying to do with land use?
I know that I can do some individual edits in OSM and update the base maps accordingly
What info is missing from the buildings, out of curiosity? Specific businesses, or stuff like https://wiki.openstreetmap.org/wiki/Tag:landuse%3Dcommercial? (The latter isn't used by A/B Street at all right now, but probably should)
Another scenario that I want to upload my own is that I have a new proposal (e.g., new bike/trail plan) in GIS format, but I currently have to manually update each street segment to align with the proposal.
Is there a way to show the proposal in a zoomed-out view?
Hotkeys l, e -- map edit layer
Hi team,
I am a new user on A/B Street. I downloaded the software on my local Mac computer and this is my Mac setting:
MacOS Monterey Version 12.0.1 Apple M1 Memory: 16GB
I opened the sh file on my mac with this extra step indicated here: https://a-b-street.github.io/docs/user/index.html "If that just opens a text file, then instead open terminal, cd to the directory you just unzipped. Then do: cd game; RUST_BACKTRACE=1 ./game 1> ../output.txt 2>&1"
I encounter a few times that the software will abort me after I clicked something to give a command. For example, it aborts me when I was going through the Traffic Simulation Tutorial and Traffic Simulation Challenges. Specifically, both abort me when I was requested to press the triangle bottom to show I understand how to start and pause a simulation. Both tutorials abort me exactly when I finished the last click. I repeated this multiple times and get aborted every time. By abort, I mean the software window quits itself and I lost all my progress.
Another consistent abort incident is when I try to choose "trips between home and work" scenario for an imported new city OSM base map in the traffic simulation sandbox (I only import the OSM and then chose the scenario). I repeated multiple times and every time I was aborted.
Any idea why the aborts happen? Is there a way that I can get specific messages about why I am aborted? I saw from some old posts that you can see from output.txt, but my output.txt seems to stop updating for a while (based on date modified on Mac) even when I am being aborted.
Thanks!