Commit Graph

739 Commits

Author SHA1 Message Date
Dr.-Ing. Amilcar Do Carmo Lucas 9b2e48ce10 AP_GPS: Improve comments (NFC) 2017-12-05 10:44:58 +09:00
Peter Barker 47f8ed7fab AP_GPS: set GPS_SAVE_CFG default to save GPS config as required 2017-11-29 00:58:43 -07:00
Andrew Tridgell 9677d570e9 AP_GPS: faster GPS lock
use 9600 and 115200 first
2017-11-29 00:58:43 -07: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 68828511cd AP_GPS: Only send GPS*_RTK mavlink messages if the backend supports them 2017-10-30 18:28:20 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas e0c2a45eec AP_GPS: support GPS_RTK and GPS2_RTK messages in Emlid reach modules. Requires Reach FW >= 2.7.4 2017-10-30 18:28:20 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas c0dd7984ad AP_GPS: Publish information on the GPS*_RTK mavlink messages 2017-10-30 18:28:20 +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 0300f86913 AP_GPS: u-blox: Log unconfigured messages 2017-10-06 12:53:32 +01:00
Michael du Breuil 3023fac4d0 AP_GPS: SBF enable comment block logging
This is intended to help with GCS's injecting custom data to the GPS
2017-09-27 19:29:32 +01:00
Michael du Breuil 561acb372e AP_GPS: SBF send port enable string on start
Also prohibts SBF, GSOF, NOVA drivers from getting config strings not
meant for them
2017-09-27 19:29:32 +01:00
Michael du Breuil bfbec02736 AP_GPS: SBF track the GPS error bits 2017-09-27 19:29:32 +01:00
Michael du Breuil 0d522663b2 AP_GPS: SBF: fix the PVTMode to support PPK (and baseline) units 2017-09-27 19:29:32 +01:00
Michael du Breuil 80b71b9ced AP_GPS: SBF: Validate that configuration was accepted
Note: The config string of "spm, Rover, StandAlone+SBAS+DGPS+RTK\n" is
incompatible with AsteRx-M FW 3.6.3 and will result in refusing to
arm/pass configuration checks
2017-09-27 19:29:32 +01:00
Michael du Breuil 20988b9f05 AP_GPS: SBF respect GPS_AUTO_CONFIG 2017-09-27 19:29:32 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas 09baac8f25 AP_GPS: Preserve the instance number, otherwise it will get set to zero
Signed-off-by: Dr.-Ing. Amilcar Do Carmo Lucas <amilcar.lucas@iav.de>
2017-09-26 23:15:10 -07:00
Dr.-Ing. Amilcar Do Carmo Lucas 8b9fb19061 AP_GPS: Added const just to be explicit (NFC)
Signed-off-by: Dr.-Ing. Amilcar Do Carmo Lucas <amilcar.lucas@iav.de>
2017-09-26 23:15:10 -07:00
Dr.-Ing. Amilcar Do Carmo Lucas 175b7c5389 AP_GPS: spellcheck in coment (NFC) 2017-09-26 23:15:10 -07:00
Lucas De Marchi b05610870c global: use static method to construct AP_Rally 2017-09-26 03:01:21 +01:00
Lucas De Marchi 69b6d95cb2 global: use static method to construct AP_Board_Config{,_CAN} 2017-09-26 03:01:21 +01:00
Lucas De Marchi 72fd2d6f05 global: use static method to construct AP_SerialManager 2017-09-26 03:01:21 +01:00
Lucas De Marchi 8094482f21 global: use static method to construct AP_GPS 2017-09-26 03:01:21 +01:00
Lucas De Marchi 2cb2727a31 AP_GPS: add static create method 2017-09-26 03:01:21 +01: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
Dr.-Ing. Amilcar Do Carmo Lucas d3a18e803e AP_GPS: Fix MAVLink message field SYSTEM_TIME.time_unix_usec when GPS_AUTO_SWITCH = blend
The mavlink message field SYSTEM_TIME.time_unix_usec works fine with GPS_AUTO_SWITCH == 0 (no switch) or ==1 (usebest)
But when GPS_AUTO_SWITCH == 2 (blend) then state[GPS_BLENDED_INSTANCE].last_gps_time_ms gets initialized with 0 and never rewritten.

