Announcement

Collapse
No announcement yet.

need info mappoint/gps/vb6 developement

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • need info mappoint/gps/vb6 developement

    i have created an app. in vb6 with mappoint control for car navigation
    i read the com port on which the gps antenne sets its data.
    the user can type in a destionation location and the gps location is used as start location. if show the first element of the directions collection to the user (driver). after 2 seconds i do a complete recalc whereby is set the start location to the new gps location. again i show the first element of the directions collection to the user.

    this can't be the right way to go (cause for e.g. what if 2 or more directions are needed within the 2 seconds refresh rate i use)

    but i can't figure out how to go if i keep the start location fixed.
    Q: how to go on with the gps location and the directions. what direction element has to be shown?
    Q: what if the driver is lostand far off-track? how do the 'fixed' set of directions help in any way?

    Can anyone point me out how the program flow goes?
    Do i have to recalc over and over?
    How do i know of an refresh/recalc is needed during runtime?
    Don't need exact coding bus samples are always welcome.

    Greetings
    and a merry x-mas from holland

  • #2
    Originally posted by CorollaVerso'04
    i have created an app. in vb6 with mappoint control for car navigation
    i read the com port on which the gps antenne sets its data.
    the user can type in a destionation location and the gps location is used as start location. if show the first element of the directions collection to the user (driver). after 2 seconds i do a complete recalc whereby is set the start location to the new gps location. again i show the first element of the directions collection to the user.

    this can't be the right way to go (cause for e.g. what if 2 or more directions are needed within the 2 seconds refresh rate i use)

    but i can't figure out how to go if i keep the start location fixed.
    Q: how to go on with the gps location and the directions. what direction element has to be shown?
    Q: what if the driver is lostand far off-track? how do the 'fixed' set of directions help in any way?

    Can anyone point me out how the program flow goes?
    Do i have to recalc over and over?
    How do i know of an refresh/recalc is needed during runtime?
    Don't need exact coding bus samples are always welcome.

    Greetings
    and a merry x-mas from holland
    You should only need to recalculate if you've gone off track, then it recalculates from where you are!

    MapPoint for Navigation? I said it many times, don't bother!
    Laidback


    The ultimate CarPC - Wow!

    Comment


    • #3
      uhmmm.... wrong forum to post?

      Comment


      • #4
        I think the issue is how to detect if you've gone off track? I assume this is done by getting a location object for your current position and comparing the details of that location with the items in the directions collection. I'm not sure how to do this specifically but haven't studied the problem at length either. If recalculation is fast enough, perhaps you can just compare the top items from the original directions collection with your newly computed route. If they differ then either you've gone off route or you've already completed the first instruction.
        2004 4runner

        Comment


        • #5
          Originally posted by mpattonm
          uhmmm.... wrong forum to post?
          really

          @CorollaVerso'04

          but I agree with rando ... once you select a destination you would calculate all the directions required to get to that destination from your start point. The only time you would need to calculate is when you go off track in which case you would need to recalculate a new set of directions to the destination.

          Your 2 seconds refresh should be fine, a possible work around would be to identify the average speed and if there happens to be 2 (or more, though unlikely) directions within that time period just display them next to one another.
          Caputer Mk. II
          '02 VX Holden Commodore Series II Executive
          MII12000, 512MB RAM, 60GB HDD (5400rpm), 16X DVD, TS200V
          Morex 60W DC-DC, Custom S/SDC
          OS/Software: Developing...

          Comment


          • #6
            Originally posted by OdysseyPC
            really
            It was moved after his comment.
            [H]4 Life
            My next generation Front End is right on schedule.
            It will be done sometime in the next generation.
            I'm a lesbian too.
            I am for hire!

            Comment


            • #7
              @frodo: did i post in the wrong forum???

              Comment


              • #8
                Mappoint can be used for real-time navigation very effectively, however, it does have some major limitations that have to be overcome if you want to compete with something like destinator that was built just for real-time nav. Specifically theres the issues that you have already run into like how do you get directions and know which part of the route the GPS is on so you can show that direction. This can be easily accomplished by using the DistanceTo method from your current location to the Direction object your currently on, starting at 1 and incrementing everytime you say get within .1 miles of it until you reach the destination. For automatic route recalculation, the only way that I have found to do it well is to do visual analysis of the map for the route. If the current GPS location is far away from any part of the blue or green highlighted route, it must mean you have gone off course so you must recalculate. I use the copy method to get the bitmap data to do this and post process it alot to get it to a form I use for analysis.

                Once you get these features working your still going to have to jump through a lot more hoops to get the SDK to do what you want. The most pressing of which, I think, is autorotation, which can be done, but is very CPU intensive since your rotating bitmap data not vector data and I've only been able to do it well by using Direct3D and taking advantage of 3D hardware which can yeild frame rates well in access of 100 fps while rotating versus maybe 15 fps you'll get otherwise. Another problem is recalculating routes on a highway or other limited access road since any starting location that starts on a highway will be automatically moved to the nearest non-limited access road, it means any route you calculate or recalculate while driving on a highway won't start where it should. The maps in mappoint are also not very good for use in the car since they are low contrast so I have found recoloring the roads is a must. All these limitations can be overcome, however, you will have to step outside of the SDK to do all of this and probably outside of VB to a lower level language. I used C++ for everything.
                StreetDeck.com Developer (I am Chuck)
                Get StreetDeck at http://www.streetdeck.com
                The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

                Comment


                • #9
                  In-car navigation with MapPoint (in EU)

                  Thanks a lot for your reaction. This was the kind of input I was looking for.
                  A few questions on your reaction came up:
                  1. has Destinator got european maps (Belgium / Netherlands / Luxemburg / Germany)?
                  2. Autorotation is something I don't bother much, I search trough the second direction element for words like: left,right(etc),bear,first(etc),roundabout and show a picture I have drawn for that.
                  3. @"recalculating routes on a highway.." what is meant by: "(non-)limited access roads". It might sound dumb but i havent got much of a clue...and english isn't my native language at all. Is it "Limited" like limited for distinct user groups say like bicycles etc.?
                  Thanks!

                  Comment


                  • #10
                    Originally posted by CorollaVerso'04
                    3. @"recalculating routes on a highway.." what is meant by: "(non-)limited access roads". It might sound dumb but i havent got much of a clue...and english isn't my native language at all. Is it "Limited" like limited for distinct user groups say like bicycles etc.?
                    Thanks!
                    In this case, a highway = limited access road. Limited access means specialized on-ramps and exits, no crossroads except as a briged overpass or underpass and no traffic lights. Think Autobahn.
                    Originally posted by ghettocruzer
                    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
                    Want to:
                    -Find out about the new iBug iPad install?
                    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

                    Comment


                    • #11
                      Originally posted by CorollaVerso'04
                      2. Autorotation is something I don't bother much, I search trough the second direction element for words like: left,right(etc),bear,first(etc),roundabout and show a picture I have drawn for that.
                      You don't actually have to search through the direction text for this, you can use the Action property of the direction. It returns an enumerated type that describes the direction. This type is only partially documented though!!! I was able to find out the rest of the types though by devling into the .NET SDK for mappoint. The enumerated types I came up with was this (13 and above were undocumented:

                      enum GeoDirectionAction
                      {
                      geoActionOther = 0,
                      geoActionDepart = 1,
                      geoActionArrive = 2,
                      geoActionTurnLeft = 3,
                      geoActionTurnRight = 4,
                      geoActionBearLeft = 5,
                      geoActionBearRight = 6,
                      geoActionMerge = 7,
                      geoActionContinue = 8,
                      geoActionCrossBorder = 9,
                      geoActionTurnBack = 10,
                      geoActionEnterRoundabout = 11,
                      geoActionExitRoundabout = 12,
                      geoActionConstruction = 13,
                      geoActionNameChange = 14,
                      geoActionLeftLeft = 15,
                      geoActionLeftRight = 16,
                      geoActionRightLeft = 17,
                      geoActionRightRight = 18,
                      geoActionTakeRamp = 19,
                      geoActionTakeRampLeft = 20,
                      geoActionTakeRampRight = 21,
                      geoActionKeepStraight = 22,
                      geoActionKeepLeft = 23,
                      geoActionKeepRight = 24
                      };
                      StreetDeck.com Developer (I am Chuck)
                      Get StreetDeck at http://www.streetdeck.com
                      The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

                      Comment


                      • #12
                        Thanks!
                        Slowly but surely i'm getting somewhere, i hope ;-)
                        I think i found another solution too for recalculation the routes:
                        First ask the user for the destination, make it the route-end waypoint. Then get the current GPS position, make this the route-start waypoint. Calculate the route. From now on make a new waypoint that is called 'current position waypoint (cpw)'. Do a waypoint-reorder, or do a 'distance to' on the severall directions. If the cpw has a too big distance to the directions then you are getting off-track. In this case a recalculation comes in place, or so (didn't work that out). The cpw is updated on a regular basis.

                        At least now i don't think a 2 secs. interval for rebuilding the the whole route (start-route and route-end) and recalculation is nessecary. Also, with the cpw i can detect if a direction element is near on the track and needs to be shown. In my first prototype application the second direction element was always shown, even if it was km's ahead. I just showed the second one after each recalc, regardless of the distance and regardless of being off route.

                        Comment


                        • #13
                          Originally posted by CorollaVerso'04
                          Do a waypoint-reorder, or do a 'distance to' on the severall directions. If the cpw has a too big distance to the directions then you are getting off-track.
                          That probably should work. I thought of this too, but didn't implement it because I thought distances were calculated from locations to direction start locations. This would mean you could be moving away from all direction objects in your route and still be on the route if it was real curvy. I later heard that the distances to direction objects are actually the distance from a location to the closest point on the directions route segment. If this is true, your way probably will work real well.
                          StreetDeck.com Developer (I am Chuck)
                          Get StreetDeck at http://www.streetdeck.com
                          The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

                          Comment


                          • #14
                            waypoints diffs

                            Well I noticed something yesterday short before going to sleep:
                            If I take to waypoints and ask for te distance between them I get, lets say, 3.6 kms. But if I set up a route with these wps. as start and end I get a tripdistance of 5.3 kms.


                            It was late and had to go to bed so I didn't have time to figure out where the difference comes from.

                            Comment


                            • #15
                              The lower number is probably the line of sight measurement. (direct line)
                              [H]4 Life
                              My next generation Front End is right on schedule.
                              It will be done sometime in the next generation.
                              I'm a lesbian too.
                              I am for hire!

                              Comment

                              Working...
                              X