I DIDN'T EVEN READ IT I JUST SAW THAT PIC AND RAN AWAY
Get the angular rotation of the wheels (which you should have, but you can use the optical quad encoder to do it), you can multiply it by the radius of the wheel, times 2pi to get the circumference, then you'll know how many times it turned, and if I got the diagram correctly, it can only move horizontally and vertically. Two independent wheels would give you the x and y distance travelled.
---------- Post added at 09:34 PM ---------- Previous post was at 09:32 PM ----------
AND YOU CALL YOURSELF A PROGRAMMER... UGH.
v1.96 - Tutorials, Upgraded Town, Def Revamp
v1.97 - Cutscenes/Quests, Friend List
v1.98 - Classes, Necklace/Rings
v1.99 - Guilds
v2.00 - Open Beta
I DIDN'T EVEN READ IT I JUST SAW THAT PIC AND RAN AWAY
Next thing jeta needs to do is weponize it and sell it to dabe.
.Gragtastic.Failed Genius
It can also rotate 360 degrees and turn. Take the distance traveled on each wheel after it has rotated and turned at a range of 0-90 degrees in either direction. Using just the distances of the wheels, it is mathematically impossible to solve for the distance in the x and y axis. Trust me, I spent like 4 hours on it.
@Lehsyrus the environment is 100% predictable and known. All the entities accross the playing field can be preprogrammed inside of the robot. There is no need to detect obstacles.
Accross the playing field are cells (of very poor resolution) composed of white lines. The line followers could signal the robot whenever it has crossed a particular cell. If the location of this cell is know (and it is) the robot can resynchronize its position with the playing field if there are small errors.
I don't think I would need to measure the circumference of the wheels if I were using the accelerometer. I can calculate distance from acceleration itself.
I've got an interesting idea though (I'm not sure if it is what you were trying to explain to me.) I could attach the range-finder to a quad encoder and a moter thus allowing me to set it to point towards a given angle. After doing that, I could measure my distance relative to other entities or obstacles preprogrammed inside of the field and (with two given distances from any two obstacles) solve for my x and y position. What do you guys think?
There are two types of tragedies in life. One is not getting what you want, the other is getting it.
If you wake up at a different time in a different place, could you wake up as a different person?
Well that makes this a shit ton easier. That would work, though I feel like it's more work. If you were to do the equation @arunforce gave, you can get the distance traveled purely by the amount of rotation the wheels have turned. Actually, it may be even easier if you were to attach the range-finder to the quad encoder to instead measure the amount of rotation by each wheel to give an exact measurement. From there you can take the amount of degrees the wheel has rotated and get the exact distance the wheel has put you forward and back when stopping, from there you can plug in the equation I gave before (the same one arunforce gave but I shorthanded it) to get the overall distance with a full rotation.
So we would need the linear distance and we would have: Dπ * R = T
Where D is the diameter,
π is Pi,
R is the amount of revolutions,
and T is the total distance traveled.
So to get the distance traveled when stopped if it wasn't a full revolution you would want to take the same equation, however instead of using R as the amount of revolutions, you want to take the degree of rotation, use it as a decimal, and plug that in, then add everything together.
Now that I think about it, you might only need to use the quad encoder to count the amount of times the wheel has rotated, have it translate that using the formula above into the distance traveled, and profit.
Is there a specific point on the robot that needs to be used to calculate the distance? Then you're going to need to get the measurement to that point and plug that in as well.
The wheels can spin on their axis.
Imagine this: The the wheels to left and right move forward x units. Now that is a totally different ending position than if the right wheel moved x units while the left wheel did not, then after the left wheel moves x units and right wheel does not.
In the first case (both wheels move forward x units) the robot will move straight.
In the second, the robot will rotate with the left wheel as a pivot x units, then rotate with the right wheel as pivot at x units.
Same distance, totally different final location. Maybe I am not understanding you properly though.
Last edited by radnomguywfq3; 11-24-2012 at 10:14 PM.
There are two types of tragedies in life. One is not getting what you want, the other is getting it.
If you wake up at a different time in a different place, could you wake up as a different person?
I'm a bit confused. If it pivots on one wheel, the distance travelled would be in the shape of a circle, so couldn't you just just measure the center (assuming it pivots from there) out to the wheel, and consider that the radius, and if you know the angle, then you can calculate the distance travelled.
I'm kinda confused, can you draw a 2 picture diagram with a point of origin showing it rotate?
Also are you looking to determine its position absolutely (like -10m, -5m) on a coordinate plane, or are you trying to determiine how many feet is moves in each axis like to calculate how far its travelled?
Last edited by arunforce; 11-24-2012 at 10:34 PM.
v1.96 - Tutorials, Upgraded Town, Def Revamp
v1.97 - Cutscenes/Quests, Friend List
v1.98 - Classes, Necklace/Rings
v1.99 - Guilds
v2.00 - Open Beta
@Lehsyrus and @arunforce ... Reading through your comments and I'm amazed at how much knowledge you guys have in this field
Oh hai der.
Yar I can, but how do I know it has been pivoting. I need an absolute coordinate (x, y)
Okay, technically, I can assume when it has started and finished pivoting on which wheel since I am responsible for putting it inside of that pivoting cycle. I know this, but I think it is a very sloppy way of doing it just because now the calculated position is based off of a lot of different assumptions.
I.e, we assume no pivoting\rotating whatsoever has occurred when we wish to move in a straight line, the only problem with this is that the motors I am using are nowhere near perfect and the centre of mass is not entirely at centre. What actually ends up happening is the robot begins doing very small bits of rotations and pivoting as it travels between two points and, as you can imagine, this adds up to a pretty inaccurate calculation of position after travelling for a good minute or two.
There are two types of tragedies in life. One is not getting what you want, the other is getting it.
If you wake up at a different time in a different place, could you wake up as a different person?
xD i did something like that on 12 grade ...
If it was in a box room with no obstacles you could just bounce it off the walls using the ultrasonic range finder. Or you could run a simulation like the Mars Rover does, like if the steps are preprogrammed, assuming everything is accurate, you could simulate where it would end up and use the simulation to determine the coordinates. Dunno if your bot has the capabilities to do it, might need a computer to talk to.
---
Urgh just re-read your thing, if your thing is as inaccurate as you said, you probably won't be able to simulate it, though you should, but I'll just assume this is a tight budget project. One thing you could do is like leave a reflector at the origin and using a laser or something to bounce off it, assuming you have line of sight to it, but that would only give the distance, not the angle, so you wouldn't be able to get the components.
The analog accelerometer would be your best bet, attach it to the center of rotation, and as long as you know how many degrees you turned, you can derive the velocity and keep a constant track of it.
Last edited by arunforce; 11-25-2012 at 04:15 PM.
v1.96 - Tutorials, Upgraded Town, Def Revamp
v1.97 - Cutscenes/Quests, Friend List
v1.98 - Classes, Necklace/Rings
v1.99 - Guilds
v2.00 - Open Beta