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

Simulation time slows down for low FPS #211

Open
samiamlabs opened this issue Oct 4, 2023 · 9 comments
Open

Simulation time slows down for low FPS #211

samiamlabs opened this issue Oct 4, 2023 · 9 comments

Comments

@samiamlabs
Copy link

Hi!

I would like the physics to run in real-time even for low FPS, but this does not seem to be the case in a project based on the turtlebot3 example that I'm working on. Time slows down for the simulation. I suspect that it has something to do with RRLimitRTFFixedSizeCustomTimeStep?

image

Is there some way to deactivate the custom time step stuff (if that is indeed the problem...)? It would be nice to be able to use timestamps from system time on my sensor messages if possible.

@yuokamoto
Copy link
Contributor

Hello, thanks for your question.

You can disable RRLimitRTFFixedSizeCustomTimeStep by deleting here https://github.com/rapyuta-robotics/turtlebot3-UE/blob/6f118f8a08f5b5251e458b014d9a8a03c35736ab/Config/DefaultEngineBase.ini#L23

@samiamlabs
Copy link
Author

Thank you for your quick response :)

I tried removing the line: CustomTimeStepClassName=/Script/RapyutaSimulationPlugins.RRLimitRTFFixedSizeCustomTimeStep

but I still see the Synchronized thing in the FPS view and the simulation is running slower than real-time
image

Do I need to do something besides recompiling for the changes to take effect?

@yuokamoto
Copy link
Contributor

you need to

  • restart editor with run_editor.sh since the script generate DefafultEngine.ini
    or
  • directoly change setting in editor and replay
    image (1)

@samiamlabs
Copy link
Author

Restarting after removing the line sets the Custom TimeStep to None in Project settings and removes the text in the FPS widget. Thanks!

image
image

Unfortunately, this did not seem to fix the issue with, for example, UGameplayStatics::GetTimeSeconds(GetWorld()) not returning seconds in "real-time".
I tried removing everything from the world and that just makes the time run faster than real-time.
If I create a fresh project without any ROS2 stuff, UGameplayStatics::GetTimeSeconds(GetWorld()) seems to return seconds that run in real-time.

Any ideas about why this is happening?

@samiamlabs
Copy link
Author

I tried setting bUseFixedFrameRate=True, but this did not seem to make any difference.

Thank you for the tip anyway @yuokamoto!

@yuokamoto
Copy link
Contributor

you should try bUseFixedFrameRate=False, then UE will use variable time step to try to achieve best effort

@samiamlabs
Copy link
Author

samiamlabs commented Oct 9, 2023

Oh, sorry. I meant that I set it to False...

@yuokamoto
Copy link
Contributor

hmm

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

No branches or pull requests

2 participants