Skip to content

Try to reproduce heading gate results from Bart#106

Draft
ufechner7 wants to merge 45 commits intomainfrom
heading
Draft

Try to reproduce heading gate results from Bart#106
ufechner7 wants to merge 45 commits intomainfrom
heading

Conversation

@ufechner7
Copy link
Member

@ufechner7 ufechner7 commented Feb 10, 2026

  • A plot similar to Bart's plot in the AWEC abstract is produced
  • Show the circle flight in the 3D viewer
  • Add the option to fly a circle at different elevation angles of the centre point of the circle
  • Add a corrected function to calculate the heading
  • We agree on the best choice of the x-axis of the third diagram (time or turn angle)
  • Bart agrees that there is no obvious bug in this example
  • Update the documentation

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds functionality to reproduce heading gate results from Bart by making a bug fix to handle edge cases in quaternion-to-Euler conversion and adding a comprehensive test example. The changes include fixing a numerical stability issue, reorganizing imports/exports for better readability, and creating a new example file to test heading calculations for kites flying in circular patterns.

Changes:

  • Fixed numerical stability issue in quat2euler by clamping the input to asin to prevent domain errors
  • Reorganized imports and exports in KiteUtils.jl to be alphabetically sorted
  • Added new comprehensive example test_heading.jl that simulates kites flying in circular patterns and calculates/plots heading angles

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/transformations.jl Added clamp to prevent domain errors in asin when converting quaternions to Euler angles
src/KiteUtils.jl Reorganized imports and exports alphabetically for better code organization
examples/test_heading.jl New comprehensive test file with functions to calculate elevation, azimuth, orientation, and heading for kites flying in circular patterns, including visualization
examples/Project.toml Added Rotations dependency needed by the new test file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ufechner7 ufechner7 self-assigned this Feb 12, 2026
@ufechner7 ufechner7 linked an issue Feb 12, 2026 that may be closed by this pull request
2 tasks
@ufechner7 ufechner7 requested a review from Copilot February 14, 2026 19:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pd_labels = String[]

for θ in theta
local rf, dt
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variables rf and dt are declared but never used in this loop. Remove the unused variable declaration.

Suggested change
local rf, dt
local dt

Copilot uses AI. Check for mistakes.
x = r / tan(deg2rad(θ))
roll, pitch, yaw = calc_orientation(deg2rad(ta); x=x, z=0.0, r=r)
pos = calc_kite_pos(deg2rad(ta); x=x, z=0.0, r=r)
el, az = calc_elevation_azimuth(deg2rad(ta))
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call to calc_elevation_azimuth is missing the x, z, and r parameters that are passed to other calls in this function. This will use default values (x=100.0, z=0.0, r=20.0) instead of the calculated values, producing incorrect elevation and azimuth angles. Add ; followed by x=x, z=0.0, r=r to match the pattern used in lines 309-310 and 312.

Suggested change
el, az = calc_elevation_azimuth(deg2rad(ta))
el, az = calc_elevation_azimuth(deg2rad(ta); x=x, z=0.0, r=r)

Copilot uses AI. Check for mistakes.
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.

Heading calculation is wrong

3 participants

Comments