How to use the encoder information from the motor as odometry data for ros

Hello.
I am currently working on research and implementation of robot_localization to improve the accuracy of robot location estimation.
I am currently working on building a sensor fusion environment with IMU and wheel encoders using a robot called nexusrobot.

I created a program to get the encoder values of each motor from the encoder through serial communication as shown in the image below.

Since I want to use the acquired data for robot_localization, I think I have to adapt it to nav_msgs/Odometry.

I think I’ve learned the basics of ROS (and I’m sure I’m wrong), but I’m confused about this task.

I am confused about this because I feel that I have already been able to get the nav_msgs/Odometry values easily in my previous learning.

How can I reflect the values retrieved from the motor in nav_msgs/Odometry?

If you have any references or information that would be helpful, I would appreciate it.
Also, if there is any part that you think I have misunderstood or have not learned enough, please point it out to me.

Thank you very much.

Translated with www.DeepL.com/Translator (free version)

Hello @Eimyver3 ,

You should have a look at the Basic Kinematics for Mobile Robots course. In Unit 3, Kinematics of Nonholonomic robots, it is explained how to convert encoder ticks into odometry data.

Thank you very much. I’ll try to learn it as soon as possible.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.