Commit Graph

210 Commits

Author SHA1 Message Date
Andrew Tridgell
59b44816ec GPS: replaced the GPS auto-detect mechanism
the old mechanism wasted most of the input bytes, and chewed a lot of
CPU, making it impractical to do GPS detection for a GPS attached
after startup

The new code is async, and detects a GPS by looking for a fully formed
packet with the right checksum for each GPS type
2012-09-17 14:45:47 +10:00
Andrew Tridgell
ba9543ee04 GPS: NMEA bug fix from Alexey Kozin
thanks Alexey!
2012-09-12 15:04:24 +10:00
uncrustify
97035fbead uncrustify libraries/AP_GPS/GPS.h 2012-08-21 19:19:52 -07:00
uncrustify
20d1a94778 uncrustify libraries/AP_GPS/AP_GPS_IMU.h 2012-08-21 19:19:52 -07:00
uncrustify
4cd477d13d uncrustify libraries/AP_GPS/AP_GPS_IMU.cpp 2012-08-21 19:19:52 -07:00
uncrustify
6c885df832 uncrustify libraries/AP_GPS/AP_GPS_UBLOX.cpp 2012-08-21 19:19:52 -07:00
uncrustify
a48aa18d6f uncrustify libraries/AP_GPS/AP_GPS_MTK16.cpp 2012-08-21 19:19:52 -07:00
uncrustify
03b42037a0 uncrustify libraries/AP_GPS/AP_GPS_NMEA.h 2012-08-21 19:19:51 -07:00
uncrustify
da81115079 uncrustify libraries/AP_GPS/AP_GPS_NMEA.cpp 2012-08-21 19:19:51 -07:00
uncrustify
a8ed24da6c uncrustify libraries/AP_GPS/AP_GPS_SIRF.cpp 2012-08-21 19:19:51 -07:00
uncrustify
074f3ae872 uncrustify libraries/AP_GPS/AP_GPS_406.cpp 2012-08-21 19:19:51 -07:00
uncrustify
9ce7513096 uncrustify libraries/AP_GPS/AP_GPS_MTK.cpp 2012-08-21 19:19:51 -07:00
uncrustify
d8200a6aea uncrustify libraries/AP_GPS/AP_GPS_HIL.h 2012-08-21 19:03:13 -07:00
uncrustify
8ad83695b8 uncrustify libraries/AP_GPS/AP_GPS_MTK16.h 2012-08-21 19:03:02 -07:00
uncrustify
a91687f1cb uncrustify libraries/AP_GPS/AP_GPS_None.h 2012-08-21 19:03:02 -07:00
uncrustify
c95fc7b166 uncrustify libraries/AP_GPS/AP_GPS_406.h 2012-08-21 19:02:53 -07:00
uncrustify
65f55328e2 uncrustify libraries/AP_GPS/AP_GPS.h 2012-08-21 19:02:53 -07:00
uncrustify
4950bf3b95 uncrustify libraries/AP_GPS/AP_GPS_UBLOX.h 2012-08-21 19:02:46 -07:00
uncrustify
a8ad5f62a5 uncrustify libraries/AP_GPS/AP_GPS_MTK.h 2012-08-21 19:02:40 -07:00
uncrustify
9b3081345e uncrustify libraries/AP_GPS/AP_GPS_Auto.h 2012-08-21 19:02:40 -07:00
uncrustify
a133b098a5 uncrustify libraries/AP_GPS/AP_GPS_SIRF.h 2012-08-21 19:02:40 -07:00
uncrustify
5c24c373d0 uncrustify libraries/AP_GPS/AP_GPS_Shim.h 2012-08-21 19:02:40 -07:00
uncrustify
cdaf2f923d uncrustify libraries/AP_GPS/GPS.cpp 2012-08-21 19:02:32 -07:00
uncrustify
c5451b0e9b uncrustify libraries/AP_GPS/AP_GPS_HIL.cpp 2012-08-21 19:02:12 -07:00
uncrustify
b9d3f449b9 uncrustify libraries/AP_GPS/AP_GPS_Auto.cpp 2012-08-21 19:02:11 -07:00
uncrustify
9e43a9d090 uncrustify libraries/AP_GPS/examples/GPS_MTK_test/GPS_MTK_test.pde 2012-08-21 19:01:35 -07:00
uncrustify
0f5aff35fc uncrustify libraries/AP_GPS/examples/GPS_NMEA_test/GPS_NMEA_test.pde 2012-08-21 19:01:35 -07:00
uncrustify
1e8ea08bce uncrustify libraries/AP_GPS/examples/GPS_AUTO_test/GPS_AUTO_test.pde 2012-08-21 19:01:34 -07:00
uncrustify
9f2d71e544 uncrustify libraries/AP_GPS/examples/GPS_UBLOX_test/GPS_UBLOX_test.pde 2012-08-21 19:01:34 -07:00
uncrustify
12b5e53ce7 uncrustify libraries/AP_GPS/examples/GPS_406_test/GPS_406_test.pde 2012-08-21 19:01:34 -07:00
Andrew Tridgell
ddf9541c0a AP_GPS: fixed build of new MTK code 2012-08-22 10:02:21 +10:00
Craig Elder
2493ffaad1 GPS: Corrections to Media Tek GPS Driver. Change to 5Hz and SBAS 2012-08-22 09:56:25 +10:00
rmackay9
c10d01f24b AP_GPS: revert delay callback to be "unsigned long" 2012-08-18 20:33:45 +09:00
rmackay9
8a29f47ce0 AP_GPS: replaced "int" with "int16_t" and "long" with "int32_t" 2012-08-18 16:35:38 +09:00
Andrew Tridgell
2d47bd0386 GPS: support getting raw velocity values from a UBlox
this may give better velocity numbers than the value from COG
2012-08-15 20:06:35 +10:00
Andrew Tridgell
618f43bef6 AP_GPS: added last_ground_speed() method
used for dead-reckoning in AHRS
2012-08-11 11:59:47 +10:00
Andrew Tridgell
8a6fcf998b AP_GPS: fixed types to be stdint types 2012-08-11 11:59:03 +10:00
Andrew Tridgell
819b6459b2 GPS-UBlox: removed duplicate config messages
these were left over from debugging
2012-07-19 15:23:15 +10:00
Andrew Tridgell
f4faf941e2 GPS: test the more modern MTK16 2012-06-27 16:01:50 +10:00
Andrew Tridgell
37db5247cd GPS: added velocity and acceleration components
used by AHRS for acceleration correction
2012-06-27 16:01:49 +10:00
rmackay9
068fe64b9b ArduCopter HIL: changed calls to setHIL to send in time as a uint32_t (it was a float) 2012-06-26 22:50:17 +09:00
Andrew Tridgell
a851c53de4 GPS: need pgmspace.h for _write_progstr_block() 2012-06-15 16:27:11 +10:00
Andrew Tridgell
70f18289c5 GPS: fixed auto-config of UBlox setup with no UBX messages
if a UBlox is configured for NMEA only, with no UBX messages at all
then it would never trigger the GPS_AUTO detection. This adds a UBX
config message to the init strings that enables the NAV_SOL message
2012-06-15 15:53:27 +10:00
rmackay9
1e38b0d535 AP_GPS_NMEA: fix from Roberto Navoni to improve NMEA accuracy 2012-06-12 20:27:50 +09:00
Andrew Tridgell
f9560ef093 GPS: use the new nav_setting in a couple of the sample sketches 2012-06-10 16:35:13 +10:00
Andrew Tridgell
33a2ad7e07 GPS: add stub settings for nav_setting in the other GPS drivers
only Ublox supports nav_setting so far
2012-06-10 16:34:53 +10:00
Andrew Tridgell
514be604a5 GPS: added auto-configuration of UBlox GPS
the Ublox will now auto-configure for 5Hz with just the messages we
want. It also supports setting the navigation engine type
2012-06-10 16:34:13 +10:00
Andrew Tridgell
cbf477addd GPS: added debug code to the main GPS class 2012-06-08 16:42:03 +10:00
Andrew Tridgell
a8bfc5d8e9 GPS: re-open the serial port with a 256 byte serial receive buffer
this ensures all GPS parsers have a 256 byte buffer available
2012-06-08 16:42:03 +10:00
Andrew Tridgell
296e651b30 GPS: fixed the UBLOX parser to handle unknown messages
the parser was broken in several ways:

 1) when it received an unknown message it didn't update the ck_a and ck_b fields, so it
    thought the message had a bad checksum, which meant it got out of protocol sync

 2) the read() method would return false if the last message from the GPS was of an unknown type. 
    So we relied on the last msg always being one that we understand and want

 3) the parser considered any valid UBLOX message to be 'new data', whereas we only actually get 
    a new fix when we get box a new position and velned message

 4) the total message size per update is more than 128 bytes, but the serial port was opened 
    with only a 128 byte buffer, so we got corruption regularly
