X,Y coordinates of moving robot.

Hi ,

I am making robotics vehicle which can avoid obstacles by using 2 ultrasonic sensors. I am now having trouble with x,y coordinates of robot. The task is to move robot from start point to set distination and avoid obstacles between these two points. I am using arduino mega , 2 HR-sc04 , stepper motors with encoder .
thanks ...

What sort of troubles are you having with the x,y coordinates?

jremington:
What sort of troubles are you having with the x,y coordinates?

I dont know how to set the X,Y coordinate so that my robot can move from point to point . thz

Here is some introductory reading on how to do that: Robotics/Navigation/Localization - Wikibooks, open books for an open world

jremington:
Here is some introductory reading on how to do that: Robotics/Navigation/Localization - Wikibooks, open books for an open world

thanks

Sithu:

jremington:
Here is some introductory reading on how to do that: Robotics/Navigation/Localization - Wikibooks, open books for an open world

Hi ,

I finally understand the method . Can you also please give me some refrence about how to write it on arduino programming ??? something like how to set starting point as (0,0) and track the path of robot as its move and generate a graph . Do I need any other sensor for that ?? Thanks you ..

Do you have wheel encoders on your robot?
If not, an overhead video camera connected to a PC is the only option likely to work for you.

If your surface is smooth enough, you can use optical way like a mouse. Point the mouse at the surface and read mouse input.

It would be pretty hard to be able to do that, but basically you will need an interupt attached to the ultrasonics so that when it gets within range, it triggers your avoidance script. Then you will need an accelerometer/gyroscope, where you can do some math to figure out the distance traveled in either x and or y, relating acceleration rate over period of time. Plus the gyroscope can tell your robot which way it is pointing. And the gyroscope/accelerometer can also tell you if your robot is tipped upside down. So basically the resultant math from the accelerometer gives you distance, that distance can be used to calculate how far you are in the xy coordinate Grid If you give it it's starting position.

liudr:
If your surface is smooth enough, you can use optical way like a mouse. Point the mouse at the surface and read mouse input.

surface will not smooth ..

jremington:
Do you have wheel encoders on your robot?
If not, an overhead video camera connected to a PC is the only option likely to work for you.

It has wheel encoders . btw I have another issue .. when i check the rpm of motors i got around 20 rpm for each motor .. if one wheel will rotate CW and others in CCW direction the robot will turn left or right .. I want to know that is it possible to calculate the angle that robot turn by using those values .

is it possible to calculate the angle that robot turn by using those values.

Of course it is possible. See this tutorial.

If you are just spinning the two wheels in opposite direction while maintaining the robot's center unchanged, the angle is much easier to calculate. Every encoder pulse you detect is matched to the angle of turning. If you have X encoder pulses per rotation, then each pulse indicates 360/X degrees of turning.

liudr:
If you are just spinning the two wheels in opposite direction while maintaining the robot's center unchanged, the angle is much easier to calculate. Every encoder pulse you detect is matched to the angle of turning. If you have X encoder pulses per rotation, then each pulse indicates 360/X degrees of turning.

jremington:
Of course it is possible. See this tutorial.

thanksss