Fix the issue of transition dynamics not work in relative speed action when the act to which it belongs is before the act to which its rerence entity belongs#589
Conversation
…n when the act to which it belongs is before the act to which its rerence entity belongs
|
Thanks, seems like an interesting find! |
- sample target speed again when action is restarted
|
Thanks for the provided scenario. It really helps investigation. To clarify interpretation of the relative SpeedAction: esmini will only apply transition once, while reaching the target speed. Once reached the target speed esmini will either 1. end the action (continuous="false") or 2. exactly maintain the speed of referenced entity (continuous="true"). While investigating we tried a slightly different approach: Run SpeedAction without continuous mode and instead restart the SpeedAction as soon as the speed deviates again. I.e. looping:
However, we found two issues in esmini:
These issues are now fixed by commits ee1cc5e and 40cbc7e, both merged on dev branch (will be part of next release). Updated behavior: Reference for the relative speed will always be the current speed of referenced entity. The scenario repeated_relative_speed.xosc is based on yours but modified according to the above strategy. To demonstrate the scheme, the target car (actor_1) is aggressively accelerating and decelerating three times. Ego will try to follow the speed changes. It's now being used in a smoke test case. Note that this scenario will work only with the applied commits. Summary: To my understanding the commits solves the root cause of the problem you encountered, but in a slight different way than your proposed code change (cleaning up code instead of adding code to fix the issue caused by old code). Please check whether your scenario works as intended with the fixes. Alternatively you can maybe make use of the approach in the test scenario. And again, thanks for reporting the issue! |
|
Thank you for your reply. I have tested with your submissions and found that using your scenario is feasible. However, using the scenario submitted in my issue still does not work as the rear vehicle did not maintain relative speed with the front vehicle. |
|
Indeed! Thanks for testing and reporting failure. You encountered a bug introduced in last commits that prevented continuous mode altogether. So that's why the action in your scenario is terminated as soon as the target relative speed is reached. The bug is fixed by commit 205a66b. Regarding behavior of the action: As previously stated, the transition only applies initially. Once relative speed is reached, the relative speed will be maintained. See plot below of modified variant of your scenario, i589_mod2.zip. I changed 1. ego initial speed to 21.222, 1 m/s slower than actor_1 22.2222 and rate from 0.02 to 5.0. So initially ego will accelerate with rate 5.0 m/s^2. Once reaching the relative speed 0 (as specified) transition is done and it will just maintain relative speed. In other words: Vehicle will accelerate or decelerate until it reach specified relative speed, then maintain it. The proposed change I agree is reasonable when transition dynamicsDimension is "rate". However it does not harmonize with dynamicDimension "distance" or "time", in which cases you expect an end of the transition phase. Potentially the continuous acceleration mode could be applied for "rate" only. But that adds some complexity that also can cause confusion. |
|
Thank you for your quick reply. But I am a bit confused about maintaining relative speed after reaching it, instead of considering acceleration. This is not explicitly stated in OpenSCENARIO, but I think that since the acceleration value is set, should the relative velocity be maintained according to this acceleration value, even if the relative velocity requirement has been met. What do you think about it? |
|
To test with all commits applied, just pull latest from dev branch. Regarding acceleration, I think I already outlined my thinking above. Summary: That it (“rate”) belongs to the transition, which is not always intended to go on forever. |

Hello,
I’ve encountered a problem where, if the RelativeTargetSpeed’s reference object is set after the current object, even if TransitionDynamics are set, RelativeTargetSpeed does not use the acceleration specified in the dynamics when adjusting speed, but instead directly uses the current speed of the target. Here is a scenario to reproduce the issue: