Commit Graph

602 Commits

Author SHA1 Message Date
murata fd153f2861 AP_GPS: Change search method of GPS type to switch statement.
AP_GPS: Correct the tab code to white space.
2016-12-21 10:31:43 +09:00
priseborough 453ced4a38 AP_GPS: remove unused EKF1 include 2016-12-19 08:07:11 +11:00
Randy Mackay b296bc1d00 GPS: MAV driver fix for sanity checks of cog, sat count 2016-12-08 15:52:26 +09:00
Randy Mackay 8118222946 GPS: MAV driver fix for GPS_INPUT altitude 2016-12-08 15:52:26 +09:00
Randy Mackay 9e62f12dd7 GPS: MAV driver gets support for HIL_GPS message 2016-12-08 15:52:26 +09:00
Michael du Breuil d97861d685 AP_GPS: Ublox: Skip SBAS request if we don't want to alter it 2016-11-21 14:15:19 +09:00
Michael Oborne c62050dc1b AP_GPS_SBF: fix accuracy reported by driver 2016-11-12 16:42:35 +09:00
Holger Steinhaus 5b66062f85 AP_GPS_PX4: unsubscribe on driver destruction. 2016-11-07 08:00:57 -03: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
Michael Oborne c5f8d8a695 AP_GPS_SBF: change reported altitude from geoid to MSL 2016-11-01 13:06:59 +09:00
Randy Mackay aeb1de08f5 AP_GPS: fix MAV compile error 2016-10-29 16:45:00 +09:00
Randy Mackay 9290ee65cc AP_GPS: MAV driver uses existing baud rates
GPS_INPUT messages can arrive through any mavlink serial port so we shouldn't be modifying any port's baud rates.
2016-10-29 14:33:44 +09:00
Peter Barker 7b75a4ec09 AP_GPS: add missing parameter metadata 2016-10-27 09:15:03 -07:00
Andrew Tridgell af332cb336 AP_GPS: use const reference 2016-10-27 15:05:58 +11:00
priseborough 1dec6dd9b0 AP_GPS: Update parameter documentation
Add brief description of body frame conventions.
2016-10-27 14:54:45 +11:00
priseborough b51c9dea6c AP_GPS: Add parameters defining antenna offset in body frame 2016-10-27 14:54:41 +11:00
murata 762a66c9e5 AP_GPS_SBF: Adjust the initial value of HDOP 2016-10-26 09:54:59 +11: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
Peter Barker 6e72c899d1 AP_GPS: AP_GPS_GSOF: remove unused variable 2016-10-24 08:57:56 -02:00
Peter Barker e17a71c6cc AP_GPS: AP_GPS_NOVA: remove unused variables 2016-10-24 08:57:55 -02:00
Randy Mackay e6e6e36da7 AP_GPS_MAV: fix hdop conversion 2016-10-18 20:24:55 +09:00
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
Andrew Tridgell 9caf44b494 AP_GPS: update drivers for changed inject_data() API
need 16 bit length
2016-10-11 11:00:35 +11:00
Andrew Tridgell 500df1edf2 AP_GPS: support GPS_RTCM_DATA fragmented MAVLink message
support re-assembly of RTCM data packets
2016-10-11 11:00:35 +11:00
Michael du Breuil cf5e79f80e AP_GPS: ublox support user controlled rate updates
Also corrects accepting bad nav rates as configured, and fixes a incorrect
index as to which GPS is being updated
2016-10-11 10:44:51 +11:00
Michael du Breuil 86c2b1d84a AP_GPS: u-blox Remove 5Hz warning
The warnings test case is better covered by the rest of the driver
while it is performing the normal settings audit.
2016-10-11 10:44:51 +11:00
Michael du Breuil 3e3f539a6a AP_GPS: Raise target baud of u-blox devices
A knockon effect is that we need less config strings as raw logging
on u-blox will use the same baud rates
2016-10-11 10:44:50 +11:00
Andy Little 0d113b265c Examples: fix examples for px4
The change to use AP_BoardConfig messed up the examples. Here are some
updated but there are plenty more to do.
2016-10-04 12:50:47 -03:00
Michael du Breuil 9c4b3ec1e1 AP_GPS: Fix incorrect incrementing of last_baud rate
This is a revert of 7c3b8dceb which tried to start at index 0 of the
array of baudrates, however because of the way last_baud is used
this lead to a GPS always being reported as being 1 index off which
lead to users getting reports of baud rates that their GPS wasn't
configured for