The consequence: SYSTEM_TIME.time_unix_usec gets stuck at zero.
The solution: Do not reset state[GPS_BLENDED_INSTANCE].last_gps_time_ms because it would overwrite the correct value already set on line 1149
2017-09-14 12:38:30 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas e03826890a AP_GPS: Fix typo in comment 2017-09-13 14:22:57 -07:00
Michael du Breuil 04eb7f411e AP_GPS: Track the delta time between the last GPS positions 2017-09-13 13:36:40 +01:00
Michael du Breuil be371e09f9 AP_GPS: SBF: Reject short packets early, allow 256 byte long messages to be decoded 2017-09-06 10:41:36 +10:00
Andrew Tridgell 048dfee68a AP_GPS: make SBF driver more robust
this fixes a crash bug in the SBF GPS driver where a badly formed packet
could cause crc16_ccitt to reference invalid memory
2017-09-06 10:41:33 +10:00
Lucas De Marchi b62e8909c4 AP_GPS: add missing fallthrough 2017-09-01 13:45:22 -07:00
Lucas De Marchi 3414883f05 AP_GPS: remove tabs and fix coding style 2017-08-22 23:59:13 -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
Peter Barker 7f59279670 AP_GPS: make time_epoch_usec const 2017-07-28 14:27:53 +01:00
Peter Barker e7ff5107fb AP_GPS: tidy mavlink message handling using switch statement 2017-07-27 12:03:25 +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 b791fef7cb AP_GPS: Publish the number of satellites in the RTK correction messages, and the age of the RTK correction messages 2017-07-19 20:42:23 +09: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
Michael du Breuil 5684a5dd36 AP_GPS: Only setup state's instance field during init 2017-07-18 21:21:50 +01:00
Andrew Tridgell 82e7e44cc3 AP_GPS: fixed UAVCAN as 2nd GPS
This fixes the issue here:

  https://discuss.ardupilot.org/t/ac3-6-dev-dual-gps-issues/19172

thanks to Francisco for spotting the issue

this is tested with UAVCAN as 2nd GPS, ublox as primary
2017-07-18 18:57:55 +01:00
Peter Barker 76847a2487 AP_GPS: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
Michael du Breuil cb1b9b6674 AP_GPS: Fix SBF race condition on start
Unsure what the underlying problem is, but the length of the first string in
the initilisation_blob increasing resulted in a race condition, waiting
longer before retrying the message resolves it, but we still need to identify
the underlying problem. This patch just results in the GPS working with current
configurations. Tested against AsteRx-M firmware 3.6.3
2017-07-11 09:40:02 +09:00
Eugene Shamaev 5341e51f45 AP_GPS: support for multiple instances on different interfaces 2017-07-03 11:44:32 +01:00
Peter Barker cbe9627bf5 AP_GPS: correct example 2017-06-29 15:43:38 +01: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
Francisco Ferreira f35f0d59dd
AP_GPS: fix SBP2 driver build warnings by using memcpy
Build gave the following warnings:

../../libraries/AP_GPS/AP_GPS_SBP2.cpp: In member function ‘void AP_GPS_SBP2::_sbp_process_message()’:
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:181:78: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_heartbeat = *((struct sbp_heartbeat_t*)parser_state.msg_buff);
                                                                              ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:181:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_heartbeat = *((struct sbp_heartbeat_t*)parser_state.msg_buff);
                            ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:186:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_gps_time = *((struct sbp_gps_time_t*)parser_state.msg_buff);
                                                                            ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:186:27: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_gps_time = *((struct sbp_gps_time_t*)parser_state.msg_buff);
                           ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:190:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_vel_ned = *((struct sbp_vel_ned_t*)parser_state.msg_buff);
                                                                          ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:190:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_vel_ned = *((struct sbp_vel_ned_t*)parser_state.msg_buff);
                          ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:194:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_pos_llh = *((struct sbp_pos_llh_t*)parser_state.msg_buff);
                                                                          ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:194:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_pos_llh = *((struct sbp_pos_llh_t*)parser_state.msg_buff);
                          ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:198:68: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_dops = *((struct sbp_dops_t*)parser_state.msg_buff);
                                                                    ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:198:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_dops = *((struct sbp_dops_t*)parser_state.msg_buff);
                       ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:202:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_event = *((struct sbp_ext_event_t*)parser_state.msg_buff);
                                                                          ^
../../libraries/AP_GPS/AP_GPS_SBP2.cpp:202:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             last_event = *((struct sbp_ext_event_t*)parser_state.msg_buff);
                        ^
