-
Notifications
You must be signed in to change notification settings - Fork 1
GPS module #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v2/main
Are you sure you want to change the base?
GPS module #109
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, but need to adapt the code to communicate with the GPS over SPI. Should be relatively easy to change, given that the library has SPI bus support built in.
lib_deps = | ||
stevemarple/MicroNMEA@^2.0.5 | ||
sparkfun/SparkFun u-blox Arduino Library@^1.8.11 | ||
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these dependencies, can you download them and put them into the lib
folder? That way we don't need to have external dependencies
src/FC/GPS.cpp
Outdated
SFE_UBLOX_GNSS myGNSS; | ||
uint32_t gpsUpdatePeriod = 40 * 1000; | ||
|
||
Comms::Packet latLongPacket = {.id = 11}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ID of the gps packet is 6
, according to the E-1 Design spreadsheet
src/FC/GPS.cpp
Outdated
double longitude; | ||
|
||
|
||
Comms::Packet auxPacket = {.id = 12}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packet 12 is for something else rn, can you add a line to the E-1 Design spreadsheet for a new packet? Maybe ID 7, since thats unused right now
src/FC/GPS.cpp
Outdated
Serial.begin(9600); | ||
Wire.begin(); | ||
Serial.println("GPS setup"); | ||
if (!myGNSS.begin()) { | ||
Serial.println("GPS failed to start"); | ||
} else { | ||
Serial.println("GPS started"); | ||
} | ||
// Version 2 - UBX | ||
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) | ||
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the flight computer, the GPS is connected to the teensy using SPI, so can you set up the SPI interface here instead of I2C? Also, don't use Serial.print for logging. If you want to log messages for debugging purposes, use the DEBUG("<message>");
macro
We should have a separate v2/lad5 branch that we are PR-ing all these branches into |
Added GPS module. Test code is in /tests/gps-test.