Help with using encoder data from Arduino with localization
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
Asked by hamzh.albar@gmail.com on 2018-07-15 03:12:47 UTC
Answers
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.
Asked by PeteBlackerThe3rd on 2018-07-15 17:07:51 UTC
Comments
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
Asked by hamzh.albar@gmail.com on 2018-07-15 17:11:45 UTC
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.
Asked by Tom Moore on 2018-07-16 09:19:07 UTC
Comments