Also renames last_baud to be current_baud as that is how it's
actuallly used and should reduce future confusion

And fixed some tabs/vs space issues around where the last_baud rate
was incremented.
2016-09-25 08:50:47 -07:00
Michael Oborne 11c376588d AP_GPS_NOVA: support tersus/novatel/comnav gps 2016-09-20 10:53:49 +10:00
Matthew Brener 06388b0417 Global: Fix typos 2016-09-17 00:36:36 -03:00
Randy Mackay 38b3d3ff3a AP_GPS_MAV: initialise location while handling_msg
This reduces a covarity warning but it likely not really an issue because we always initialise newly allocated memory to zero anyway
2016-09-01 12:01:14 +09:00
Lee Hicks 51e8d8a294 AP_GPS: Don't send config blob to GPS unless AUTO_CONFIG=1
All GPS types will recieve startup up blob config. For
some recievers this will cause them to hang. This commit
only allows sending of blobs if AUTO_CONFIG=1. Fixes #2622
2016-08-16 10:56:37 +10:00
Lee Hicks 7c3b8dceb9 AP_GPS: Fixed GPS serial speeds starting at 1 instead of 0
The counting of this will increment the counter before
selecting the baud speed, skipping the first baud rate.
2016-08-16 10:56:36 +10:00
Lee Hicks 3dd4f30460 AP_GPS: Adding 19200 as serial speed for GPS
APM supports baud speeds of 19200, but GPS baud rates
don't support it. This commit adds it to follow APM supported
baud rates.
2016-08-16 10:56:36 +10:00
Holger Steinhaus cc4fafc3e4 AP_GPS_PX4: fixed GPS epoch calculations 2016-08-02 11:20:48 +10:00
Randy Mackay 6e224158f1 AP_GPS_MAV: use GPS_INPUT_IGNORE_FLAGS 2016-07-12 15:44:46 +09:00
Randy Mackay e34aa0bc72 AP_GPS_MAV: minor formatting fixes
No functional change
2016-07-12 15:44:19 +09:00
Allan Matthew 4249f7dbe6 AP_GPS: Add GPS_MAV type and accept GPS_INPUT message 2016-07-12 15:34:27 +09:00
Gustavo Jose de Sousa 174cefa8a5 AP_GPS: use ARRAY_SUBSCRIPT instead of bytes field
That fixed compilation issues and seems more semantically correct. Using array
of length 0 fails compilation because of -Werror=array-bounds in GCC 6.1.
2016-06-23 21:02:05 -03: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
Andrew Tridgell af116d238f AP_GPS: use zero length flexible arrays
this works with gcc-6.1 and also works with asan. Hopefully it will
make coverity happy too.
2016-05-25 19:55:49 +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 994b2fc966 AP_GPS: add unit test for _parse_decimal_100() 2016-05-20 10:06:44 -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
Lucas De Marchi 39bd196481 AP_GPS: do not use flexible array in union
We actually don't want a flexible array in this union, but rather a way
to access it byte by byte. This fixes the build for gcc >= 6

