gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

X and Y with Raspberry Pi

Fri Sep 04, 2015 2:22 pm

Basiclly my question is how can I make a robot and works on x and y coordinates.
When I want it to go on x=50 and y=50 then it goes there.
Is this possible with the raspberry pi and python

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: X and Y with Raspberry Pi

Fri Sep 04, 2015 2:38 pm

Yes, it's perfectly possible.

I'd recommend a robot platform with stepper motors to drive the wheels. That's the easiest way.

You could also use DC motors with an optical encoder on the output.

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: X and Y with Raspberry Pi

Fri Sep 04, 2015 2:45 pm

gproduct wrote:Basiclly my question is how can I make a robot and works on x and y coordinates.
When I want it to go on x=50 and y=50 then it goes there.
Is this possible with the raspberry pi and python
http://www.instructables.com/id/Buildin ... and-Python
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Re: X and Y with Raspberry Pi

Fri Sep 04, 2015 2:50 pm

Yea but I'm more interested in the code

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: X and Y with Raspberry Pi

Fri Sep 04, 2015 2:57 pm

Pseudocode

Input x
Input y

Point front of robot forwards

Advance y steps

If x > 0
. Turn right 90 (LH motor fd RH motor rev)
. Advance x steps
Else
. Turn left 90
. x = x * -1
. Advance x steps

Return to “General discussion”