Calculate position using robot_localization
Hi,
I have a cart which has a base ( with four wheels) thats front wheel driven by two motors and fitted with encoder (one for each front wheel).
I calculate the distance traveled by counting the ticks and with the help of the heading angle. Hence the distance covered and angle are in Global coordinate frame.
I also calculate the instantaneous X velocity and angular rate which are in the kart co ordinate frame (forward and right is positive).
I also have an IMU razor_imu which gives me the orientation, linear velocity and linear acceleration in the Kart frame (I think??).
When I use the robot_localization package to calculate odom_comined using the following launch file robot_localization.png the orientation seems to be right but my position keeps on adding even when my cart is turned 180. The problem is the code is only accepting velocity values and not the position itself as input from odom message. So if the Cart turns 180, my instantaneously velocity is still positive.
Can someone please suggest a solution?
The measuremnt co variance of the imu is imu_covariance.png and for the encoders encoder_covariance.png
Thanks Sriram
I see at least a few areas for improvement. I would start here: http://docs.ros.org/indigo/api/robot_...
I already read that. That's why I've set the initial co variances as follows and other params
And also take a look at this example: https://github.com/cra-ros-pkg/robot_...
Hi thanks for the help. but I have not posted the question here without trying all possible solution.
The documentation I linked to suggests that (in most cases) you shouldn't be fusing both
(x, y)
and(vx, vy)
from odometry. Rather, you should only fuse the linear velocities instead of the position. I would personally do the same for the orientation and angular velocity from odom.I tried exactly the same but it didn't help. So I tried with only (x, y) but the node for some reasoon doen't accept it. So I included both.
OK. The other thing that jumped at me from your question is: "IMU ... gives me the orientation, linear velocity and linear acceleration in the Kart frame" The IMU is most likely reporting data in its own frame. Whether that happens to coincide with your vehicle's frame is a matter of placement.
Ya what I meant was that was not in the global frame. I have a transform which tells me where the imu is located from the base