-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Close on key #259
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
Close on key #259
Conversation
- The obstacle rotation for the rectangle obstacle calculation is wrong. It should be positive instead of negative.
condition check is moved from the inside of the resampling function to the outside of the function, this way the purpose of the function is much clear. Instead "resampling" every iteration, resample if the condition holds.
@goktug97 Thank you for interesting PR. Can I ask a question?.
Do you want to use terminal during simulation? I don't know whether it is useful or not because I am not a user of i3. |
I don't need to use a terminal but if I want to use one, I can change to another workspace. The problem is, if I want to close the simulation it is a little bit hard and annoying because the matplotlib plot changes the focus so I need to click to the terminal and press Ctrl + C at the same time. |
@goktug97 OK. I got it. I would like to merge this PR, but I have a request. Please check the review. |
fcff55b
to
6518175
Compare
6518175
to
9ca7d8f
Compare
from pathlib import Path
string = 'mpl_connect'
for filename in Path('PythonRobotics').rglob('*.py'):
f = open(filename, 'r')
with open(filename, 'r') as f:
lines = f.readlines()
numbers = []
for i, line in enumerate(lines):
if string in line:
numbers.append(i)
for number in reversed(numbers):
ws = len(lines[number]) - len(lines[number].lstrip(' '))
lines.insert(number, (ws * ' ') + '# for stopping simulation with the esc key.\n')
with open(filename, 'w') as f:
f.writelines(lines) Kind of back fired but done. |
@goktug97 Thank you!! |
If the plot is dynamic such that the plt.pause is used to show the plot, it doesn't let you use the terminal if you are using a window manager such as i3. You have to spam Ctrl+C while clicking to the terminal to close early. Added
statement to every script that uses plt.pause to create dynamic plots, if the plots are static and drawn only once, the statements is not added. Now the scripts can be closed by pressing ESC.