Shop OBEX P1 Docs P2 Docs Learn Events
Gps bot — Parallax Forums

Gps bot

burp16burp16 Posts: 14
edited 2010-06-06 18:17 in BASIC Stamp
Hey I have been working quite hard on making a robot that navigates itself according to the gps signal provided.

Here is what I have:
Evil Genius Carrier Board for the Electronics
Ping Sensor with mounting bracket so it can look at 180 degrees
Basic Stamp 2
An RC Car as the chassis
Two continuous rotation servos as the front power wheels which will be used for the steering
Two non powered back wheels
9 volt battery to power the stamp and 6 volt battery to power the servos
GPS Module - Garmin Etrex Vista

Now I have permanently attached everything and I bought the interface cable for the gps to make it a d-sub connection. Now how do I implement the gps to communicate with the stamp, would i have to buy a female to female connector so i can connect it to the carrier board or do I only use some of the ports of the d-sub?

Also I have no idea how to code this, can someone please help me with this because I need help now. I want to be able to implement everything I discussed before and then manage the steering with the servos. Now how is this achieved.

Also will I be needing a compass module or can I use the one implemented in the GPS because it is included and if so how.

I dont want to dock this project as I have been working really hard on the base structure and now the coding and the other couple of problems discussed are proving to be very big obstacle, please can someone go step by step with me at how to implement the coding. Your help will be greatly appreciated Thank You. I will post pictures of the base soon and again thanks.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-06-02 03:24
    Start by measuring the levels out of the garmin to see if you need level converters or not. Get familar with nema sentences and the info you are going to use to navigate then write out the sequence of events you need to accomplish the task at hand. Take each piece of the plan and reduce it to code like statements and then to code. Test the code to see if it works and then go on to the next step.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • W9GFOW9GFO Posts: 4,010
    edited 2010-06-02 04:34
    I think you may have a problem with the GPS. The BS2 has precious little RAM, so little that it cannot (or is not practical to) parse the NMEA strings from the GPS. Parallax has a GPS with "Smart Mode" that does the parsing internally so that the Basic Stamp doesn't have to deal with it. It's even on sale now.

    Here is a compass.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • burp16burp16 Posts: 14
    edited 2010-06-02 19:38
    how exactly do you do this gps coding
  • FranklinFranklin Posts: 4,747
    edited 2010-06-02 22:03
    Somebody said...
    how exactly do you do this gps coding
    And what 'coding' would that be?
    most often you read in the data string from the gps and parse out the data you need to work with. The programming is up to you, you can do it any way you want to get the results you need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • burp16burp16 Posts: 14
    edited 2010-06-02 23:50
    Because I want to plot a course on the gps and have the robot follow it , how do I do that, I have no idea
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-06-03 00:00
    I am still getting all the data online for the follow up articles, but see if this helps you any. The following link has part 1 of three articles I wrote on GPS navigation. I used a BS2p for my tests. A BS2 could have handled the simpler stuff though.

    http://www.savagecircuits.com/gpsnav

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • stamptrolstamptrol Posts: 1,731
    edited 2010-06-03 16:12
    Does your Garmin have the serial cable output or the USB output? If its USB, it will be much harder (maybe impossible) to get the Stamp to read the data string.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • hover1hover1 Posts: 1,929
    edited 2010-06-03 17:09
    Just looked at the manual. It's RS-232.
  • burp16burp16 Posts: 14
    edited 2010-06-03 20:02
    I bought the interface cable which had the serial connection, now I just need the code with my setup, I looked around and I saw a code for the gps navigation but the control was with dc motors and degree steering and I do not know how to convert it to use with the servos and also do I need a compass, one is built in the gps so I thought I could just use that. Also can someone tell me what each point of the serial is for the RS-232 for the gps interface.
  • SergSerg Posts: 2
    edited 2010-06-04 00:03
    http://www.servomagazine.com/media-file ... ed_Car.zip

    thats the code your talking about i presume, i wanted to do the same thing and i couldn't understand how to translate the code so i can use it with my servo based bot. Help would be great
  • FranklinFranklin Posts: 4,747
    edited 2010-06-04 00:47
    Burp, your first task is to get the gps and the stamp connected and talking serial. Before you go on you should be able to see the gps sentences on the debug terminal. When you have that you can refine the data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • burp16burp16 Posts: 14
    edited 2010-06-04 01:43
    ok now exactly do you connect it to the stamp
  • FranklinFranklin Posts: 4,747
    edited 2010-06-04 01:47
    That's your job you find out what level of signal is output by the gps then do what is needed to convert that signal to something the stamp can handle. the baud rate should be 4800 8N1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • burp16burp16 Posts: 14
    edited 2010-06-04 01:56
    Yes it is, I need to know what wires i need to run through the serial port to connect to the stamp
    It has the nmea in/out option in the interface selection

    Post Edited (burp16) : 6/4/2010 2:01:07 AM GMT
  • FranklinFranklin Posts: 4,747
    edited 2010-06-04 03:09
    You need to connect TTL level rx on gps to tx on the stamp and TTL level tx on the gps to rx on the stamp or maybe you can use rs232 levels I don't remember and you can look that up as easy as I can. Sorry I'm not more help but it is your project. I'll stop not helping now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • W9GFOW9GFO Posts: 4,010
    edited 2010-06-04 04:26
    Will no one else join me in urging burp16 to abandon the idea of using the Etrex with the BS2 and recommend the Parallax GPS that I linked to above?

    I believe that parsing the NMEA strings on a BS2 will leave very little room for performing calculations, object detection, decision making and driving the robot. My experience with a GPS (the Parallax one with "Smart" mode) autopilot was that I ran out of room on the BS2, and I only drove one servo and had no object detection. Granted, that was a few years ago and I could probably code more efficiently now but still, I think pursuing the notion of making a GPS guided robot using the BS2 and raw GPS data will lead to frustration and disappointment.

    Please don't hesitate to correct me on my assumptions regarding the above.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • FranklinFranklin Posts: 4,747
    edited 2010-06-04 14:54
    W9GFO, I will agree that using smart mode will be much easier and at burp16s skill level would be very helpful but if all he needs is limited data it can be parsed from raw dats using the skip command. he only needs to read this data every couple of seconds so the program could work but burp16 has lots of reading and learning to do first.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • burp16burp16 Posts: 14
    edited 2010-06-04 15:52
    Unfortunatly I have three days to complete this and this is why I requested help, Thank you for all the suggestion but I need to use tis setup to run this and I only need it to run to curves at most so can someone please help me.

    The code sent by Serg has the setup provided but it is using a different gps and an actual compass module purchased from Parallax, here is the link again http://www.servomagazine.com/media-files/866/GPS_Guided_Car.zip this is the april 2008 issue

    Do I need an actual compass module or can I just use the one on the gps.

    This code is perfect except for the fact that it uses dc motors and a physical steering mechanism to drive to each waypoint. So can anyone help me convert it to moving it with solely servos, using two servos and if moved in opposite directions would rotate, if moved in same direction would go straight or backwards etc. with the ping sensor for object detection. Thank You

    Post Edited (burp16) : 6/4/2010 4:05:54 PM GMT
  • W9GFOW9GFO Posts: 4,010
    edited 2010-06-04 18:59
    It would appear that you do not need a separate compass...
    http://www.gpsinformation.org/dale/nmea.htm#HCHDG said...
    HCHDG - Compass output is used on Garmin etrex summit, vista , and 76S receivers to output the value of the internal flux-gate compass. Only the magnetic heading and magnetic variation is shown in the message.

    $HCHDG,101.1,,,7.1,W*3C

    where:
    HCHDG Magnetic heading, deviation, variation
    101.1 heading
    ,, deviation (no data)
    7.1,W variation

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • W9GFOW9GFO Posts: 4,010
    edited 2010-06-04 19:40
    burp, since you have such a short time may I suggest that you forgo the GPS position capture and focus on obtaining the compass heading data. Then use the compass heading and dead reckoning to navigate your robot. When you accomplish this, then add in object detection and finally GPS positioning.

    This way you have a shorter path to a working robot that you can demonstrate and the things you learn along the way can be applied to adding more complexity.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • burp16burp16 Posts: 14
    edited 2010-06-05 03:06
    Can you help me do this because I am very limited and I have no approach in doing this
  • FranklinFranklin Posts: 4,747
    edited 2010-06-05 03:45
    Perhaps you should pick another project as you do not have time to learn what you need to know before your deadline. Next time you need to start earlier or start with something you know. Have you been sucessful getting data out of the gps yet? If so post that code and let us know what data sentence you need to get the data from for your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SergSerg Posts: 2
    edited 2010-06-05 23:23
    Franklin said...
    Perhaps you should pick another project as you do not have time to learn what you need to know before your deadline. Next time you need to start earlier or start with something you know. Have you been sucessful getting data out of the gps yet? If so post that code and let us know what data sentence you need to get the data from for your project.

    Yes but how would i go on to receiving information from the gps, would i connect it to my computer then do what, thats where im lost? Im also doing a similar project.
  • hover1hover1 Posts: 1,929
    edited 2010-06-06 00:13
    Since you are using a Garmin Etrex Vista GPS, you would have to visit the Garmin website for that information. This forum is for Parallax products.

    Once you learn how to connect to the computer, and learn the terms used in the connections, and voltage specifications, then you will probably be able to connect to a BS2 for a future project.

    Jim
  • burp16burp16 Posts: 14
    edited 2010-06-06 16:38
    So no one can help to translate that code to use servos instead of dc motors
  • hover1hover1 Posts: 1,929
    edited 2010-06-06 17:29
    The link that Serg provided does not work, so there is no way to tell what language it was written in.

    The Robotics with the Boe-Bot Text v2.2 has every thing you need to set up a rodot platform with a BS2 and continuous rotation servos. You can find the downloads at the bottom right of this page:

    ·http://www.parallax.com/Store/Robots/AllRobots/tabid/128/CategoryID/3/List/0/SortField/0/Level/a/ProductID/302/Default.aspx

    You can download "Roaming with the PING))) v.1 (.zip)" on this page:

    ·http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/Ping/List/0/SortField/4/ProductID/92/Default.aspx

    This should keep you busy for a few days.

    Jim
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-06-06 18:17
    If your Garmin GPS has a serial connection (and it sounds as though it does), you need

    - a cable that connects to the Garmin on one side and has a standard DB-9 connector on the other.
    - to set up the Garmin's interface to NMEA In/Out (it sounds as though you've found that already)
    - then you need a breadboard-able Serial Interface adapter, like one of these:

    http://www.awce.com/rs1.htm

    You connect 5V and GND from your BS2 board to the +5V and GND pins of the adapter, and you send the output from the "T"·(yes, I know that sounds backwards) pin of the adapter to one of the BS2 I/O pins.

    - Then you set·up the program to read the serial data coming in from that pin at 4800 8N1, and to parse it to look for the particular data you need. This is where the BS2 will be very limited: you cannot read in entire NMEA strings and parse out the part that you need, as you won't have enough memory. You can, however, read a particular part of the data (say, the latitude) on one "pass", and then another part of the data (say, the longitude) on the next pass, one second later. You could do both of those variables on the same pass, but you cannot do the entire GPS string. This limitation may or may not cause you problems.

    - In order to read the data, you need a SERIN statement, using "WAIT" to look for the $GPGGA string, and then SKIP to jump to the part of that string that you're trying to read. This will involve learning to use SERIN, and counting bytes in the string. This site

    http://home.mira.net/~gnb/gps/nmea.html#gpwpl

    is one where you can see what kind of information you'll receive from the Garmin. I have spent this morning working with a similar setup, cabling my eTrex Legend to a terminal program to learn to send strings to set waypoints in the Legend. If you can connect temporarily to a terminal program it'll help you to ensure that your setup is working, and that you understand what it sent by the Garmin.

    ==============================
    If you have given up on the GPS idea (and I think you probably don't have anywhere near enough to time to learn what you need to for that), you should simply find the BoE-Bot text at the link that hover1 gave you, read that, and use it to set up the rest of your project. It tells you how to do what you need to do in far greater detail than you're going to get in three days of exchanges on the forum. You should know that you're extremely unlikely to get the kind of help you wanted from a forum, particularly in such a short time before your deadline. Forums are for specific questions on items you're stuck on after you've taken the time and made the effort on your own for the project overall. Asking someone to take you step by step through all of the coding for a complex project is simply not very realistic. I strongly suggest that you take hover1's good advice in the above post, and read those links carefully, and work through those texts. You got good advice here, but put yourself into a position such that you weren't able to take advantage of it.
Sign In or Register to comment.