-
Notifications
You must be signed in to change notification settings - Fork 0
Simulation
Simulation uses Unity physics engine with a script that implements fluid dynamics. Also 3d model of the robot is added for correct collisions with objects.
Physics in Unity by default is accurate enough for games. For this simulation accuracy was improved by decreasing physics time step.
Thrusters in simulation have approximated thrust based on producer charts. Thrust is approximated with two quadratic equations.
ax^2 + bx + c
x is motor fill {1100 < x < 1900}
/ x^2 * -0.0000180414 + x * 0.0591933468 - 48.035 {x < 1472}
thrust(x) \ x^2 * 0.0000281376 - x * 0.0799177935 + 56.449759077 {x > 1528}
Every object that will be dynamic and is in the water has defined mass, volume, fluid dynamics constants, center of mass and center of volume. Those variables are needed to calculate correct dynamics in the water.
Shaders are used to give underwater effect to image. This helps testing and training YOLO. It is neural net that allows Okoń to see object in front of it. The most important ones are color correction that reduces reds in the image and fog which is responsible for limiting distance of seeing.
Camera settings in Unity are based on real values of the camera like sensor size and field of view.
Camera renders to a Render texture, which is than copied to Texture2D and encoded to a JPG bytes.