Skip to content
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

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

Ryanf55
Copy link
Collaborator

@Ryanf55 Ryanf55 commented Nov 4, 2023

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; previously it was not and likely a bug on the BD930 unless they were using RS232 level logic on the drone/bench
  • The data rate remains the same as before
  • Once this PR goes in, the Trimble PX-1 is functional as a GPS in ArduPilot

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

COM2 data configuration:
image

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.

* 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]>
@Ryanf55 Ryanf55 self-assigned this Nov 4, 2023
@Ryanf55 Ryanf55 added GPS For-4.5 Planned for 4.5 release DevCallTopic labels Nov 4, 2023
@WickedShell
Copy link
Contributor

WickedShell commented Nov 4, 2023 via email

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Nov 4, 2023

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 COM2 data configuration: image 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. --------------------------------------------------------------- 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) - M libraries/AP_GPS/AP_GPS_GSOF.cpp (13) - M libraries/AP_GPS/AP_GPS_GSOF.h (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, or unsubscribe. 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.

@tridge tridge merged commit 9445cb2 into ArduPilot:master Nov 6, 2023
86 checks passed
@Ryanf55 Ryanf55 deleted the gsof-correct-hardware-port branch November 6, 2023 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For-4.5 Planned for 4.5 release GPS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants