Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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
quat2eulerby clamping the input toasinto prevent domain errors - Reorganized imports and exports in
KiteUtils.jlto be alphabetically sorted - Added new comprehensive example
test_heading.jlthat 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.
Updated StructArrays to the latest version in v0.11.2.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
The variables rf and dt are declared but never used in this loop. Remove the unused variable declaration.
| local rf, dt | |
| local dt |
| 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)) |
There was a problem hiding this comment.
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.
| el, az = calc_elevation_azimuth(deg2rad(ta)) | |
| el, az = calc_elevation_azimuth(deg2rad(ta); x=x, z=0.0, r=r) |
Uh oh!
There was an error while loading. Please reload this page.