From: Default User on 30 Jul 2010 19:23 I have a project I'm working on that is related to route planning for simulated vehicles. Currently there are data files that contain the postition data (latitude, longitude, altitude) for some routes. These positions, along with the heading and speed at each point, are sent at a certain rate to a display program. I have already developed the code for doing speed and heading based on the waypoint information. As an expansion, we'd like to add the capability to do some free-form route-planning. The idea being that someone would choose a few major points and arrival times, and possibly loiter time. The program would then create a data file with the positions necessary to travel the route when updated at a given rate. So, a vehicle that updates at 20Hz needs to have more interolated points than one that updates at 1Hz. A simplistic method would be just to do straight lines between the points. I have routines that can interpolate points that way. That does get into the "left turn at Albuquerque" problem. I'd like to at least investigate some smoothing, perhaps some sort of spline technique. This is a C++ application. I want whatever I use to be integrated into the program, so I'm not really looking for a separate stand-alone application. Also, I can't just use existing libraries without going through a relatively extensive process here to have them approved. As such, I'd mostly be interested in C++ or C code snippets, or algorithms I could use to write something or adapt my existing code. Or just guidelines on the general methodology would be helpful. Naturally, if there's a better newsgroup for the question, I'd be interested in that information. My searches with Google Groups weren't terribly helpful. Brian -- Day 541 of the "no grouchy usenet posts" project.
From: Kai-Uwe Bux on 30 Jul 2010 21:10 Default User wrote: > I have a project I'm working on that is related to route planning for > simulated vehicles. Currently there are data files that contain the > postition data (latitude, longitude, altitude) for some routes. These > positions, along with the heading and speed at each point, are sent at a > certain rate to a display program. I have already developed the code for > doing speed and heading based on the waypoint information. > > As an expansion, we'd like to add the capability to do some free-form > route-planning. The idea being that someone would choose a few major > points and arrival times, and possibly loiter time. The program would then > create a data file with the positions necessary to travel the route when > updated at a given rate. So, a vehicle that updates at 20Hz needs to have > more interolated points than one that updates at 1Hz. > > A simplistic method would be just to do straight lines between the points. > I have routines that can interpolate points that way. That does get into > the "left turn at Albuquerque" problem. I'd like to at least investigate > some smoothing, perhaps some sort of spline technique. [...] Splines are a good idea because spline interpolation is fast. To map that onto your problem you regard the route as a curve in space given by three coordinates all depending on time and then applying interpolation to each of the coordinates separately. The only ramification is the coordinate system chosen: you mentioned latitude/longitude/altitude. What makes interpolating here a little tricky is that latitude and longitude are bounded. E.g., latitude ranges in [-90,90] degrees. Ordinary interpolation techniques (including splines) could take you out of that range. A simple solution would be to convert to Cartesian coordinates first, interpolate there, and then convert back the results. Since the spherical coordinate system behaves weirdly at the origin, you could check for that point. Another option would be to use functions like tan() to map, say, the latitude to a real number, use that for interpolation, and convert the results back to latituded via arctan(). In this case, the boundary values 90� and -90� require some special attention. Best Kai-Uwe Bux
From: Default User on 2 Aug 2010 15:59 "Kai-Uwe Bux" <jkherciueh(a)gmx.net> wrote in message news:i2vt5s$atc$1(a)news.doubleSlash.org... > Default User wrote: > >> A simplistic method would be just to do straight lines between the >> points. >> I have routines that can interpolate points that way. That does get into >> the "left turn at Albuquerque" problem. I'd like to at least investigate >> some smoothing, perhaps some sort of spline technique. > [...] > Another option would be to use functions like tan() to map, say, the > latitude to a real number, use that for interpolation, and convert the > results back to latituded via arctan(). In this case, the boundary values > 90� and -90� require some special attention. I was hoping not to have to reinvent something, at least from the algorithmic standpoint. I'll continue searching the web and see if I can find something already existing that's at least close to what I need. Thanks. Brian -- Day 544 of the "no grouchy usenet posts" project.
From: Hans on 6 Aug 2010 10:02 On 31/07/10 09:23, Default User wrote: > I have a project I'm working on that is related to route planning for > simulated vehicles. Currently there are data files that contain the > postition data (latitude, longitude, altitude) for some routes. These > positions, along with the heading and speed at each point, are sent at a > certain rate to a display program. I have already developed the code for > doing speed and heading based on the waypoint information. > > As an expansion, we'd like to add the capability to do some free-form > route-planning. The idea being that someone would choose a few major points > and arrival times, and possibly loiter time. The program would then create a > data file with the positions necessary to travel the route when updated at a > given rate. So, a vehicle that updates at 20Hz needs to have more > interolated points than one that updates at 1Hz. > > A simplistic method would be just to do straight lines between the points. I > have routines that can interpolate points that way. That does get into the > "left turn at Albuquerque" problem. I'd like to at least investigate some > smoothing, perhaps some sort of spline technique. > > This is a C++ application. I want whatever I use to be integrated into the > program, so I'm not really looking for a separate stand-alone application. > Also, I can't just use existing libraries without going through a relatively > extensive process here to have them approved. As such, I'd mostly be > interested in C++ or C code snippets, or algorithms I could use to write > something or adapt my existing code. Or just guidelines on the general > methodology would be helpful. > > Naturally, if there's a better newsgroup for the question, I'd be interested > in that information. My searches with Google Groups weren't terribly > helpful. > > > > > Brian > Have a look at a http://williams.best.vwh.net/avform.htm#Math This provides you with all formulas you need for your project.. Hans
From: Gene on 7 Aug 2010 20:51 On Jul 30, 9:10 pm, Kai-Uwe Bux <jkherci...(a)gmx.net> wrote: > Default User wrote: > > I have a project I'm working on that is related to route planning for > > simulated vehicles. Currently there are data files that contain the > > postition data (latitude, longitude, altitude) for some routes. These > > positions, along with the heading and speed at each point, are sent at a > > certain rate to a display program. I have already developed the code for > > doing speed and heading based on the waypoint information. > > > As an expansion, we'd like to add the capability to do some free-form > > route-planning. The idea being that someone would choose a few major > > points and arrival times, and possibly loiter time. The program would then > > create a data file with the positions necessary to travel the route when > > updated at a given rate. So, a vehicle that updates at 20Hz needs to have > > more interolated points than one that updates at 1Hz. > > > A simplistic method would be just to do straight lines between the points. > > I have routines that can interpolate points that way. That does get into > > the "left turn at Albuquerque" problem. I'd like to at least investigate > > some smoothing, perhaps some sort of spline technique. > > [...] > > Splines are a good idea because spline interpolation is fast. To map that > onto your problem you regard the route as a curve in space given by three > coordinates all depending on time and then applying interpolation to each of > the coordinates separately. > > The only ramification is the coordinate system chosen: you mentioned > latitude/longitude/altitude. What makes interpolating here a little tricky > is that latitude and longitude are bounded. E.g., latitude ranges in > [-90,90] degrees. Ordinary interpolation techniques (including splines) > could take you out of that range. > > A simple solution would be to convert to Cartesian coordinates first, > interpolate there, and then convert back the results. Since the spherical > coordinate system behaves weirdly at the origin, you could check for that > point. > > Another option would be to use functions like tan() to map, say, the > latitude to a real number, use that for interpolation, and convert the > results back to latituded via arctan(). In this case, the boundary values > 90° and -90° require some special attention. > > Best > > Kai-Uwe Bux Geodetic computations are notoriously hard to get right over any significant geographical area. Depending on the accuracy you need, the computations can be very complicated because the earth's surface is (roughly) an ellipsoid, not even a sphere. There are some free libraries available at the National Geospatial-Intelligence Agency web site that might give you some insight.
|
Next
|
Last
Pages: 1 2 Prev: 3 Rules of OOP? Next: 100% free dell laptaps offerd by dell and Vodafone companies. |