-
Notifications
You must be signed in to change notification settings - Fork 224
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
Re-support TUI #9
base: master
Are you sure you want to change the base?
Conversation
Grazfather
commented
Sep 19, 2017
- Revert the revert
- Fix the issue.
A few questions on the TUI.
|
|
@Grazfather Excellent! I'll remerge in a bit. |
Cool, but let's make sure it works for you, your point 2:
It's totally reasonable that there's something funky going on here. Also I just realized that if the raspberry pi has a different prng than the other computer, then even if their seeds are the same the random values could be different. Now I don't think that this is the case, but it could be something to look into. Easy enough to test, of course. |
@Grazfather Hmmm, I grabbed the new version and it no longer crashes when loading the GUI (sweet!) both text and gui changes are visible in the IC. However the response is really really slow. Throttle works OK. but the turn indicator is practically non-functional. The acceleration should be smooth and instantaneous for me it seems that maybe the polling loop is messed up? Speed jumps at 5 mph increments and idle barely moves. I haven't been able to spend any time digging into it yet to track down the source of the issue. OT: small suggestion, when keyboard control is enabled, print a legend of keys. |
Yeah, I noticed that also. The reason it's slow, I think, is because it's so much faster to run the loop, and the delay is only 5ms. With the GUI it might be 5ms + 5ms drawing, with TUI maybe 5ms + 0.5ms drawing. This floods the CAN bus faster than the GUI can read it. I've noticed, for example, that the indicator will keep blinking on the UI for a few seconds after I kill the controller. I'll add a legend for sure. |
I've added the changes mentioned. Care to try them out? |
Rate limit the main loop so that each can message cannot be sent more than a certain number of times per second (right now it's 1000ms/10ms period = 100Hz).
Took another look, and improved the rate limiting (currently it'll send at most 100 messages (per ID) per second. This can be slowed down by the GUI since the redraw happens in the same thread. |