Commit Graph

203 Commits

Author SHA1 Message Date
Andrew Tridgell 93aaf98672 AP_GPS: added automatic u-blox moving baseline configuration
this uses GPS_TYPE and GPS_TYPE2 to setup two u-blox F9 receivers in a
RTK moving baseline configuration
2020-01-07 12:37:35 +11:00
Michael du Breuil f8808022b8 AP_GPS: Check the driver logging health 2019-11-20 11:06:16 -07:00
Andrew Tridgell 632114d687 AP_GPS: support RTCMStream for RTCM injection on UAVCAN 2019-11-09 17:11:32 +11:00
Michael du Breuil d623da0de6 AP_GPS: Always send GPS2_RAW after we've seen the second GPS
This significantly improves the GCS's ability to correctly display whats
happening with the second GPS.
2019-11-02 10:35:08 +11:00
Andrew Tridgell 14cdac9202 AP_GPS: fixed GPS to UART mapping
this allows for first GPS as UAVCAN and 2nd as UART. That is not
possible currently unless you waste a uart
2019-10-24 14:37:30 +11:00
Michael du Breuil 2587b13ae7 AP_GPS: UBLOX: Parse RELPOSNED messages
This does not yet:
  - validate the receiver configuration
  - manage timing out stale GPS heading info
  - relPosNormalized usage isn't clear, which may defeat the STRICT_LENGTH_CHECK
2019-10-15 11:06:11 +11:00
Andrew Tridgell 291d72601b AP_GPS: enabled reduced size for AP_Periph support 2019-08-27 10:29:56 +10:00
Michael du Breuil d33006a2e7 AP_GPS: Refactor first_unconfigured_gps to return bool 2019-07-30 10:12:43 +10:00
Pierre Kancir 13ac187fd8 AP_GPS: pass mavlink_message_t by const reference 2019-07-16 20:51:42 +10:00
Grant Morphett 64ed76326b AP_GPS: Adding support for the NMEA GPHDT sentence
The NMEA GPHDT sentence can be used to determine the vehicles bearing
instead of a compass even when the vehicle is stationary.  This type
of GPS is normally very expensive and does the bearing using some sort
of phase ambituity algorithm.
2019-07-13 11:05:57 +10:00
Michael du Breuil e6d97f63a5 AP_GPS: Remove unneeded wrappers 2019-04-26 08:07:19 +10:00
Michael du Breuil 27ad9ac3ca AP_GPS: Refactor get_singleton() to return a pointer 2019-04-05 23:09:47 -07:00
Michael du Breuil 52eb832883 AP_GPS: Remove stuff from headers 2019-04-05 20:12:53 +11:00
Tom Pittenger 12c3446777 AP_GPS: rename dataflash to logger 2019-03-28 16:40:57 +11:00
Francisco Ferreira 5a64f8d8ba AP_GPS: use proper macro in array sizes 2019-03-07 19:48:32 -07:00
Tom Pittenger 5d66c3ed62 AP_GPS: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Peter Barker 30980815a8 AP_GPS: adjust for Location_Class and Location unification 2019-01-16 11:45:29 +11:00
Arjun Vinod 978cea97cf AP_GPS: whitespace and typo fixes 2019-01-05 08:45:24 +09:00
Andrew Tridgell 3fe4b9c0f8 AP_GPS: make GPS packet timestamps more accurate
this reduces the effect of processing time and uart transmit time
2018-12-04 11:37:38 +11:00
Andrew Tridgell 2512b73106 AP_GPS: added ability to disable GPS
this is used for GPS loss testing in real vehicles, by linking it to a
RCn_OPTION value. GPS position is still logged, but is not used
2018-11-29 08:49:23 +11:00
Michael du Breuil cca6b54921 AP_GPS: Remove unneeded field limitations
Saves ~1100 bytes of flash
2018-08-01 09:19:20 +10:00
Andrew Tridgell 796291f176 AP_GPS: improved ccache build speed
making this header equal improves speed of fmuv2 build after fmuv3
build with ccache, without affecting binary
2018-06-22 11:13:03 +10:00
Peter Barker 5b41db5120 AP_GPS: use AP_RTC
set the system time from a GPS if we have a 3D fix or better
2018-06-15 08:01:22 +10:00
Francisco Ferreira 5fc7da0e83 AP_GPS: remove Qualcomm board support 2018-05-17 09:57:20 +10:00
Peter Barker 643e7e039a AP_GPS: log received data
Also log a set of flag values if a driver is deleted
2018-04-18 13:50:55 +09:00
Andrew Tridgell d2c9e2719e AP_GPS: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Peter Barker 693823ae0d AP_GPS: add gps() to AP:: namespace 2017-11-15 13:43:03 +00:00
Michael du Breuil 236e74c529 AP_GPS: Singleton 2017-11-06 01:33:57 +00:00
Michael du Breuil c856cc6f33 AP_GPS: Allow GPS's to run functions on arming (used by SBF)
Supports starting/stopping GPS logging
2017-11-06 01:33:57 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas bf6778277e AP_GPS: implement GPS*_RTK mavlink messages 2017-10-30 18:28:20 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 430b863f42 AP_GPS: Replace hardcoded duplicated end_mavlink_gps*_rtk() function with a flexible one 2017-10-30 18:28:20 +00:00
Michael du Breuil b0e18de576 AP_GPS: Remove detect helpers for MTK/SIRF when minimizing the build
Removes 16 bytes
2017-10-22 03:03:29 +01:00
Michael du Breuil bfbec02736 AP_GPS: SBF track the GPS error bits 2017-09-27 19:29:32 +01:00
Lucas De Marchi 2cb2727a31 AP_GPS: add static create method 2017-09-26 03:01:21 +01:00
Michael du Breuil 04eb7f411e AP_GPS: Track the delta time between the last GPS positions 2017-09-13 13:36:40 +01:00
Peter Barker 7f59279670 AP_GPS: make time_epoch_usec const 2017-07-28 14:27:53 +01:00
Peter Barker 2ad453fc89 AP_GPS: handle inject packets as part of handle_msg 2017-07-27 12:03:25 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas ae47ac5a09 AP_GPS: implement missing "RTK number of satellites" and "RTK correction age" information in the GPS2_RAW MAVLink message 2017-07-19 20:42:23 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 059c213d19 AP_GPS: Improve comments and documentation (NFC) 2017-07-19 20:42:23 +09:00
Peter Barker 7258cfd20b AP_GPS: check dataflash to see if we should log backend gps messages 2017-06-29 15:43:38 +01:00
Rob Ratcliff 60c6f8ad60 AP_GPS: fix bug when injecting messages bigger than 255 bytes
Commit 5261654 changed the used injection method so change this method signature to use uint16 for message length like previous injection method did
2017-06-27 03:06:26 +01:00
Michael du Breuil 249849dfa4 AP_GPS: Add an enum for _auto_config 2017-06-21 11:44:45 +01:00
Michael du Breuil 5f8633e322 AP_GPS: Allow backends to report their lag confidences 2017-06-21 11:44:45 +01:00
priseborough 5dcfc94371 AP_GPS: Add validity boolean to GPS lag reporting 2017-06-21 11:44:45 +01:00
Michael du Breuil 6c3db3939e AP_GPS: Update comment on get_rate_ms()
AP_GPS::get_rate_ms() is only meant to help the GPS backends
2017-06-12 01:06:38 +01:00
Michael du Breuil 1877d09f7c AP_GPS: Don't track detection time to broadcast baud rate 2017-05-30 23:37:59 +01:00
Michael du Breuil c7a89d5aa0 AP_GPS: Set unknown DOP's to UINT16_MAX, rather then 9999
This fixes the MAVLink reporting for unknown dops, and avoids the situation where a GPS driver could report a worse DOP then we could handle.

