Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 2198 → Rev 2199

/Transportables_Koptertool/PKT/trunk/gps/gps.c
69,7 → 69,8
// Definitonen für FollowMeStep2
#define LONG_DIV 10000000
#define LAT_DIV LONG_DIV
#define FOLLOWME_DEG2M 1/111111*LONG_DIV
#define FOLLOWME_M2DEG 111111
#define FOLLOWME_ROUND_100 100
 
 
# define NMEA_POSIX(x) x
125,15 → 126,20
const nmeaPOS *pkt_pos, /**< Start position in radians */
nmeaPOS *target_pos, /**< Result position in radians */
int d_lat, /**< Distance lat(m) */
int d_lon /**< Distance long(m) */
int d_long /**< Distance long(m) */
)
{
 
nmeaPOS p1 = *pkt_pos;
// only for test the "Debug-Mode"
target_pos->lat = pkt_pos->lat;
target_pos->lon = pkt_pos->lon;
target_pos->lat = ( d_lat * ( LAT_DIV / FOLLOWME_M2DEG ) ); //p1.lat +
target_pos->lon = 100 * (uint32_t)( (float)FOLLOWME_ROUND_100 / cos( (float)p1.lat / (float)LONG_DIV ) ) ; // ( d_long * ( LONG_DIV / FOLLOWME_M2DEG ) ); //
// 10 * 10000000 / 111111
 
 
// p1.lon + / FOLLOWME_M2DEG / FOLLOWME_ROUND_100 *
 
 
 
return 1;
}