Commit Graph

127 Commits

Author SHA1 Message Date
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 cd379b0e86 AP_GPS: move time_epoch calcs into proper file
The frontend implementation was in the backend file
No functional change
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
Michael du Breuil 7b483a1460 AP_GPS: Ublox, always quickly set the rates until we have fetched the version 2017-02-23 07:33:58 +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
Andrew Tridgell c0cc2faefd AP_GPS: disable esoteric GPS types on FMUv2 2017-01-29 16:31:06 +11:00
priseborough 6d53ab7b76 AP_GPS: minor comment change 2017-01-27 16:57:42 +09:00
priseborough 4a490d522e AP_GPS: use standard unit descriptor for milliseconds 2017-01-27 16:57:42 +09: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 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 0cf41c9288 AP_GPS: Force ublox baud rate if we are allowed to config the GPS 2017-01-26 07:48:22 +09: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 b7f32e216d AP_GPS: update parameter descriptions 2017-01-09 13:32:28 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 9aaeb6fe1a AP_GPS: Add missing GPS Types 2017-01-06 21:24:42 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 8419045aea Spell in comments 2017-01-06 10:57:39 -08:00
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
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
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
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
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 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
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
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
Allan Matthew 4249f7dbe6 AP_GPS: Add GPS_MAV type and accept GPS_INPUT message 2016-07-12 15:34:27 +09: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 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
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
Alexey Bulatov 3933ac2a63 AP_GPS: Added ERB to AP_GPS 2016-03-02 06:04:52 -08: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