# How to implement a four Mecanum wheel robot kinematic model practically in code? [closed]

Above is the kinematic model of a four wheeled robot from Omnidirectional Mobile Robot – Design and Implementation.

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.
– Chuck
Commented Oct 13, 2020 at 17:41
• @50k4 , even I had the same doubt, can u please clarify regarding the last comment by OP? Thanks! Commented Oct 15, 2020 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
Commented Oct 13, 2020 at 18:10
• How to take heading using encoders? What equations to use Commented Oct 13, 2020 at 18:12
• The last one, omega z calculates the rotational velocity (which i falsely called heading previously)
– 50k4
Commented Oct 13, 2020 at 18:13
• What are the equations to calculate the robot angular velocity (omega z) using wheel encoder data? Commented Oct 13, 2020 at 18:21
• Tha last one you posted. Says angular velocity explocitly
– 50k4
Commented Oct 13, 2020 at 18:22