Skip to content
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

Refactored function AdaptToJunctionLeader #11583

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Domsall
Copy link
Contributor

@Domsall Domsall commented Sep 13, 2022

this should not change any model except EIDM (one EIDM test changed as expected)

Signed-off-by: Dominik Salles <[email protected]>
Signed-off-by: Dominik Salles <[email protected]>
@namdre
Copy link
Contributor

namdre commented Sep 13, 2022

As far as I understood, the goal of this PR is to eliminate the line vsafeLeader = MAX2(vsafeLeader, vStop); since this confuses EIDM. Why then is it ok for the line vsafeLeader = MAX2(vsafeLeader, MIN2(v2, vStop)); to remain ?

@Domsall
Copy link
Contributor Author

Domsall commented Sep 13, 2022

That is exact the line I had the most problems with...
The workaround was to add CURRENT_WAIT to the stopSpeed-calls. The EIDM will then check in finalizeSpeed, if the stopSpeed-calls were the reason for the next speed update. The EIDM still does not know anything about v2, which could theoretically cause some weird behavior. Nevertheless, I could not find any cases, where this was a problem (yet).

In all other cases, the changes work as expected for the EIDM (with CURRENT as input for stopSpeed).

@namdre
Copy link
Contributor

namdre commented Sep 14, 2022

Frankly, I find the current code in that function hard to read and this PR isn't helping (by adding some redundancy). I'll try to think of ways to refactor the original to both improve readability and get rid of the MAX calls.

@Domsall
Copy link
Contributor Author

Domsall commented Sep 14, 2022

Yes, I had a hard time understanding/changing it all, too. But it works great by comparing, if the vehicle's following speed is sufficient or if the vehicle needs to stop at the junction.

Thanks in advance!

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.

None yet

2 participants