How to implement a 4 Mecanum wheel Robot kinematic model Practically in code?

Above is the Kinematic model of a 4 wheeled from https://cdn.intechopen.com/pdfs/465/InTechOmnidirectional_mobile_robot_design_and_implementation.pdf, My question is how to use these kinematic equations while coding on a micro controller? I have an IMU and wheel encoders, how to use these sensor data and achieve odometry for the robot

• Welcome to Robotics XXX, but I'm afraid that it is not clear what you are asking. We prefer practical, answerable questions based on actual problems that you face, so it's a good idea to include details of what you want to achieve, what you tried, what you saw & what you expected to see. Please take a look at How to Ask & tour for more information on how stack exchange works and work through the Robotics question checklist to edit your question to make it clearer. Oct 13 '20 at 17:41
• @50k4 , even I had the same doubt, can u please clarify regarding the last comment by OP? Thanks! Oct 15 '20 at 6:45

I think I figured out, please someone confirm if i'm right

In the above equations, w1, w2, w3 and w4 are taken from the wheel encoders at each time step and (x,y) of the robot are updated as per the equations and using an IMU orientation of the robot is calculated and updated according to the equations at each time step.

• no, heading is also taken from the encoders. IMU is not included here, that comes after you have the Cartesian velocities, as a separate sensor fusion step.
– 50k4
Oct 13 '20 at 18:10
• How to take heading using encoders? What equations to use Oct 13 '20 at 18:12
• The last one, omega z calculates the rotational velocity (which i falsely called heading previously)
– 50k4
Oct 13 '20 at 18:13
• What are the equations to calculate the robot angular velocity (omega z) using wheel encoder data? Oct 13 '20 at 18:21
• Tha last one you posted. Says angular velocity explocitly
– 50k4
Oct 13 '20 at 18:22