Skip to content

Conversation

Eureak-zon
Copy link
Contributor

@DonLakeFlyer Could you help me review the code? I don't think this implementation is the best at present.

This commit implements the adjustCoordinatesForLoiterRadius() method to correctly
calculate tangent points for flight paths connecting loiter circles. The implementation:

- Handles connections between two loiter circles using proper tangent calculation
- Supports connections between a point and a loiter circle
- Adjusts display coordinates while preserving the original waypoint positions
- Uses geometric calculations based on azimuth and distance between waypoints
@HTRamsey HTRamsey requested a review from DonLakeFlyer August 22, 2025 07:48
@Eureak-zon Eureak-zon marked this pull request as ready for review August 23, 2025 15:21
@DonLakeFlyer
Copy link
Contributor

I assume the cmake file in the pull is a mistake?

I've been playing around with this using PX4 SITL. My concern is that this kinda just draws flight paths which differ from reality in a different wrong way.

For example with PX4:

  • When flying to a loiter point the initial flight path is not to a tangent to a loiter but to the center of the loiter. Only when it gets close does it diverge towards the tangent. This new change doesn't show this correctly. It draws from the previous waypoint to the tangent.
  • When flying away from a loiter point I think it always flies away from the tangent direct to the next waypoint which differs from entry. This change does draw this correctly.

Given that, I'm not sure this is really better. Just differently wrong as far as I can tell.

I'm also unsure whether ArduPilot actual flight path differs from how PX4 does it? The real flight path might be firmware specific. @rubenp02?

@DonLakeFlyer
Copy link
Contributor

So I guess after playing around with ti I agree with what @rubenp02 said in the original pull:
"I think it's problematic because the path visualizations don't match what the aircraft will fly which I think is very critical for obstacle avoidance and such. Maybe keep the improved calculations and revert the map line drawing to how it was before, or adjust the improved one to be correct."

@Eureak-zon
Copy link
Contributor Author

@DonLakeFlyer CMakePresets.json is a bug commit, please ignore it

@Eureak-zon
Copy link
Contributor Author

My idea is that in the circling mode, the ideal flight path should be accurately plotted, while the actual flight path is determined by the flight control system itself. After all, the algorithms of each simulator are different.

@DonLakeFlyer
Copy link
Contributor

What is the actual flight path for ArduPilot when coming in to and exiting a Loiter?

@rubenp02
Copy link
Contributor

rubenp02 commented Sep 1, 2025

What is the actual flight path for ArduPilot when coming in to and exiting a Loiter?

Entry is straight towards the center until it gets "captured" and starts loitering. Exit can be perpendicular or tangent to the loiter path.

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