Robotics StackExchange | Archived questions

how to localize my robot using rosserial

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.

Asked by hasandaoud on 2018-11-19 02:57:35 UTC

Comments

Answers

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.

Asked by PeteBlackerThe3rd on 2018-11-19 14:39:12 UTC

Comments

@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

Asked by me_saw on 2020-10-20 06:59:37 UTC

@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.

Asked by PeteBlackerThe3rd on 2020-11-03 06:24:22 UTC