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
Docs examples #46
Docs examples #46
Conversation
docs/src/examples/basics.md
Outdated
|
||
You can use Reactive to have them endlessly drive in real time in your browser. | ||
|
||
### TODO: is this a thing? If yes, provide snippet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never used Reactive for visualizing simulations, is this a thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never used it either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably remove that sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, then maybe I'll leave it at a honorable mention of the package instead of providing a working code example.
@@ -227,7 +227,8 @@ function render_round_rect( | |||
|
|||
if fstroke | |||
set_source_rgba(ctx, color_stroke) | |||
line_width = abs(user_to_device_distance!(ctx, [line_width,0.0])[1]) | |||
# from Cairo.user_to_device_distance! - this may be the bug | |||
# line_width = abs(user_to_device_distance!(ctx, [line_width,0.0])[1]) | |||
set_line_width(ctx, line_width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cairo.user_to_device_distance
may being used incorrectly here (line_width
seems to vary based on heading angle of the vehicle). To be investigated further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is not clear to me why we need this function.
I am not sure I understand what it does though: https://www.cairographics.org/manual/cairo-Transformations.html#cairo-user-to-device-distance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that typically the line_width
does not scale with the zoom level, so it becomes relatively "thinner" as one zooms in. And the user_to_device_distance
is used to compensate for that, but maybe there's a bug. I'll open a separate issue so we can take care of it separately.
docs/src/examples/basics.md
Outdated
|
||
models = Dict((i => Tim2DDriver(timestep) for i in 1:3)) # car models | ||
# TODO: use a different model for pedestrian | ||
models[42] = Tim2DDriver(timestep) # pedestrian model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is a good pedestrian model to use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use StaticDriver to keep it simple
Thanks for doing this, two main comments: 1 - Are you re designing brand new tutorials? I had made a notebook for AutoViz 0.8 that you can take inspiration from |
The examples are heavily inspired by the notebooks that were there in the |
As for testing, how does it work at the moment? Is the documentation built automatically when we push changes? Could we make it fail when there are errors in If none of the above works we should consider writing tests separately but I'm afraid there may be code duplication - would be nice if we could avoid that with one of the aforementioned options. |
Yes it is only warnings for now. |
This is super neat!! thanks a lot |
Is this ready to merge? thanks for the work! |
improved examples in docs
work in progress, overlay tutorial still missing
as part of this PR, some defaults were changed:
:basic
rather than:fancy
COLOR_CAR_OTHER
I think the new defaults make more sense but this may be subjective and can be discussed / changed before closing the PR