-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
AP_GPS: Expose COM port and Output Rate in header, Fix default COM port #25456
Conversation
* This removes magic numbers of hard coding the hardware port and output rate * This also fixes configuring the incorrect hardware port * Now, COM2 (TTL) is configured for GSOF output * The data rate remains the same as before Signed-off-by: Ryan Friedman <[email protected]>
Is the any value to using the GPS_COM_PORT parameter to let users control this? It's for exactly this purpose. On Septentrio we can use it directly for com ports, but if you want to add an enum meaning that only applies to the GSOF driver that's totally fine.
This is just an idea, and in no way a blocker.
…-------- Original Message --------
On Nov 3, 2023, 21:28, Ryan - notifications at github.com wrote:
Purpose
- This removes magic numbers of hard coding the hardware port and output rate
- This also fixes configuring the incorrect hardware port
- Now, COM2 (TTL) is configured for GSOF output
- The data rate remains the same as before
Demo
You can see in the screenshot, the config UI shows the device is now configured on COM2 for 230k, which is the desired behavior when the user sets the parameter correctly. COM2 is the TTL level serial port that users typically connect to a flight controller.
Output overview:
[image](https://user-images.githubusercontent.com/25047695/280445542-ee1b97e9-473c-4652-b422-46eb055ab055.png)
COM2 data configuration:
[image](https://user-images.githubusercontent.com/25047695/280445558-e602891d-f460-4db5-b58d-58036ff23edf.png)
Related
Parts of this were split from [#25449](#25449) to make it easier to merge.
Preserving behavior
Old behavior was to configure the NTRIP Caster 3 and COM1 (RS232) for GSOF output, which wasn't useful on most drones. This breaks that behavior. I think it's obvious no one was using this. You can see how previous settings are still hard-coded in the application. Future work will allow exposing these over parameters.
Testing
I've tested this on my bench with a PX1 connected to SITL. The configuration at both baud rates works, and this improves the default port assignment to work with the right COM port at TTL level logic. The validity checks for GSOF pass in SITL.
You can disable all output in the PX1 UI, start the driver, and watch it configure GSOF output correctly.
---------------------------------------------------------------
You can view, comment on, or merge this pull request online at:
#25456
Commit Summary
- [edac1ef](edac1ef) AP_GPS: Expose COM port and Output Rate in header
File Changes
([2 files](https://github.com/ArduPilot/ardupilot/pull/25456/files))
- M [libraries/AP_GPS/AP_GPS_GSOF.cpp](https://github.com/ArduPilot/ardupilot/pull/25456/files#diff-e1cb5f0c1f07f8558f34844d513e092c3bd9b2074ef765c0f3ba878eaf05780e) (13)
- M [libraries/AP_GPS/AP_GPS_GSOF.h](https://github.com/ArduPilot/ardupilot/pull/25456/files#diff-1f0fdda454b4375e7d9057ed0e5749235cd3a59e5148f9ec27770d6342242aee) (26)
Patch Links:
- https://github.com/ArduPilot/ardupilot/pull/25456.patch
- https://github.com/ArduPilot/ardupilot/pull/25456.diff
—
Reply to this email directly, [view it on GitHub](#25456), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAEKTCGOOB6PZHYJB3E3TOTYCW77ZAVCNFSM6AAAAAA65JVO36VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TOMJWGEZTMMA).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Yep, exactly. I'd prefer to do that in a follow up PR to make this one small and simple. |
Purpose
Demo
You can see in the screenshot, the config UI shows the device is now configured on COM2 for 230k, which is the desired behavior when the user sets the parameter correctly. COM2 is the TTL level serial port that users typically connect to a flight controller.
Output overview:
COM2 data configuration:
Related
Parts of this were split from #25449 to make it easier to merge.
Preserving behavior
Old behavior was to configure the NTRIP Caster 3 and COM1 (RS232) for GSOF output, which wasn't useful on most drones. This breaks that behavior. I think it's obvious no one was using this. You can see how previous settings are still hard-coded in the application. Future work will allow exposing these over parameters.
Testing
I've tested this on my bench with a PX1 connected to SITL. The configuration at both baud rates works, and this improves the default port assignment to work with the right COM port at TTL level logic. The validity checks for GSOF pass in SITL.
You can disable all output in the PX1 UI, start the driver, and watch it configure GSOF output correctly.