Colin Stearns
/
qcControl
QC Control software
Fork of dgps by
Revision 64:d4818fb7813c, committed 2014-04-27
- Comitter:
- dylanembed123
- Date:
- Sun Apr 27 21:53:59 2014 +0000
- Parent:
- 63:6e4afaa03d07
- Child:
- 65:8e491bde6629
- Commit message:
- Fix GPS stuff
Changed in this revision
--- a/handle/handleGPS.cpp Sun Apr 27 14:08:51 2014 +0000 +++ b/handle/handleGPS.cpp Sun Apr 27 21:53:59 2014 +0000 @@ -60,8 +60,8 @@ } bool GPSHandle::if_image_location(){ - double lon_thresh = 0.00005; - double lat_thresh = 0.000035; + double lon_thresh = 0.0005; + double lat_thresh = 0.00035; //USB::getSerial().printf("Checking if at waypoint\r\n"); DataLocation current_loc = DH::Locs().getC(LHType_locs,DH::Locs().getI(LHType_locs)); DataLocation next_waypoint = DH::Locs().getC(LHType_targ,DH::Locs().getI(LHType_targ));
--- a/handle/mavcommands.cpp Sun Apr 27 14:08:51 2014 +0000 +++ b/handle/mavcommands.cpp Sun Apr 27 21:53:59 2014 +0000 @@ -27,6 +27,9 @@ double nLat=DH::Locs().getC(LHType_targ,DH::Locs().getI(LHType_targ)).getLat(); double nLon=DH::Locs().getC(LHType_targ,DH::Locs().getI(LHType_targ)).getLon(); double nAlt=DH::Locs().getC(LHType_targ,DH::Locs().getI(LHType_targ)).getAlt(); + USB::getSerial().printf("HM Lat %f\n",nLat); + USB::getSerial().printf("HM Lon %f\n",nLon); + USB::getSerial().printf("HM Alt %f\n",nAlt); if(moveValid&&cLat==nLat&&cLon==nLon&&cAlt==nAlt)return false; moveValid=false; cLat=nLat; @@ -124,6 +127,7 @@ } // Check for mission accepted if(myCmd[5]==MAVLINK_MSG_ID_MISSION_ACK){ + USB::getSerial().printf("Ack\n"); moveValid=true; if(startSetup&&ENABLE_MOTORS){ startSetup=false;
--- a/handle/mavcommands.h Sun Apr 27 14:08:51 2014 +0000 +++ b/handle/mavcommands.h Sun Apr 27 21:53:59 2014 +0000 @@ -106,7 +106,7 @@ setup(); readState=0; while(Mav::getSerial().readable()>0){char input=Mav::getSerial().getc();} - if(hasMoved()){ + if(cLon!=0&&cLat!=0&&hasMoved()){ USB::getSerial().printf("USING NEW WAYPOINT!!!\n"); // Issue count to init waypoint entry Mav::sendOutput(MAVLINK_MSG_ID_COUNT,(char*)&issueCount,sizeof(MAV_COUNT));
--- a/main.cpp Sun Apr 27 14:08:51 2014 +0000 +++ b/main.cpp Sun Apr 27 21:53:59 2014 +0000 @@ -113,14 +113,14 @@ { // Start Mav test - DH::Locs().add(LHType_targ,DataLocation(27.175015,78.042155,5.0)); + //DH::Locs().add(LHType_targ,DataLocation(27.175015,78.042155,5.0)); USB::getSerial().printf("Wait %d seconds\n",DELAYBOOT); wait(DELAYBOOT); - while(true){ - USB::getSerial().printf(".\n",DELAYBOOT); - MavCmd::get().run(); - wait(5); - } + //while(true){ + // USB::getSerial().printf(".\n",DELAYBOOT); + // MavCmd::get().run(); + // wait(5); + //} USB::getSerial().printf("Starting %d\n",sizeof(PacketStruct)); USB::getSerial().printf("Check GPS\n");