In file included from ../../libraries/AP_GPS/AP_GPS.cpp:24:0:
../../libraries/AP_GPS/AP_GPS_ERB.h:93:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_ERB.cpp:22:0:
../../libraries/AP_GPS/AP_GPS_ERB.h:93:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_MTK.cpp:25:0:
../../libraries/AP_GPS/AP_GPS_MTK.h:75:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_MTK19.cpp:26:0:
../../libraries/AP_GPS/AP_GPS_MTK.h:75:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_SIRF.cpp:22:0:
../../libraries/AP_GPS/AP_GPS_SIRF.h:101:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_UBLOX.cpp:23:0:
../../libraries/AP_GPS/AP_GPS_UBLOX.h:387:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.
2016-05-16 13:50:39 -03:00
Ricardo de Almeida Gonzaga 4047fb63fc AP_GPS: Fix typos 2016-05-13 19:20:06 -03:00
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
Andrew Tridgell 5ddb872b79 AP_GPS: allow Replay to set last sample time 2016-05-07 18:27:23 +10:00
Andrew Tridgell 428923b4b1 AP_GPS: use 3D velocity for uBlox
this makes uBlox use the 3D velocity for ground course and speed,
ensuring we use a consistent value everywhere (so same vector in EKF
as in navigation)
2016-05-07 18:27:23 +10:00
Andrew Tridgell d24bbcd1ff AP_GPS: convert vdop to cm 2016-05-07 18:27:22 +10: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 4e5f1374da AP_GPS: added setHil_Accuracy() 2016-05-07 18:27:19 +10:00
Andrew Tridgell c85607b80c AP_GPS: added time_epoch_convert() function
used by replay to get identical timestamps
2016-05-07 18:27:18 +10:00
Andrew Tridgell 69e233a39d AP_GPS: fixed init string for SBF GPS
coverity #125042
2016-04-26 16:51:29 +10:00
Randy Mackay 3c7b2232b0 AP_GPS_GSOF: remove unused last_hdop
resolves a compiler warning
2016-04-23 23:06:22 -07: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
Lucas De Marchi ff10d1136c AP_GPS: reorganize includes
Due to the way the headers are organized a single change in a
AP_GPS backend would trigger a rebuild for most of the files in the
project. Time could be saved by using ccache (since most of the things
didn't change) but we can do better, i.e.  re-organize
the headers so we don't have to re-build everything.

This makes internal headers internal and then other libraries only
depend on the AP_GPS.h header.
2016-04-14 21:01:51 -03:00
Lucas De Marchi affa759fb4 AP_GPS: add missing override 2016-04-13 11:27:19 -03:00
Michael du Breuil 2538c17ee0 AP_GPS: add fetching of gps configuration failure reasons 2016-04-13 11:24:01 -03:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Michael Oborne 92106a944f AP_GPS_UBLOX: add data injection support 2016-03-18 15:51:32 +11:00
Lucas De Marchi cd266fbf4f AP_GPS: replace header guard with pragma once 2016-03-16 18:40:40 +11:00
Alexey Bulatov 3933ac2a63 AP_GPS: Added ERB to AP_GPS 2016-03-02 06:04:52 -08:00
Alexey Bulatov 7e2c822499 AP_GPS: Structure for detect ERB 2016-03-02 06:04:46 -08:00
Alexey Bulatov 97190c89d1 AP_GPS: ERB GPS driver
ERB - Emlid Reach Binary protocol.
That driver designed for communication between Reach
and ArduPilot.
Provided opportunities:
- Detection of the driver
- Parsing of input messages: status of transmitter
and navigation information.
- Inject GPS messages from base
2016-03-02 06:04:39 -08:00
Andrew Tridgell 04bac8a446 AP_GPS: removed duplicate dataflash write of ublox version 2016-02-24 14:26:57 +11:00
Andrew Tridgell 14bd4ba2c7 AP_GPS: removed console print for GPS type
it is now sent as a STATUSTEXT
2016-02-24 14:22:48 +11:00
Michael du Breuil 1426ff2732 AP_GPS: Broadcast what type of GPS is found and at what baud rate 2016-02-24 14:22:48 +11:00
Tom Pittenger 12fab6c59a AP_GPS: save cfg only when needed
added GPS_SAVE_CFG param option 2
2016-02-12 15:33:33 -08:00
Tom Pittenger 18163bd01f AP_GPS_UBLOX: save cfg only when needed
added GPS_SAVE_CFG param option 2
2016-02-12 15:33:18 -08:00
Michael du Breuil 55e64b3622 AP_GPS: u-blox: copy paste typo in a #else 2016-02-12 15:33:08 -08:00
Michael du Breuil 217a06322b AP_GPS: u-blox: don't throw 5hz update warnings if no fix
5hz update warnings are only valid if you have a fix, without a fix it adds load
to the GPS without any benefit. Our _5hz time messages are depenend upon GPS fix
time which isn't available yet
2016-02-12 15:32:41 -08:00
Michael du Breuil 726bf110cc AP_GPS: update save_cfg description
Saving config is not expected to work on a LEA-6H based on user reports, so the parameter should warn of this
2016-02-12 00:37:05 -08:00
Michael du Breuil 4251ee0e4b AP_GPS: u-blox verify ublox settings
The ublox driver will now continuosly poll for the settings from the GPS and correct any that are found to be in correct.
This status is then reported to the arming library as an additional arming check, allowing the user to be sure that the
gps is correctly configured before using it. If a user has a GPS2 configured that is not present they will fail the arming
checks until after they have disabled the second GPS.

2 new parameters were introduced as well:
  -GPS_AUTO_CONFIG: Will not request any configuration packets to attempt to change them. (If the packet is recieved then
    a update will be sent to it, but in testing this scenario never occured. This is set to 1 or 0 to change the setting.
    (Defaults to 1 enabling auto config)
  -GPS_GNSS_MODE2: Behaves the same way as GPS_GNSS_MODE but only applies to the second GPS.

GPS drivers are now allowed 2 seconds of non responsiveness before being unloaded
2016-02-12 00:37:04 -08: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
Peter Barker ede7ffedfc AP_GPS: correct #if from UBLOX_DEBUG to UBLOX_DEBUGGING 2016-01-30 12:48:39 -02:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Michael du Breuil 8c9eafeb3c AP_GPS: Fix param docs that had incorrect spaces
The spaces between values aren't stirpped by the autodoc tool that generates the XML files
2016-01-08 20:17:54 +11:00
Michael Oborne a42b286c01 AP_GPS_SBF: update logging based on vendor recommendation. 2016-01-08 10:47:05 +11:00
mirkix dee20a31f1 AP_Notify: Add gps_num_sats 2016-01-07 14:32:56 -02:00
Jonathan Challinger 04dc7130f5 AP_GPS: fix example build 2015-12-29 10:46:35 -08:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Lucas De Marchi 5bb4e3eda9 AP_GPS: stop using Progmem.h
Besides the trivial convertions, while reading
initblob_state[instance].blob we need to be sure to read only one byte
like we were before.
2015-12-27 15:58:12 -02:00
Andrew Tridgell bc8ee8af36 AP_GPS: added QURT GPS 2015-12-27 16:21:26 +11:00
Aaron Wang Shi 800c142ac0 BH: Support UBLOX GPS M8N 2015-12-21 15:54:30 +11:00
Michael Oborne 1c1eea6119 AP_GPS_SBF: add sd logging by default, improve init 2015-12-07 21:56:44 +09:00
Michael Oborne 0bcc6e324a AP_GPS_SBF: formatting fixes 2015-12-07 21:56:42 +09:00
Lucas De Marchi 2b5417046b AP_GPS: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Peter Barker 0f9e7a905d AP_GPS: remove use of AddLogFormats 2015-12-03 13:21:52 +11:00
Michael du Breuil 2f97f9f416 AP_GPS: Fix incorrect values docstring on RAW_DATA 2015-12-03 10:17:22 +09:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Caio Marcelo de Oliveira Filho c33b86a783 AP_GPS: use millis/micros/panic functions 2015-11-20 12:30:48 +09:00
Randy Mackay 36c0beb918 GPS_UBlox: reorder init to resolve compiler warning
Also removed duplicate init of noReceivedHdop
2015-11-16 15:09:17 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00