Commit Graph

74 Commits

Author SHA1 Message Date
Michael du Breuil 53c66106d6 AP_GPS: Remove unneeded intilizers
saves 160 bytes on make px4-v2
2018-05-16 20:34:00 +10:00
chobitsfan 02cfe9128d AP_GPS: parse RTK status in NMEA GGA message 2017-09-15 22:33:47 +01:00
Michael du Breuil 2f8f2ffd2d AP_GPS: Remove NMEA init blobs for binary drivers
All of the init strings that were sent in the NMEA driver are for GPS protocols
which have binary drivers, which provide far more features and are more robust.
It also appears that due to driver changes the config strings for SIRF/UBLOX
were no longer correct anyways).
2017-09-15 14:30:48 -07:00
Lucas De Marchi 8389158d76 AP_GPS: use FALLTHROUGH define
When falling through on a case switch, allow to add an empty statement
with the correct attribute to tell the compiler this behavior is
intended.
2017-08-22 23:59:13 -07:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 2239fd6a6e AP_GPS: fixed hexdigit in NMEA detector
thanks to adorus for spotting this! See issue#4255
2016-06-06 07:36:31 +10:00
Lucas De Marchi 035937ea7e AP_GPS: add some safety checks to _parse_decimal_100() 2016-05-20 10:06:45 -03:00
Lucas De Marchi fc6dd97e61 AP_GPS: make _parse_decimal_100() a static function
This allows to easily write tests for it as opposed to having to
construct the entire object.
2016-05-20 10:06:44 -03:00
Bert Regelink 7379d120e1 AP_GPS: fix _parse_decimal_100() with negative numbers
_parse_decimal_100() did not parse the fractional part for negative
numbers. Furthermore, use the third decimal (when present) for proper
rounding.
2016-05-20 10:06:44 -03:00
Andrew Tridgell b424c49bc7 AP_GPS: change ground course to be in degrees
more accuracy for replay
2016-05-07 18:27:21 +10:00
Andrew Tridgell 2a214f1e46 AP_GPS: support a wider variety of NMEA receivers
some reeivers use a different talker ID. This allows us to accept
them.
2016-04-18 15:30:17 +10:00
Andrew Tridgell a7079b730a AP_GPS: GPVTG can give new velocity 2016-02-11 18:46:01 +11:00
Andrew Tridgell 4beb1748c5 AP_GPS: better handle corrupted NMEA sentences
when a NMEA sentence is corrupted we should discard it
completely. This change prevents us considering a set of sentences
that includes corrupted sentences from being seen as new data
2016-02-11 18:46:01 +11:00
Caio Marcelo de Oliveira Filho c33b86a783 AP_GPS: use millis/micros/panic functions 2015-11-20 12:30:48 +09:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi aa370fe758 Replace use of strcmp_P() with strcmp() 2015-10-30 14:35:09 +09:00
Andrew Tridgell 2c7a113790 AP_GPS: ensure all GPS drivers give headings as 0..360 degrees
this prevents inconsistency between interfaces, and fixes a MAVLink
reporting bug with UAVCAN GPS
2015-08-31 08:24:35 +10:00
Gustavo Jose de Sousa 67db430583 AP_GPS: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Randy Mackay 8aa7a3cffc GPS: suppress compile warning 2015-07-29 16:53:18 +09:00
Randy Mackay be6089e903 GPS: fix compile warning for NMEA logging 2015-07-29 16:53:16 +09:00
Andrew Tridgell 25fe2b3fb0 AP_GPS: added optional NMEA debug log
compile time option for debugging
2015-07-29 11:07:01 +10:00
Andrew Tridgell 3b1b7ea029 AP_GPS: fixed time handling with NMEA driver 2015-07-20 09:15:32 +10:00
Julien BERAUD a852e48f37 AP_GPS_NMEA: fix gps startup
when no valid gps data, gps would restart in a loop. Take the frame without
gps fix into account for frame counting
2015-07-20 09:14:15 +10:00
kozinalexey 20a04bad77 AP_GPS: request RMC message in NMEA driver 2015-07-06 11:16:12 +10:00
Andrew Tridgell 21c895f6f3 AP_GPS: prevent extra NMEA messages causing rapid fix rates
unexpected messages could cause the GPS driver to report a very high
fix rate, which can confuse the EKF
2015-07-03 22:08:05 +10:00
Andrew Tridgell 809ff15b43 AP_GPS: make NMEA driver a bit easier to read
thanks to crashpilot100
2014-11-16 14:12:14 +11:00
Andrew Tridgell b81b9e1bb8 AP_GPS: prevent bad NMEA strings from causing overruns in parser
fixes issue #961

