Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 2194 → Rev 2195

/Transportables_Koptertool/PKT/trunk/followme/followme.c
584,18 → 584,22
 
 
void Debug_GPS (void)
 
{
 
uint8_t redraw;
//char printbuff[100];
//
 
double l1;
GPS_Pos_t currpos;
 
set_beep( 25, 0xffff, BeepNormal ); // kurzer Bestaetigungs-Beep
redraw = true;
uint8_t mktimeout = false;
 
uint32_t NMEA_GPGGA_counter_old; // Merker: zaehlt empfangene GPGGA-Pakete
uint32_t send_followme_counter;
Point_t FollowMe;
 
 
while( true )
{
 
604,15 → 608,68
// NMEApos.lat = 0x0FB51D1F; //#
// NMEApos.lon = 0xE2CF4105; //#
//#
NMEApos.lat = 0x1f1db5fb; //#
NMEApos.lon = 0x0541cfe2; //#
// NMEApos.lat = 0x1f1db5fb; //#
// NMEApos.lon = 0x0541cfe2; //#
 
// l1 = NMEApos.lat;
//#
//#########################################################
 
int ok = GPSMouse_ShowData( GPSMOUSE_SHOW_WAITSATFIX, 500 ); // 500 = 5 Sekunden Verzoegerung nach Satfix
 
if( ok <= 0 )
{
return; // Fehler bzgl. BT GPS-Maus -> exit
}
 
if(NMEA_isdataready() && receiveNMEA)
{
if( NMEA.Counter > NMEA_GPGGA_counter_old )
{
if( (NMEA.SatsInUse > 5) && (NMEA.SatFix == 1 || NMEA.SatFix == 2) )
{
 
NMEApos.lat = NMEA.Latitude;
NMEApos.lon = NMEA.Longitude;
//Config.FM_Refresh
/*
FollowMe.Position.Status = NEWDATA;
FollowMe.Position.Longitude = NMEA.Longitude;
FollowMe.Position.Latitude = NMEA.Latitude;
FollowMe.Position.Altitude = 1; // 20.7.2015 CB
// FollowMe.Position.Altitude = NMEA.Altitude; // ist das wirklich ok? NEIN C.B.
 
FollowMe.Heading = -1; // invalid heading
FollowMe.ToleranceRadius = Config.FM_Radius; // 5 meter default
FollowMe.HoldTime = 60; // ????? go home after 60s without any update ??????
// FollowMe.Event_Flag = 0; // no event
FollowMe.Event_Flag = 1; // 20.7.2015 CB
FollowMe.Index = 1; // 2st wp, 0 = Delete List, 1 place at first entry in the list
FollowMe.Type = POINT_TYPE_WP; // Typ des Wegpunktes
FollowMe.Name[0] = 'F'; // Name des Wegpunktes (ASCII)
FollowMe.Name[1] = 'O';
FollowMe.Name[2] = 'L';
FollowMe.Name[3] = 'L';
// FollowMe.WP_EventChannelValue = 0; // Will be transferred to the FC and can be used as Poti value there
FollowMe.WP_EventChannelValue = 100; // set servo value 20.7.2015
FollowMe.AltitudeRate = 0; // rate to change the Aetpoint
FollowMe.Speed = Config.FM_Speed; // rate to change the Position
FollowMe.CamAngle = 255; // Camera servo angle in degree (255 -> POI-Automatic)
FollowMe.reserve[0] = 0; // reserve
FollowMe.reserve[1] = 0; // reserve
 
SendOutData( 's', ADDRESS_NC, 1, &FollowMe, sizeof(FollowMe) ); //'s' = target Position 'w' = Waypoint
send_followme_counter++;
 
//void SendOutData(uint8_t cmd, uint8_t addr, uint8_t numofbuffers, ...) // uint8_t *pdata, uint8_t len, ...
// SendOutData ('d', ADDRESS_ANY, 1, &tmp_dat, 1);
//SendOutData( 's', NC_ADDRESS, 1, (uint8_t *)&FollowMe, sizeof(FollowMe)); //'s' = target Position 'w' = Waypoint
*/
}
 
NMEA_GPGGA_counter_old = NMEA.Counter;
}
 
//-----------------------------------------
// Screen redraw
//-----------------------------------------
662,9 → 719,10
//############################## Test GPS Offset
 
 
nmea_move_horz(&NMEApos,&NMEATarget, Config.FM_Azimuth, Config.FM_Distance/1000); // neues Ziel berechnen
// neues Ziel berechnen
//nmea_move_horz(&NMEApos,&NMEATarget, Config.FM_Azimuth, Config.FM_Distance/1000); // neues Ziel berechnen
 
followme_calculate_offset(&NMEApos, &NMEATarget, 1, 1);
 
writex_gpspos( 1, 7, (int32_t)NMEATarget.lat , MNORMAL,0,0 ); // Ziel Latitude
writex_gpspos(10, 7, (int32_t)NMEATarget.lon , MNORMAL, 0,0 ); // Ziel Longitude
 
687,9 → 745,13
redraw = true;
// break;
}
}
}
}
 
 
 
 
#endif
 
#endif // #ifdef USE_FOLLOWME