-
Notifications
You must be signed in to change notification settings - Fork 7
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
Faster Lynx E-STOP #1
Conversation
Hello @FROGbots-4634 This PR is being evaluated for inclusion in the official SDK. However, I see you have it marked a a work in progress? Can you elaborate on that a bit? Thanks. |
Hi @cmacfarl, so it's marked as WIP for two reasons:
|
@cmacfarl Quick update: Noah suggested I actually create a couple test cases for this outside of the SDK, which did in fact make checking behavior in edge cases much easier. I did in fact discover an issue, (which is that |
@cmacfarl Sorry for the delay. I have pushed two more commits. The first updates this branch to be based off v5.1 (no merge conflicts though). The second reworks my previous implementation to an implementation that I feel much more comfortable with - I was able to fix the issues that I found in the old one as well as test to make sure that several edge conditions play out correctly by following Noah's suggestion. However, that being said, given that this is my third try at implementing this correctly, I think it would be wise to have Bob give this a quick lookover before merging since it touches the lowest levels of the Lynx part of the SDK. |
@FROGbots-4634 I'm in the process of testing this and it looks good so far. What sort of "edge conditions" were you concerned about..... to help focus my testing. Phil. |
So one of them was when you have more than one thread spamming the hardware during the E-STOP condition (one of my implementations could get into deadlock in that condition). Another was ensuring that this line was not an issue if the user code was interrupted while a command was in flight and waiting for ACK. I added a comment above it detailing why it's not an issue, but part of me thinks it should be changed to the non-interruptible |
@gearsincorg also since you're testing, it might be nice if you could just confirm my finding that adding the extra ReentrantLock does not impact loop time / max hardware calls per second in any way. |
@cmacfarl Any update on this? By the way just to clarify, the edge conditions I mentioned to Mr. Phil were ones that I had tested and played out correctly. Also, even if another weird edge condition exists that would cause something to hang, the worse case scenario is that app restart would be delayed 250ms. |
I was waiting for @gearsincorg to circle back around on the issue. |
This has been merged, and will be in 5.3 to be released soon. |
This patch addresses ftc_app 712 and puts the Lynx modules into an E-STOP state much faster than before if the app was restarted due to a user OpMode refusing to exit.
Here are two videos demonstrating this:
Not only does this increase safety, but it can also help teams avoid penalties if, for example, their autonomous OpMode does not stop properly at the end of the 30 seconds.