thanks to crashpilot100 for spotting this!
2014-11-16 14:08:20 +11:00
Andrew Tridgell 59de5a8465 AP_GPS: avoid some float conversion warnings 2014-07-08 20:27:03 +10:00
Andrew Tridgell 0191355488 AP_GPS: fixed init strings to all be in progmem
and sent async ...
2014-04-01 06:38:25 +11:00
Andrew Tridgell 368daf89f1 AP_GPS: new GPS API
This is a complete rewrite of the GPS driver structure, with a static
main driver and separate backend drivers. This will allow proper
support for multiple GPSes, and will allow parameters to be set on the
GPS object
2014-04-01 06:38:23 +11:00
Andrew Tridgell 2dd92832dc AP_GPS: support multiple AP_GPS_Auto drivers
move all static variables into a dynamically allocated structure in
the AUTO driver which gets freed when we have found a GPS type
2014-04-01 06:38:23 +11:00
Andrew Tridgell 7ff293ca38 AP_GPS: added DataFlash to GPS init to allow for detailed logging
this will allow GPS drivers to log much more detailed device specific
information
2014-03-24 12:01:13 +11:00
JakobSt 986417067e AP_GPS: Improved accuracy of NMEA driver
The conversion of ret (32bit-integer) to float reduced accuracy to ~9cm or ~22cm. Now it's ~1cm.
2014-01-13 09:58:30 +11:00
Andrew Tridgell de96ad9445 AP_GPS: fixed date handling in NMEA driver 2013-10-24 14:22:48 +11:00
Andrew Tridgell 6f5ac1d553 AP_GPS: added support for GPS time in week/millisec
also adds time_epoch_usec() for MAVLink SYSTEM_TIME
2013-10-24 14:22:47 +11:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell b43bf44552 AP_GPS: improved the precision of the NMEA driver
this brings the NMEA driver to the same lat/lon precision as the uBlox
driver (approx 1cm)
2013-08-14 14:36:44 +10:00
Andrew Tridgell 7dbb898264 AP_GPS: switch fields to add units suffix
altitude -> altitude_cm
ground_speed -> ground_speed_cm
ground_course -> ground_course_cd

this helps prevent unit mixups
2013-07-10 14:04:22 +10:00
Andrew Tridgell edfebc1f29 AP_GPS: fixed indent-tabs-mode 2013-05-30 09:52:21 +10:00
Andrew Tridgell b3ec5187f2 AP_GPS: fixed uninitialied variable bugs found with valgrind 2013-04-17 23:02:13 +10:00
Randy Mackay d7454bb09e GPS: add 2D fix type 2013-03-27 11:41:39 +09:00
Andrew Tridgell 18db7b2efd GPS: move _port setting to init()
this is needed to avoid constructor ordering dependencies
2012-12-20 14:52:32 +11:00
Andrew Tridgell 18fb9c67f6 AP_GPS: use AP_Progmem 2012-12-20 14:51:39 +11:00
Pat Hickey 9ed023aeb4 AP_GPS: Builds under AP_HAL. Not tested. 2012-12-20 14:51:25 +11:00
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 da81115079 uncrustify libraries/AP_GPS/AP_GPS_NMEA.cpp 2012-08-21 19:19:51 -07:00