Hi,
I have recently started using Unity3D on Windows for robotics. My purpose of using Unity3D is to simulate a 4 wheeled robot with mecanum wheels (Mecanum wheels have rollers angled at 45 degrees to give omnidirectional kinematics for the robot).
In order to do that, I have created game object with a main body and 4 wheels with 9 rollers on each (so in total, 36 rollers). As the wheels are in contact with the rollers, I have disabled collision for the wheels but enabled for all rollers. Also, I made each roller to have the HingeJoint as in order to get an omnidirectional kinematics, they have to freely rotate around in X axis. (Each HingeJoint is attached to its respective wheel).
All in all, I got pretty decent results and my robot was able to perform omnidrectional movements but I have two problems that I cannot figure out:
-
Kinematics are not smooth enough. Robot cannot perform straight movement, it slighlty bends to the right when all 4 wheels are driving forward and when the wheels stop, rollers that are not in a contact with the surface are contionusly rolling and it makes “shaky” movements when the wheels are stopped completely. I thought my Inertia was wrong for a roller but it looks correct. Seems like the roller movement makes my whole robot to shake like it has a big impact.
-
My second problem is performance. When I enter into a play mode, everything is fine and I am getting good FPS. As soon as I start moving, I get sudden increase of my Physics, animation and rendering at 15FPS or lower. I do expect them to impact the performance as I have 36 rollers but is it even normal for such sudden decrease in FPS? What can I do here? (Note, I have AMD Ryzen 3950 and Nvidia GeForce 2080TI). I am attaching two images, my Profiler screenshot (you can notice that jump at the end of my CPU usage) and roller RigidBody and HingeJoint configurations.