Author Topic: GPS robot help  (Read 2667 times)

0 Members and 1 Guest are viewing this topic.

Offline 555 timer chip guyTopic starter

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
GPS robot help
« on: March 15, 2008, 04:11:54 PM »
I am building a robot that uses GPS to navigate beatwen two points. I need a way for the robot to calculate the heading to take from point 1 to point 2 using latitude, longitude, and a compass heading. I have one formula that I have created that works grate, but it is to complicated for the MCU on the robot to use.

Please help.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: GPS robot help
« Reply #1 on: March 16, 2008, 07:52:41 PM »
Why is it too complicated?

Can you post what you have?

Use a compass heading to point the bot in the desired heading.

Then use highschool trig to determine the required driving distance between both current and desired locations.

Offline frank26080115

  • Supreme Robot
  • *****
  • Posts: 322
  • Helpful? 2
Re: GPS robot help
« Reply #2 on: March 16, 2008, 10:06:40 PM »
GPS is not that accurate on a small scale to get the heading of a small robot, a car is a different story since it's fast.

I'm trying to use
http://www.sparkfun.com/commerce/product_info.php?products_id=761
but it's more trouble than it's worth

Try this
http://www.sparkfun.com/commerce/product_info.php?products_id=7915

Other than that, have a function that mixes motor speed, and store headings in a signed integer, calculate the difference between current heading and desired heading and plug into the mixing function.

If trig is a problem, generate a lookup table
« Last Edit: March 16, 2008, 10:08:49 PM by frank26080115 »

Offline 555 timer chip guyTopic starter

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: GPS robot help
« Reply #3 on: March 18, 2008, 05:37:08 PM »
Why is it too complicated?

Can you post what you have?

Use a compass heading to point the bot in the desired heading.

Then use highschool trig to determine the required driving distance between both current and desired locations.


Thats just it I am using a compass for heading But my MCU is not smart enough to do trig.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: GPS robot help
« Reply #4 on: March 23, 2008, 08:28:36 AM »
Quote
Thats just it I am using a compass for heading But my MCU is not smart enough to do trig.
Ohhhh you mean you know how to do it, but your MCU can't handle it . . .

Get a better MCU :P

AVR, PIC, and ARM can handle it. My Axon can easily handle that, too.


edit:
Quote
But my MCU is not smart enough to do trig.
considered using a lookup table?
« Last Edit: March 23, 2008, 08:29:31 AM by Admin »

Offline 555 timer chip guyTopic starter

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: GPS robot help
« Reply #5 on: March 25, 2008, 11:55:37 AM »
considered using a lookup table?

?????????????????  what is a lookup table? ???

Offline AndrewM

  • Robot Overlord
  • ****
  • Posts: 255
  • Helpful? 0
Re: GPS robot help
« Reply #6 on: March 25, 2008, 02:45:36 PM »
Each trig function has a base range, or domain.   Everything beyond that range is just multiples of pi or repeats of previous values, depending on the function.  A lookup table is an array of values that you can use to store this base range.  For instance, lets say you were using the "Sine" function to compute your locations.  You could create an array variable(lets call it SINLOOKUP) in memory containing the values of the sine function, such that where X is equal to the numerical count of the array (SINLOOKUP[X]), the value of SIN(X) is stored in that spot.  Now when you need to know what the sine value is of 47, you just "look up" item number 47 in your array.  Basically:  SINLOOKUP[X] = sin(X).  You can also do the same thing a variety of other ways depending on your processors capabilities.
blog: www.iamwhen.com
Saving the world from humanity one robot at a time.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots

Offline 555 timer chip guyTopic starter

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: GPS robot help
« Reply #8 on: April 16, 2008, 12:01:58 PM »
Never mind I got a new MCU that has trig functions built in.

Thanks for all the help.

 


Get Your Ad Here