Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of AigamozuControlPackets by
Diff: AigamozuControlPackets.h
- Revision:
- 7:200ce5c1f486
- Parent:
- 6:f164a716be46
- Child:
- 8:aff2d67d31c8
--- a/AigamozuControlPackets.h Mon Jun 09 00:16:38 2014 +0000 +++ b/AigamozuControlPackets.h Wed Jun 18 13:50:04 2014 +0000 @@ -9,6 +9,8 @@ #define CHANGE_MODE_COMMAND_LENGTH 12 #define RECEIVE_STATUS_COMMNAD_LENGTH 32 +#define vertex2D vector2D + enum COMMAND_TYPE {MANUAL = 'M', STATUS_REQUEST = 'S', CHANGE_MODE = 'C', RECEIVE_STATUS = 'R'}; enum MODE {STANDBY_MODE = 0, MANUAL_MODE = 1,AUTO_MODE = 2,AUTO_GPS_MODE = 3}; enum STATUS {GPS_AVAIL = 0, GPS_UNAVAIL = 1,GPS_OUT_AREA = 2}; @@ -17,7 +19,12 @@ long a; uint8_t b[4]; }; - + +struct vector2D{ + double x; + double y; + }; + class AigamozuControlPackets{ //--------PUBLIC-----------// @@ -54,6 +61,8 @@ int packetLength; + void reNewPoint(long latitudeH,long latitudeL,long longitudeH,long longitudeL); + //--------PRIVATE-----------// private: // @@ -68,6 +77,13 @@ //Auto Type 2 -> GPS void gpsAuto(); + + vector2D agzPoint; + vector2D sub_vector( const vector2D& a, const vector2D& b ); + bool checkGpsHit( vertex2D A, vertex2D B, vertex2D C, vertex2D P); + + vector2D basePoint[4]; + }; #endif \ No newline at end of file