Commit Graph

151 Commits

Author SHA1 Message Date
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
Michael Oborne 0fceb76493 AP_GPS_GSOF: add trimble gsof driver 2015-10-06 15:00:46 +11:00
Michael du Breuil 9f02834f6d AP_GPS: Broadcast vDOP data over mavlink 2015-09-09 11:38:12 +10:00
Michael du Breuil 0e3a188f6f AP_GPS: Read the vdop information from a ublox GPS 2015-09-09 11:38:12 +10:00
Michael Oborne cce46cf0c5 AP_GPS_SBF: add support for Septentrio gps 2015-09-03 19:43:31 +10:00
Lucas De Marchi 55beb6bc0f AP_GPS: standardize inclusion of libaries headers
Do the missing header changes due to changing the code before the pr
getting accepted.
2015-08-18 17:12:51 +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
Michael du Breuil 22b16b4532 AP_GPS: Enable selecting what GNSS system to use if the reciever supports it
Ublox 7 and 8 seires use a UBX-CFG-GNSS message to enable satellite constellations. The default value does not enable any additional ones, and any constellations the reciever doesn't report knowing about are not configured.
2015-07-22 21:31:10 +10:00
Michael du Breuil 47592a1953 AP_GPS: Raise the baud rate on a ublox GPS if using RAW logging
the implementation leaves an easy path forward for providing a different startup blob for all the GPS's if raw logging is enabled
2015-07-22 21:31:09 +10:00
Michael du Breuil 19bb96b9cb AP_GPS: Improve startup logic for detecting what gps is connected
Remove race condition on sending intial blob to the GPS, it was possible to send a blob that got the GPS configured enough to allow the autodetect to take over (and then some drivers like ublox would not finish sending the blob, which has potential details that the driver might have needed to send)

Limit the delay to checking for NMEA gps to only checking after all the available baud rates have been checked

Since a UBlox will actually report having DGPS (due to SBAS or RTCM data) actually report this as the highest supported mode
2015-07-22 21:31:09 +10:00
Randy Mackay ef20676c67 GPS: fix INJECT_TO param desc and add definition
No functional change
2015-06-27 16:31:03 +09:00
Tom Pittenger 3544549cf4 AP_GPS: Allow switching primary GPS instance with 1 sat difference
Rapid switching between GPS receivers can cause real problems.
Switch if:
1) secondary GPS has 1 more satellite for at least 20 seconds
OR
2) secondary GPS has 2 more satellites for at least 5 seconds

Fixes https://github.com/diydrones/ardupilot/pull/2320
2015-06-11 21:33:06 +10:00
Andrew Tridgell b0932548d8 AP_GPS: enable NMEA GPS on AntennaTracker
we have enough flash space for it
2015-05-21 07:30:21 +10:00
Micheal Knight ee85d37ee2 AP_GPS: added logging of RXM_RAW messages for UBlox
this will allow for post-flight RTK processing of DF logs
2015-05-05 13:25:34 +10:00
Niels Joubert a5beef00d1 GPS: Official Swift Binary Protocol GPS Driver v3 for Piksi GPS
DRIVER FEATURES:
- All logic for RTK vs Normal now lives inside Piksi
- Supports observation uplink through telem radio
- Supports full SBP packet logging
- Reports high-rate green blinking to indicate RTK lock.
- Switchable to accept only Float or Integer RTK locks.

THIS REQUIRES PIKSI FIRMWARE v0.14 OR HIGHER
- Uses Piksi's new Pseudo-Absolute-Positioning mode
- Onboard Piksi must have Pseudo-Absolute mode enabled
- Ground Station Piksi must have a surveyed location in settings
- Ground Station Piksi must send its location to Onboard Piksi.

NEXT STEPS REQUIRED:
- EKF needs to take higher accuracy GPS into account
- EKF needs to take GPS RTK height into account
- GCS needs to support sending SBP observation packets
--- MAVProxy patch forthcoming
2015-04-24 08:01:32 +10:00
Andrew Tridgell e0870d5038 AP_GPS: disable NMEA and SiRF on AVR 2560
we are too low on flash space for plane on APM2 now
2015-03-13 10:30:00 +11:00
Andrew Tridgell a8c1d3a134 AP_GPS: fixed SerialManager for test sketches 2015-02-09 11:47:31 +11:00
Randy Mackay 2eddecb10d GPS: use SerialManager for init 2015-01-29 14:05:12 +11:00
Holger Steinhaus abad58874c AP_GPS: enable GNSS modules handled by PX4 firmware via GPS_TYPE
GNSS modules handled by PX4 drivers are not auto-detectable, some are not even
connected to a UART port. The activation is therefore controlled by GPS_TYPE
only. Baud rate and port settings (if applicable) have to be handled by the PX4
firmware.
2014-11-14 14:36:10 +11:00
Jonathan Challinger 2293070a5b AP_GPS: Add uBlox accuracy metrics interface and logging 2014-11-06 07:38:41 +11:00
Andrew Tridgell 15470bd81b AP_GPS: added GPS_MIN_ELEV parameter
allows setting of satellite elevation mask in degrees
2014-09-04 14:46:10 +10:00
Andrew Tridgell 840a4dee1e AP_GPS: added GPS_SBAS_MODE parameter
allows SBAS to be enabled/disabled
2014-09-04 14:46:10 +10:00
Andrew Tridgell b296508da4 AP_GPS: make setHIL take const references 2014-08-09 22:50:15 +10:00
Randy Mackay f630f9abc3 GPS: exclude SIRF and NMEA on APM copter build
This only works for the centralised builder, the modified Arduino IDE
will still include the NMEA and SIRF drivers meaning it will require
approximately 4k additional flash which may push us over the limit on
the APM2.  Users will instead need to exclude other features to get
below the APM1/2 flash limit.
2014-07-13 15:41:11 +09:00
Niels Joubert b57d1f5245 GPS: Include 75-class CPUs in RTK support since they will have 64 bit floating point values. 2014-07-03 09:57:07 +10:00
Niels Joubert fa78634959 AP_GPS: GPS calculates MAVLink messages for GPS and GPS_RTK 2014-06-30 10:30:16 +10:00
Niels Joubert 2b1169b0ab AP_GPS: SwiftNav RTK Driver and GPS AutoSwitch param 2014-06-30 10:29:56 +10:00
Andrew Tridgell a821b0e198 AP_GPS: fixed a build warning
Debug() should not be exposed in public headers
2014-04-10 10:28:55 +10:00
Andrew Tridgell 43ebd86bb1 AP_GPS: disable SBP driver on APM2
the driver uses double precision floating point, which can't work on
8bit AVR with gcc
2014-04-05 21:47:46 +11:00
Niels Joubert 33576dfdd9 AP_GPS: Swift Binary Protocol SINGLE-POINT-POSITIONING Driver
This is the SBP driver for Piksi, Lodestar and other forthcoming Swift Navigation GPSes.
This driver currently implements three things:
- Implements a lightweight SBP protocol detection system
- Implements Piksi as a single-point-positioning GPS (same as ublox/others)
- Implements hardware logging of GPS health and baseline messages