2012-06-08 16:42:02 +10:00
Andrew Tridgell
9c2ba2e814 GPS: tidy up the auto gps test 2012-06-08 16:42:02 +10:00
Andrew Tridgell
0f0cbce22f GPS: fixed a race condition in the ublox driver
the status update comes as a separate message from the lat/lon
2012-06-04 14:47:58 +10:00
Jason Short
73e23aab2a GPS time set to unsigned int32 2012-06-03 11:13:50 -07:00
rmackay9
dcdeae412e ArduCopter: Another attempt at fixing the lat/lon printing bug in which small negative lattitudes or longitudes were appearing as positives.
Fixed in both ArduCopter Log.pde and the GPS Auto test sketch
2012-06-03 16:58:19 +09:00
rmackay9
2a216ce900 ArduCopter: fixed print_latlon bug in which it would print negative lat/lon numbers incorrectly (i.e. -1234567890 would be printed as -124.xxx). 2012-06-02 12:51:12 +09:00
Andrew Tridgell
7f8fe97889 GPS: u-center config file for 3DR Ublox 2012-04-20 22:05:30 +10:00
Andrew Tridgell
f170790fd8 GPS: fixed auto GPS test 2012-04-20 22:05:30 +10:00
Andrew Tridgell
711814085b GPS: detect new style 3DR UBlox 2012-04-20 22:05:30 +10:00
Andrew Tridgell
08bc7f1a41 GPS: fixed the UBlox test code 2012-04-20 20:57:08 +10:00
analoguedevices
28833ed1d6 added missing #include 2012-04-09 14:32:54 +00:00
Andrew Tridgell
4dff78b9c0 GPS: expose last_fix_time 2012-03-10 10:34:32 +11:00
Andrew Tridgell
57f67ca6e3 GPS: added an acceleration estimate to the GPS driver
This uses the GPS ground speed to estimate acceleration
2012-03-10 10:34:30 +11:00
Andrew Tridgell
7fbfcc2721 GPS: fixed some stdint types 2012-03-10 10:34:29 +11:00
Andrew Tridgell
d90dc4d893 GPS: change back to 4Hz for MTK GPS
this will hopefully fix the NO_GPS problems that have been regularly
happening in recent months. I will watch the logs carefully to see if
the problem recurs
2012-02-13 22:50:20 +11:00
Andrew Tridgell
1f05e7dafb fixed types in GPS detect code
using int everywhere is wasteful and non-portable
2012-02-13 16:22:53 +11:00
Randy Mackay
ed19c25a97 Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
Modified FastSerial's write function to return size_t (number of bytes written).
2012-01-28 12:25:47 +09:00
Michael Oborne
306e2e3f7d add gps character count.
this problem happens when the mtk ends up in nmea mode at 10hz. there is no 50ms window of no activity
2011-12-31 13:05:33 +08:00
Michael Oborne
3d85f99546 remove gps callback in wait loop 2011-12-31 09:35:40 +08:00
Randy Mackay
c24b5229e1 AP_GPS - updated MTK rate to 10Hz and fixed lat/lon printing inaccuracy in Arducopter logs and AP_TEST example sketch 2011-12-25 12:33:06 +09:00
Andrew Tridgell
b4965d34a9 GPS: added FAKE_GPS_LOCK_TIME
this allows you to fake up a GPS lock after a specific number of
seconds
2011-12-04 09:06:57 +11:00
James Goppert
025fa7fb5d ArduPlane cmake build working. 2011-10-31 13:18:48 -04:00
James Goppert
14d27b1e4c Cleaned up AP_GPS formatting. 2011-10-28 14:52:50 -04:00
Andrew Tridgell
6048f3870f GPS: fixed type to be consistent with declaration 2011-10-09 22:08:59 +11:00
James Goppert
0c7c508541 Optional recursion added. 2011-09-30 17:17:51 -04:00
James Goppert
5489b84f8e Improvements to cmake. 2011-09-29 21:23:26 -04:00
James Goppert
d887a28b91 Added ArduBoat/ ArduRover/ and APO library. 2011-09-29 14:12:15 -04:00
Andrew Tridgell
3a9b7d6458 GPS: change example serial rate to 115200
this matches default for AP/AC
2011-09-17 14:58:02 +10:00
unknown
a4e001bbcf Adding CMake support 2011-09-14 15:44:55 +02:00
hazyhxj@gmail.com
b110803dcb Fix NMEA GPS error
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3227 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-09-04 05:14:42 +00:00
mich146@hotmail.com
5e3e96b236 update "NO_GPS" issue as per Justin Beech
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3225 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-09-04 04:46:14 +00:00
tridge60@gmail.com
91e101f47e GPS: added delay hook for GPS detection
this allows for MAVLink to be up during GPS detection

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2987 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-31 22:34:37 +00:00
tridge60@gmail.com
da2a1d72e2 GPS: fixed the GPS specific test programs
This fixes the build

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2962 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-30 08:48:17 +00:00
tridge60@gmail.com
60bf2182e4 GPS-HIL: set new_data on setHIL()
this fixes navigation for ACM in HIL

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2909 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-18 12:42:36 +00:00
deweibel@gmail.com
8d7e7ff58e revert gps lib to 2602
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2608 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-21 01:38:31 +00:00
deweibel@gmail.com
26d1ec1f56 remove static declaration from idleTimeout
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2607 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-21 01:26:57 +00:00
deweibel@gmail.com
5b9e7eff9d clean up idleTimeout
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2606 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-21 01:20:39 +00:00
deweibel@gmail.com
b53b749fc7 Fix initialization of idleTimeout
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2602 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-20 21:11:45 +00:00
jasonshort
76d072591b made timeout public, settable
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2563 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-16 16:33:08 +00:00
jasonshort
4a1772b5ff http://code.google.com/p/arducopter/issues/detail?id=161
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2395 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-24 05:17:12 +00:00
deweibel@gmail.com
20cdf7c698 Add hDOP for ublox gps driver
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2241 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-11 02:54:43 +00:00
james.goppert
7809b0ca2a Massive warning fixes.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2089 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-04 19:12:27 +00:00
james.goppert
aa598b575a APO merge.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1935 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-01 02:05:17 +00:00
james.goppert@gmail.com
c1b6032e7f Eclipse makefile support for examples.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1860 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-04-09 19:38:12 +00:00
tridge60@gmail.com
d36869494f GPS: fixed the idle timer
we need to reset the idle timer only on good data, or a call to
init(). Otherwise we never use it.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1849 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-04-04 22:00:06 +00:00
tridge60@gmail.com
860998d337 implemented typesafe PSTR()
This makes PSTR() type safe by using a 1 byte wrapper
structure. Attempts to use the wrong varient of a print function will
generate a compilation error.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1797 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-03-21 07:25:48 +00:00
jasonshort
00209c82a9 Added setHIL to GPS.cpp
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1686 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-19 18:33:42 +00:00
deweibel@gmail.com
bd9c7de109 Correct factoring issue for AP_GPS_IMU XPlane HIL interface.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1673 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-17 21:36:56 +00:00
deweibel@gmail.com
4f514faf97 Small bug fix for HIL gps when using auto-detect
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1663 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-16 18:19:07 +00:00
DrZiplok
3108d661d2 Correct knots -> m/sec conversion. Thanks to Paul M. for spotting this.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1613 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-08 07:06:47 +00:00
deweibel
e620eb1326 Change MediaTek timestamps to millisecond Time of Day
Add epoch method to return timestamp epoch.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1589 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-01 23:50:36 +00:00