Ask Your Question

Help with using encoder data from Arduino with localization

asked 2018-07-15 03:12:47 -0600 gravatar image

Hello everyone,

I'm a beginner to the ROS world, I'm using wheel encoders and a lidar to make a localization and mapping robot.

My question is about how to import and use the wheel encoders data from Arduino to use with Robot_loclization package.

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-15 17:07:51 -0600

Wheel encoders will produce relative positron estimates, so you want to convert the rear values into geometry_msgs/TwistWithCovarianceStamped messages describing the angular and linear velocity of your robot. You will be able to calculate these knowing the geometry of the robot (diameter of the wheels and the distance between them).

The covariance values don't need to be calculated but you will at least need to put in constant values which are fairly realistic for the robot_localization package to work properly.

Once you have these twist messages being produced properly you can feed then directly into the robot_localization package.

edit flag offensive delete link more


Cool, would you explain more on how to 1- convert the values into geometry_msgs/TwistWithCovarianceStamped messages ? 2-feed then directly into the robot_localization package.

Thank you gravatar image  ( 2018-07-15 17:11:45 -0600 )edit

For a differential drive robot, compute the linear velocity, and put that in the twist.twist.linear.x field. Then compute the angular velocity, and put that in the twist.twist.angular.z field. Then put non-zero values in the diagonal of the covariance matrix for those quantities.

Tom Moore gravatar image Tom Moore  ( 2018-07-16 09:19:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-07-15 03:12:47 -0600

Seen: 285 times

Last updated: Jul 15 '18