Forthcoming iin future updates:
- Need to implement the RTK functionality
2014-04-05 13:42:23 +11:00
Niels Joubert 552f33b39e AP_GPS: Support fix types of DGPS and RTK 2014-04-05 13:42:23 +11:00
Andrew Tridgell 67ed5b73ef AP_GPS: added lock_port() interface
used by SERIAL_CONTROL message
2014-04-05 07:34:33 +11:00
Andrew Tridgell d9d038345a AP_GPS: save 800 bytes of code space on APM2
we can assume a single GPS
2014-04-04 10:08:28 +11:00
Andrew Tridgell 9f857529ca AP_GPS: auto-switch primary GPS based on status and number of satellites 2014-04-04 08:32:34 +11:00
Andrew Tridgell e40a048009 AP_GPS: handle multiple GPS in GPS setHIL() 2014-04-02 07:55:28 +11:00
Andrew Tridgell 7e2ef0cfc0 AP_GPS: fixed GPS for Replay 2014-04-01 17:25:15 +11: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 edfebc1f29 AP_GPS: fixed indent-tabs-mode 2013-05-30 09:52:21 +10:00
Andrew Tridgell 93ef403529 AP_GPS: removed unused AP_GPS_Shim.h 2013-02-20 11:33:39 +11:00
Craig@3DR f778961acf Added support for Mediatek firmware Rev 1.9 2013-01-02 09:16:47 +11:00
Andrew Tridgell 2679eabdef Cleanup: removed unused AP_GPS_IMU 2012-12-20 14:52:37 +11:00
uncrustify 65f55328e2 uncrustify libraries/AP_GPS/AP_GPS.h 2012-08-21 19:02:53 -07:00
deweibel@gmail.com 5e0fff1618 Add back AP_GPS_IMU to provide Xplane functionality
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1504 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 01:50:34 +00:00
DrZiplok c1f19797d9 Add a GPS shim class that lets an external agent update the pseudo-GPS properties.
This should obsolete AP_GPS_HIL as it's a little more versatile (and it will generate cheaper code).


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1336 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-28 23:27:12 +00:00
DrZiplok@gmail.com 8da4a29d58 Add support for the DIYD MTK v1.6 firmware
Nuke AP_GPS_IMU, as nothing is using it anymore.
Simplify the handling of no GPS/no fix detection.
Fix prototypes for ::init and ::read.
Update AP_GPS_Auto and corresponding example, nearly ready for primetime.
Use uint8_t rather than byte.
Strip some _error() calls to save space.  More could still go.



git-svn-id: https://arducopter.googlecode.com/svn/trunk@1246 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-24 06:35:09 +00:00
james.goppert e245b7c7b3 Added sensor level HIL support.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@857 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-19 05:42:47 +00:00
DrZiplok@gmail.com 0a94520682 Add support for automatically detecting the connected GPS and configuring accordingly.
Note that this is currently disabled as changes need to be made to APM to support it.

Tested with MTK, u-blox and SiRF GPS'.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@671 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-10-17 06:06:04 +00:00
deweibel 34aa823003 Bug fixes for EM-406
git-svn-id: https://arducopter.googlecode.com/svn/trunk@539 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-23 00:20:11 +00:00
DrZiplok@gmail.com 29ba4b8be1 Forgot to include the IMU GPS emulator, breaking X-Plane
git-svn-id: https://arducopter.googlecode.com/svn/trunk@483 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-12 00:51:44 +00:00
DrZiplok@gmail.com f665e944f0 Add a single header for the library that brings in declarations for all of the GPS types supported by the library.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@439 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-08 05:06:56 +00:00
jasonshort 8987b4d12e git-svn-id: https://arducopter.googlecode.com/svn/trunk@356 f9c3cf11-9bcb-44bc-f272-b75c42450872 2010-08-30 04:30:41 +00:00