Also corrects an apparent error in the HIL_GPS MAVLink message, where we would always select the unknown dop value rather then provided DOP.
2017-05-25 11:03:33 -07:00
Andrew Tridgell 3687b6bdf0 AP_GPS: rename macros to avoid conflicts
these macros were also defined in NuttX in clock.h
2017-05-06 15:21:14 +10:00
Dr.-Ing. Amilcar Do Carmo Lucas 1691a39b36 AP_GPS: spell in comments 2017-05-03 08:45:08 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 5b67b33310 AP_GPS: Remove un-used AP_GPS::inject_data_all() function 2017-05-01 13:06:18 +01:00
Peter Barker b7baca8d43 AP_GPS: move GPS type announcements into backend
See #4584
2017-04-23 21:04:17 +01:00
Peter Barker 2354a0ec5a AP_GPS: ability to log GPS detection state to dataflash 2017-04-23 21:03:23 +01:00
Niels Joubert 4bf9fc071c AP_GPS: Adds SBP Version 2: Swift Navigation Piksi Multi support
This commit adds:

- New driver for SBPv2
--- Support Piksi Multi, Swift Navigation's multi-band multi-constellation GPS
--- Proper parsing of SBP flags
--- Instant response to Piksi status changes (no more timeouts)
--- Support for Piksi Multi as a Single-Point-Positioning GPS or only onboard GPS
--- Incorporates horizontal and vertical accuracy estimates, and vdop.
- Updates driver for SBPv0
--- Continue support for previous Piksi

