Skip to content

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

Open
wants to merge 8 commits into
base: v2/main
Choose a base branch
from
Open

GPS module #109

wants to merge 8 commits into from

Conversation

athenaleong
Copy link

Added GPS module. Test code is in /tests/gps-test.

Copy link
Member

@andycate andycate left a 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.

Comment on lines +19 to +22
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
Copy link
Member

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};
Copy link
Member

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};
Copy link
Member

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
Comment on lines 23 to 33
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
Copy link
Member

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

@taitmate38
Copy link
Member

We should have a separate v2/lad5 branch that we are PR-ing all these branches into

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants