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

[ObstacleDistanceOverlay] Fix 90 degree offset #10879

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Conversation

dakejahl
Copy link
Contributor

Fixes issue where obstacle distances are displayed with a +90 degree offset. This is due to an error in the coordinate system math along with an error in calculating the degrees for the current distance index. The yaw angle theta is measured CW from North and therefore r * cos(theta) is negative Y axis and r * sin(theta) is positive X.

Qt docs

The x values increase to the right and the y values increase downwards.
image

There's more still that needs to be done. The ObstacleDistanceOverlayVideo.qml probably needs this fix. There's also the VehicleObjectAvoidance class which seems to be entirely unused other than the distances array. This feature is currently broken in PX4 and I don't think anyone has used it in years. I want to resurrect the feature and make it all work again.

@DonLakeFlyer
Copy link
Contributor

@dakejahl Any updates on this. It's still marked Draft.

@dakejahl
Copy link
Contributor Author

No not yet, I haven't come back to working on this. The first step is to get the feature working again in PX4.

@DonLakeFlyer
Copy link
Contributor

@dakejahl Updates?

@dakejahl
Copy link
Contributor Author

dakejahl commented Dec 3, 2024

@Claudio-Chies has done a ton of work lately with avoidance in PX4 so he might know better than I

@Claudio-Chies
Copy link
Contributor

@dakejahl wow awesome! This was on my to-do, didn't know you already solved it! Thanks a lot!
image
looks great, only the video overlay is still offset, as you mentioned above.

@dakejahl dakejahl marked this pull request as ready for review December 4, 2024 09:29
@Claudio-Chies
Copy link
Contributor

image
Added a Fix for the Video Overlay, basically the problem is that the degrees are in FRD frame starting from Front rotating around Down, but plotting is done in XY Starting at the X line, clockwise,
so I'm subtracting Pi/2 to fix the issue.

@MaEtUgR MaEtUgR merged commit b3e66c9 into master Dec 16, 2024
8 checks passed
@MaEtUgR MaEtUgR deleted the pr-fix_obstacle_overlay branch December 16, 2024 11:05
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.

4 participants