How to create a unicycle model in unreal engine?
I have the dynamics (differential equations) or the physics model for a turtlebot, which is a unicycle model.
How to model this in UE4?
How to create a unicycle model in unreal engine?
I have the dynamics (differential equations) or the physics model for a turtlebot, which is a unicycle model.
How to model this in UE4?
To those discovering this question: it is relatively easy to create a simple DE solver even with UE4 Blueprints. I have not performed extensive tests yet, but a simple 2D system based on nonlinear DEs I put together actually seems to work as intended.
Here is the gist: you need a delay block feeding off Event Tick (this will be firing events regularly with your chosen discrete step size) and you need to create an integrator element for each state of your system.
Attached to this answer is a Blueprint showing a possible implementation of the Van der Pol Generator with mu=2.5. Caveat: the inverse of ts (the step size) cannot go above the guaranteed framerate, otherwise you will run into issues with integration. In the attached example, we have ts=0.05, so the application needs to run at at least 20 FPS (30 or more is recommended for computation stability concerns).
To update the above solution, prefer NOT using the DELAY block. Rather infer a variable step directly feeding off Delta Seconds output of Event Tick. The downside is that the complete model must be computed on every frame. Whether that is a serious issue is left to research.
In the example above, SET TS on Event Tick equal to Delta Seconds and then GET TS where ever you need it (for autonomous systems it will be like in the example above, but if your model has inputs, multiply the inputs with TS as well).