- Dispatches correct driver based on SBP version.
2017-04-18 18:25:54 +01:00
Eugene Shamaev dfe9b0e6fc AP_GPS: support for UAVCAN connected GNSS receivers 2017-04-10 22:38:12 +01:00
Randy Mackay 2002827de3 AP_GPS: rename pre-arm blending health check 2017-03-13 11:31:51 +11:00
Randy Mackay ef1399a52f AP_GPS: fixups after peer review
This includes these changes:
RATE_MS, RATE_MS2 parameter description Range minimum reduced to 50
_blend_health_counter is reset to 0 if blending is disabled
GPS_MAX_RECEIVERS is replaced with GPS_BLENDED_INSTANCE where appropriate
simplify all_consistent functions check of number of receivers
calc_blended_weights fix for initial check of how many receivers we have
remove unnecessary setting of GPS last time when blending fails
remove RebootRequired from AUTO_SWITCH param description
2017-03-13 11:31:51 +11:00
Randy Mackay 729ce34ce3 AP_GPS: add all_consistent and blend health for use as pre-arm check 2017-03-13 11:31:51 +11:00
Randy Mackay 72dfe1127f AP_GPS: protect parameters from being accessed externally
backends become friends so they can continue to access parameters held in frontend
get_rate_ms made private because only used by frontend
Also moved static arrays higher in cpp file
2017-03-13 11:31:51 +11:00
Randy Mackay 3172657f26 AP_GPS: move constructor and complex accessors to cpp file
These functions are slightly long and make the .h file hard to read.  Also saves a small amount of flash space.
No functional change
2017-03-13 11:31:51 +11:00
Randy Mackay 0066022a7f AP_GPS: check for valid instance in highest_supported_status
highest_supported_status will always return FIX_3D for blended or invalid instance
setHIL_Accuracy checks instance is 2 or less
send_mavlink_gps2_raw uses num_instances variable directly to avoid confusion with num_sensors
2017-03-13 11:31:51 +11:00
Randy Mackay e764f0d5d0 AP_GPS: sanity check update rate
Also minor spelling and parameter documentation fix
2017-03-13 11:31:51 +11:00
priseborough 6b26bdd454 AP_GPS: Add option to blend multiple GPS receivers
Fix pre-existing bug in hard switch logic
Update GPS_AUTO_SWITCH description
protect against zero accuracy estimates returned by GPS drivers
2017-03-13 11:31:51 +11:00
Randy Mackay a79474dcbc AP_GPS: minor comment fix
No functional change
2017-03-13 11:31:51 +11:00
Randy Mackay 201504dbae AP_GPS: remove unused get_antenna_offsets()
callers always specify an instance
2017-03-13 11:31:51 +11:00
Randy Mackay 2d0258b6a2 AP_GPS: remove unused highest_supported_status(void) 2017-03-13 11:31:51 +11:00
Lucas De Marchi 9f09442548 AP_GPS: rename UNIX_OFFSET
To keep consistency with other constants and make clear the unit.
2017-02-11 01:34:09 -08:00
murata 30151c8253 Global: Define MSEC_PER_SEC, MSEC_PER_WEEK, SEC_PER_WEEK and UNIX_OFFSET. 2017-02-11 01:34:09 -08:00
priseborough be0096e812 AP_GPS: Allow the user to specify the GPS time delay
If the user sets a non-zero value of the delay it will be used in preference over the default value for that GPS type.
If the GPS type is unknown and the parameter is set to zero, then a default delay of 1 sample period will be used (eg 200ms for 5Hz).
2017-01-27 16:57:42 +09:00
Andrew Tridgell bdc0630ccf AP_GPS: added all_configured() function
used for EKF to tell if gps_lag is valid
2017-01-27 16:57:42 +09:00
Andrew Tridgell 5d18f3a453 AP_GPS: added backend specific get_lag() function
the ublox7 and 8 seem to produce lower lag, around 120ms. Separately
we should also look at running these at 10Hz and see if that helps.
2017-01-27 16:57:42 +09:00
Michael du Breuil 1c1e6e9398 AP_GPS: Support more fix types 2017-01-25 03:44:42 +00:00
Michael du Breuil c696137a42 AP_GPS: Update the number of leapseconds 2017-01-18 18:07:26 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 8419045aea Spell in comments 2017-01-06 10:57:39 -08:00
Andrew Tridgell af332cb336 AP_GPS: use const reference 2016-10-27 15:05:58 +11:00
priseborough b51c9dea6c AP_GPS: Add parameters defining antenna offset in body frame 2016-10-27 14:54:41 +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
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 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
Allan Matthew 4249f7dbe6 AP_GPS: Add GPS_MAV type and accept GPS_INPUT message 2016-07-12 15:34:27 +09:00
Ricardo de Almeida Gonzaga 4047fb63fc AP_GPS: Fix typos 2016-05-13 19:20:06 -03:00
Andrew Tridgell 5ddb872b79 AP_GPS: allow Replay to set last sample time 2016-05-07 18:27:23 +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
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
Michael du Breuil 2538c17ee0 AP_GPS: add fetching of gps configuration failure reasons 2016-04-13 11:24:01 -03: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
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
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 bc8ee8af36 AP_GPS: added QURT GPS 2015-12-27 16:21:26 +11:00
Jonathan Challinger bc708f9808 AP_GPS: add SAVE_CFG parameter make ublox config saving optional 2015-11-10 15:16:55 +11:00
Lucas De Marchi e31595c60c AP_GPS: remove check for GPS_RTK_AVAILABLE 2015-11-04 12:14:15 +11:00
Lucas De Marchi c75c1d84d9 AP_GPS: remove check for GPS_MAX_INSTANCES
All supported boards may have more than 1 GPS instance.
2015-11-04 12:14:15 +11:00
Lucas De Marchi 4cef751aef AP_GPS: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11: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