![](/media/cache/profiles/2012_sf_avc_095.jpg.50x50_q85.jpg)
Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.
Dependencies: mbed Watchdog SDFileSystem DigoleSerialDisp
Diff: logging/logging.cpp
- Revision:
- 1:cb84b477886c
- Parent:
- 0:a6a169de725f
- Child:
- 2:fbc6e3cf3ed8
diff -r a6a169de725f -r cb84b477886c logging/logging.cpp --- a/logging/logging.cpp Mon May 27 13:26:03 2013 +0000 +++ b/logging/logging.cpp Tue May 28 13:58:35 2013 +0000 @@ -20,7 +20,7 @@ s->gHeading = s->cHeading = 0.0; //s->roll = s->pitch = s->yaw =0.0; s->gpsLatitude = s->gpsLongitude = s->gpsCourse_deg = s->gpsSpeed_mps = s->gpsHDOP = 0.0; - s->gpsLatitude2 = s->gpsLongitude2 = s->gpsCourse_deg2 = s->gpsSpeed_mps2 = s->gpsHDOP2 = 0.0; + //s->gpsLatitude2 = s->gpsLongitude2 = s->gpsCourse_deg2 = s->gpsSpeed_mps2 = s->gpsHDOP2 = 0.0; s->lrEncDistance = s->rrEncDistance = 0.0; s->lrEncSpeed = s->rrEncSpeed = s->encHeading = 0.0; s->estHeading = s->estLatitude = s->estLongitude = 0.0; @@ -176,23 +176,7 @@ fputc(',',logp); printInt(logp, s.gpsSats); fputc(',',logp); - - // GPS 2 - fprintf(logp, "%.7f,%.7f,", s.gpsLatitude2, s.gpsLongitude2); - //printFloat(logp, s.gpsLatitude2, 7); - //fputc(',',logp); - //printFloat(logp, s.gpsLongitude2, 7); - //fputc(',',logp); - printFloat(logp, s.gpsCourse_deg2, 2); - fputc(',',logp); - printFloat(logp, s.gpsSpeed_mps2, 2); - fputc(',',logp); - printFloat(logp, s.gpsHDOP2, 1); - fputc(',',logp); - printInt(logp, s.gpsSats2); - fputc(',',logp); - - + // Encoders printFloat(logp, s.lrEncDistance, 7); fputc(',',logp); printFloat(logp, s.rrEncDistance, 7); @@ -203,8 +187,11 @@ fputc(',',logp); printFloat(logp, s.encHeading, 2); fputc(',',logp); + // Estimates printFloat(logp, s.estHeading, 2); fputc(',',logp); + printFloat(logp, s.estLagHeading, 2); + fputc(',',logp); printFloat(logp, s.estLatitude, 7); fputc(',',logp); printFloat(logp, s.estLongitude, 7); @@ -213,25 +200,15 @@ fputc(',',logp); printFloat(logp, s.estY, 4); fputc(',',logp); + // Nav printInt(logp, s.nextWaypoint); fputc(',',logp); printFloat(logp, s.bearing, 2); fputc(',',logp); printFloat(logp, s.distance, 3); fputc(',',logp); -/* - printFloat(logp, s.gbias, 3); - fputc(',',logp); - printFloat(logp, s.errAngle, 5); - fputc(',',logp); - printFloat(logp, s.leftRanger, 3); + printFloat(logp, s.steerAngle, 3); fputc(',',logp); - printFloat(logp, s.rightRanger, 3); - fputc(',',logp); - printFloat(logp, s.centerRanger, 3); - fputc(',',logp); - printFloat(logp, s.crossTrackErr, 3); -*/ fputc('\n',logp); t2 = logtimer.read_us();