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.
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)
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
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
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.
This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.
AVR-specific places were not changed.
This is really just calculating the hamming weight of the GNSS_MODE bitmask, but I don't know if the APM compiler could handle the GCC intrinsic that could calculate it faster, and this is done so rarely there isn't a significant penalty to using the for loop.
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.
Provides a stable fallback, and can be considered fairly safe from the perspective that it provides a worse value then the hDOP under almost all scenarios.
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.
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
this gives us noise, jamming and RF information from the uBlox
protocol. This will hopefully allow a more detailed investigation of
antenna choices and RF interference
if the GPS is giving us data at less than 300ms intervals then re-send
the configuration messages to try to kick it into the right rates
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
Ensure 3D fix before returning velocity_down
UBLOX: restore check of fix_status as part of determining 2D or 3D fix
SIRF: add missing brackets on fix type check
the old mechanism wasted most of the input bytes, and chewed a lot of
CPU, making it impractical to do GPS detection for a GPS attached
after startup
The new code is async, and detects a GPS by looking for a fully formed
packet with the right checksum for each GPS type
if a UBlox is configured for NMEA only, with no UBX messages at all
then it would never trigger the GPS_AUTO detection. This adds a UBX
config message to the init strings that enables the NAV_SOL message
the parser was broken in several ways:
1) when it received an unknown message it didn't update the ck_a and ck_b fields, so it
thought the message had a bad checksum, which meant it got out of protocol sync
2) the read() method would return false if the last message from the GPS was of an unknown type.
So we relied on the last msg always being one that we understand and want
3) the parser considered any valid UBLOX message to be 'new data', whereas we only actually get
a new fix when we get box a new position and velned message
4) the total message size per update is more than 128 bytes, but the serial port was opened
with only a 128 byte buffer, so we got corruption regularly
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
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
Teach AP_GPS about FastSerial (in the few places it needs to know) and about Stream everywhere else.
Do some minor code cleanup.
Tested with Mega and uBlox. Some issues (e.g. reporting 0 satelites) remain.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@404 f9c3cf11-9bcb-44bc-f272-b75c42450872