Shop OBEX P1 Docs P2 Docs Learn Events
Problem with GPS and BS2 from parallax — Parallax Forums

Problem with GPS and BS2 from parallax

tmd13tmd13 Posts: 16
edited 2008-06-15 02:01 in BASIC Stamp
Im trying to write a code for the parallax gps in bs2, im using the demo for the gps , i got it from parallax web page. But Im having problem trying to make the boe bot going from one point to the other, only using the latitude and longitude information.

If any of you guys have a code for this purpose ill appreciate you can provide it to me.
Or at least tell me what might be the problem

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-23 14:23
    You'll get more advice if you explain in some detail what you're doing and post your code as an attachment to your message.

    Using GPS latitude and longitude for navigation for a boe-bot is not very useful because of the minimum resolution of GPS which I think is about 9 feet. You'll need to use something else for navigation over short distances.
  • tmd13tmd13 Posts: 16
    edited 2008-04-23 17:39
    This is the file im working with. In this one i just set two points, and at the end point it should stop.
    I hope you can help me
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-23 17:43
    Please re-read my previous comment. Your basic idea won't work. Ordinary GPS is not capable of that sort of navigation
  • tmd13tmd13 Posts: 16
    edited 2008-04-23 18:40
    I understand that, but at least the gps gives me some info that i can use. For example wherever i put my boe bot, i compare the information im receiving from gps and compare that wit the information of the end point, if it is far try to get closer , things like that. i dont want my boe bot to get to an specific point, i just want it to get to an specific area. and i know there are several ways to do it without adding any extra components.

    I just want you to explain me a way that whenever i check a condition from the boe bot, it should do something.
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-23 21:59
    How about you come up with a list of the actions you want the BoeBot to do depending on the end point and the current position returned from the GPS receiver? You've got latitude and longitude primarily plus some other stuff that's less useful. How do you figure out which way to go?
  • tmd13tmd13 Posts: 16
    edited 2008-04-23 22:17
    The logic i use is for example if the longitude is decreasing is because is going in the right way, if it is increasing means that it is going in the oposite way, so it only has to to turn 180 degrees.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-23 22:24
    What do you mean by decreasing or increasing? I'm not being picky to be a pain. You have to define these things if you want to craft a correct program that does what you want.

    Have you tested your movement routines? They look like they ought to work, but there are variations from servo to servo and from boebot to boebot and a perfect 90 degree turn on one might not work quite right on another. You might have to adjust the pulse widths slightly to balance the movement of the two wheel servos.
  • tmd13tmd13 Posts: 16
    edited 2008-04-23 23:09
    I already test my servos, the problem is that i tried to make the boe bot to make a forward move if it was in a position, and put the boe bot in that position to see if it works. but it didn't. And im wondering what might be the problem.

    When i say decreasing and increasing what i mean is for example


    ·················································· N

    ··················································· |
    ··················································· |
    ·····················(B)················(A)······ |·················{A· = Latitude 25.7543 N;·Longitude· 80.3755 W}
    ··················································· |················ {B· = Latitude 25.7543 N; Longitude··80.3759 W}
    ··················································· |
    ················W - - - - - - - - - - - - - - - - - - - - - - - - - - - - -·E
    ··················································· |
    ··················································· |
    ··················································· |
    ··················································· |
    ··················································· |
    ··················································· |

    ····················································S

    In this case from point A to point B the only values that change is the longitude, and the position in longitude increased in the end point.
    So If the position where the boe bot is is smaller that the initial position, is because is moving in the oposite way, so it shold turn 180 degrees and forwar. until he reach the point B, that is the end of the path.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-24 00:04
    What do you mean by "but it didn't"? You need to describe what you did, what the circumstances were, and what happened.

    You don't have positions in the form 25.7543N. You have information in the form degrees / minutes / decimal minutes or maybe tenths of seconds plus a code for compass quadrant. How do you compare two positions in that format for less than or greater than? Have you actually looked at the code for the GPS receiver to see what is provided to you? It's very important that you understand what the GPS receiver is providing and what your existing sample program is doing.

    As I said before, the resolution of ordinary GPS is roughly 9 feet. That means that you will have to move your boebot 9 feet for the readings to change. That sort of works if your boebot is in the middle of a large parking lot or a large school gymnasium, but the boebot is going to have to move large distances and make large errors in the process of trying to find a particular coordinate.
  • Kenny LevinsenKenny Levinsen Posts: 19
    edited 2008-05-02 19:26
    He substracts the current coordinates with target ones, and get how long he is away from the target.
    As he moves closer, the number decreases, and when he is there, it is 0 (well, in theory).
    I believe that "but it didn't" meant it didn't do as he wanted it to do (move in the direction of the target).

    To tmd13:
    Theres some problems about your idea about the movement.
    Generally it is okay, but what if you boe-bot is turned 2 degrees to the left? Then it will end up a couple of cm from the target. What will the boe-bot then do? turn 90 or 180 degrees, and end up past the target again. You need to first calculate your exact direction versus the target, and then turn it appropriately, so longtitude and latitude will hit 0 at the same time (Or make some intelligent turning system that can turn it slightly to each side while driving).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The school nerd
  • CelticLordCelticLord Posts: 50
    edited 2008-06-15 02:01
    Off the top of my head the logic would have to....

    1. Using a compass figure out how many degrees to turn from curent point to desired point.
    2. Turn that many degrees.
    3. Go foward untill current Location (x, y) = Desired Location (x, y)

    In short GPS tells you where you are not how you are facing.
    You need a compass module in conjuntion with the gps.




    Post Edited (CelticLord) : 6/15/2008 2:06:37 AM GMT
Sign In or Register to comment.