Skip to content

parallel park a car. steps towards #204 and #348 #426

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Peter230655
Copy link
Contributor

@Peter230655 Peter230655 commented Mar 31, 2025

  • used backend='numpy'
  • store a solution
  • reduced fps in the animation, by reducing num_nodes and making the video run at accelerated speed. (Watchnig the car park in 30 sec may be testing, reduced to around 5 sec)
  • Made the docstrings as suggested.

On my PC running time reduced from about 47 sec to less than 10 sec.


# %%
# Show the optimal path of the mass center.
xs, us, ps = prob.parse_free(solution)
fig, ax = plt.subplots()
ax.plot(xs[0], xs[1])
ax.plot(xs[0, :], xs[1, :])
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be necessary. Why did you change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because at one time I had a problem. Was not related to this but forgot to change it back.

ax.set_xlabel(r'$x$ [m]')
ax.set_ylabel(r'$y$ [m]');
_ = ax.set_ylabel(r'$y$ [m]');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_ = ax.set_ylabel(r'$y$ [m]');
_ = ax.set_ylabel(r'$y$ [m]')

Remove the semicolon if you add the _ =.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed. I do not know, wha the semicolon does not always work.

Copy link
Member

Choose a reason for hiding this comment

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

I don't know either. I thought it would suppress output in sphinx gallery.

Copy link
Contributor Author

@Peter230655 Peter230655 Mar 31, 2025

Choose a reason for hiding this comment

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

Anyway, it did not on my make html
I shaved away CPU time for my Newtonian Impact :-)) :-))

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.

2 participants