ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how to localize my robot using rosserial

asked 2018-11-19 01:57:35 -0600

hasandaoud gravatar image

hello everyone, i am new to ros, just worked on it for several weeks. i was able to make a urdf robot (4 wheeled robot) and visualize it on rviz. then i was able to move that robot in a circle using the example in the ros_lib library provided on arduino. however, i want to upgrade my robot and move it in a closed area and localizing it on rviz using encoders or MPU6050 (10DOF). how could i do that using arduino mega and rosserial?

thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-19 13:39:12 -0600

Both of the localisation methods you mentioned are relative so they will drift over time as the errors accumulate. If you need accurate localisation over the long I would recommend looking into some form of absolute localisation as well.

To use encoders as a sensor to perform odometry you'll need to publish geometry_msgs/TwistWithCovarianceStamped describing the velocity of your robot. Your encoders measure wheel angular velocity directly so your first task will be to get your arduino making these measurements. When this is working you can use these rotation rates, the wheel diameters and separation distance to calculate the linear and angular velocity of your robot. You'll need to make a rough estimate of a constant value for the co-variance of these values, then you can construct and publish the twist message described above.

You then have two choices. You can integrate this velocity yourself to determine the robots position relative to its starting point, or you can use an existing ros package such as robot_localization to do the job for you.

Regarding the IMU, there are existing packages such as razor_imu_9dof that can do the job for you. I really recommend looking into them because it's not a trivial task.

edit flag offensive delete link more


@PeteBlackerThe3rd It's after 2 years but still I hope I get the answer

I'm working on the similar type of robot with 4 Wheels, I'm using encoders for odometry I've worked on diff-drive but now I'm using 4 wheels. so, how do I get the odometry from 4 encoders?

and I'm using omni-wheels

me_saw gravatar image me_saw  ( 2020-10-20 06:59:37 -0600 )edit

@me_saw Can you ask this in a new question. We want to avoid question threads from going off topic. Happy to answer it there.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2020-11-03 05:24:22 -0600 )edit

Question Tools


Asked: 2018-11-19 01:57:35 -0600

Seen: 338 times

Last updated: Nov 19 '18