2017-06-29 15:18:09 +01:00
ebethon 005dbf41a7 AP_GPS: Add SBP EXT_EVENT Message to dataflash log 2017-06-29 15:18:05 +01:00
ebethon 4779a8f1f1 AP_GPS: Rename SBR1/SBR2 to SBRH/SBRM and change format
Add (sender_id, msg_len) in SBRM message
Add index/pages in SBRH/SBRM messages
Change format to integers to avoid GCS string parsing
Decrease data size in SBRH
2017-06-29 15:14:54 +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
priseborough bd0229b7bc AP_GPS: Fix bug in calculation of blended GPS delay 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 ffe701bda3 AP_GPS: Use a static assert to check that the init blob is small enough 2017-05-31 14:39:53 +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 84598544fb AP_GPS: Don't autodetect NMEA instances 2017-05-30 23:37:59 +01:00
Michael du Breuil a1479c4138 AP_GPS: SBF report driver lag 2017-05-26 17:42:15 +01:00
Michael du Breuil 3da3ad05bf AP_GPS: SBF report velocity accuracy 2017-05-26 17:42:15 +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
Michael du Breuil 397ae00526 AP_GPS: SBF report VDOP 2017-05-24 20:03:29 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas 2d5033b132 AP_GPS: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
Peter Barker e9ce3aa0ce AP_GPS: use HAL_SEMAPHORE_BLOCK_FOREVER macro 2017-05-08 10:23:03 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas e31ac00f26 AP_GPS: fix spelling in comments 2017-05-08 10:08:31 +09: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
Dr.-Ing. Amilcar Do Carmo Lucas 5261654756 AP_GPS: Only inject RTCM data to the selected GPS device defined in GPS_INJECT_TO parameter 2017-05-01 13:06:18 +01:00
Michael du Breuil 12f83ecf75 AP_GPS: SBF if RAW_DATA is enabled check that the GPS is succeeding at logging 2017-05-01 13:04:52 +01:00
Michael du Breuil d91f89d24b AP_GPS: Remove stale ublox config files
These configurations no longer (and haven't for quite awhile) matched the
desired command set or baud rates, loading them will still require the GPS
driver to tweak settings, or have AUTO_CONFIG turned off, which is a less
safe configuration.
2017-04-23 21:15:58 +01:00
Peter Barker 1ba59b446c AP_GPS: log ublox sw and hw versions on dataflash log start
This burns 41 bytes of RAM for each u-Blox GPS.
2017-04-23 21:04:17 +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 c46ea73426 AP_GPS: rename QURTGPS to QURT 2017-04-23 21:04:15 +01:00
Peter Barker 2354a0ec5a AP_GPS: ability to log GPS detection state to dataflash 2017-04-23 21:03:23 +01:00
Peter Barker 94a5e94ec9 AP_GPS: canonicalise statustext messages
Use "GPS %d" prefix, where %d is instance+1, to correspond
with parameters
2017-04-23 09:09:30 +10:00
Peter Barker 4334a92ac9 AP_GPS: remove unimplemented method declarations 2017-04-23 09:08:30 +10:00
Michael du Breuil 6f297deaf7 AP_GPS: Unify inject_data interface for all classes 2017-04-19 02:05:51 +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 8130d85b42 AP_GPS: removal of legacy UAVCAN support 2017-04-17 17:27:18 +10:00
Pierre Kancir 292fa5f413 AP_GPS: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
Eugene Shamaev dfe9b0e6fc AP_GPS: support for UAVCAN connected GNSS receivers 2017-04-10 22:38:12 +01:00
Michael du Breuil 6b523cbd46 AP_GPS: Fix a memory leak in QURT GPS
Fixes part of #6000
2017-04-09 16:56:00 +10:00
Jacob Walser 1b00dfb642 AP_GPS: Fix parameter metadata 2017-03-22 16:16:26 -07:00
Pierre Kancir afb488c627 AP_GPS: fix implicit conversion warning from float to double 2017-03-17 13:07:57 +01:00
Randy Mackay b82098ca44 AP_GPS: fix blended ground course
Thanks to jyl58 for finding this
2017-03-13 11:21:47 +09:00
Randy Mackay 3e628f30ff AP_GPS: fix blending when accuracy reported as 1mm
Thanks to Michael DuBreuil for suggesting the fix
2017-03-13 11:31:51 +11:00
Randy Mackay 2002827de3 AP_GPS: rename pre-arm blending health check 2017-03-13 11:31:51 +11:00
Randy Mackay e9c881c668 AP_GPS: stop blending if too many blending failures 2017-03-13 11:31:51 +11:00
Randy Mackay b7ad8da9b9 AP_GPS: minor bracketing fix
This silences a warning from eclipse
No functional change
2017-03-13 11:31:51 +11:00
Randy Mackay 5de64273ec AP_GPS: more efficient initialisation of blending arrays 2017-03-13 11:31:51 +11:00
Randy Mackay 81b20e971b AP_GPS_UBLOX: use get_rate_ms accessor 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