go away spammer

Author Topic: robot positioning (odometry + gyro)  (Read 2907 times)

0 Members and 1 Guest are viewing this topic.

Offline MCTopic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
robot positioning (odometry + gyro)
« on: April 05, 2012, 08:31:56 AM »
Hey guys,

I am trying to build a robot and need some help regarding the positioning of the robot
i am using encoders and gyro for this purpose
i would liek to know if the below equation i am using to find the position is right or not
Xnew=Xold + (distance x sin(theta))
Ynew=Yold + (distance x cos(theta))
distance is the distance measured from the drive encoder and theta is angle measured form the steer encoder
how do i use my gyro angle information in the robot positioning?
is the above equation correct when only reading from the encoders
the reading wil be updated every time
should the gyro reading and calculated value  just  be confirmation value when comparing it with the above equation or the main reading should be from the gyro and the encoders are for confirming the result

help on this would be grateful

Thank you

Offline jkerns

  • Robot Overlord
  • ****
  • Posts: 270
  • Helpful? 12
Re: robot positioning (odometry + gyro)
« Reply #1 on: April 05, 2012, 09:20:25 AM »
Ummmm....

Theta is what, exactly?

This is a four wheel robot where theta is the angle of the steering input?
Two wheel differential drive where theta is calculated from the distance between the wheels and the difference in wheel speed?

The equation you have is fine if X and Y  are positions on a grid and theta is the angle at which the robot is traveling relative to the Y axis of your coordinate system - but a little more math will be involved if you want to calculate the trajectory from on board measurements and angles based on the robot coordinate system.  You will need to calculate the robot heading based on accumulated changes in direction (rate of turn times time)  then use the heading as your theta in your original calculation.

The gyro could be used to estimate your rate of change in direction. It may be more accurate than measuring a steering input angle or wheel speed differential due to wheel slip, bumps in the surface, etc. The problem with the gyro is that "zero" is typically not exactly 0 - so as you integrate the rate of turning small errors tend to add up. A magnetic sensor (compass) could be used to adjust the heading calculation. But, realize that the measurement of your steer encoder, the gyro, and a compass are going to give you three different results - which is right? :)
« Last Edit: April 05, 2012, 09:25:16 AM by jkerns »
I get paid to play with robots - can't beat that with a stick.

http://www.ltu.edu/engineering/mechanical/bachelor-science-robotics-engineering.asp

Offline MCTopic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: robot positioning (odometry + gyro)
« Reply #2 on: April 05, 2012, 09:40:21 AM »
This is a single drive wheel with two back free wheels. Now u mean to say that the heading angle should be used as theta and not the steer angle.
In this single wheel robot I am considering the original posn of the robot wrt the world coordinate frame (0,0) and then after moving the distance is given by the drive encoder and the robot has turned certain angle (reading from gyro) and steer angle is also measured.
Now which angle should I consider for theta...steer angle or gyro considering get the angle from the gyro in radians(not considring angular velovity now but direct angle) ??
 And what else maths do I need to put it to find the end x and y coordinates?

Offline jkerns

  • Robot Overlord
  • ****
  • Posts: 270
  • Helpful? 12
Re: robot positioning (odometry + gyro)
« Reply #3 on: April 05, 2012, 09:57:10 AM »
Theta in your equation is the heading of the robot in your coordinate system.

If you are using the typical gyro sensor, the output will be rate of change of heading. Adding those up (rate * time between updates) will give you the change in heading since you started the robot. But you still have the drift problem - when you power up, measure the gyro output with the device stationary to get the zero offset.

The change in heading from the steering sensor will be a function of the steer angle and how far you have driven along the radius defined by that steer angle.

Draw a sketch to see how your robot will move in response to the steering input (draw it in two or thee positions along a trajectory), that should help make it clear how the math  needs to be done.
« Last Edit: April 05, 2012, 09:58:45 AM by jkerns »
I get paid to play with robots - can't beat that with a stick.

http://www.ltu.edu/engineering/mechanical/bachelor-science-robotics-engineering.asp

 


Get Your Ad Here