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

"Point toward/away from point" constraint #381

Closed
Lewis-Seiden opened this issue Mar 5, 2024 · 4 comments · Fixed by #427
Closed

"Point toward/away from point" constraint #381

Lewis-Seiden opened this issue Mar 5, 2024 · 4 comments · Fixed by #427
Labels
component: backend Rust/Tauri backend type: enhancement New feature or request

Comments

@Lewis-Seiden
Copy link
Collaborator

useful for intaking and scoring where you want one end of the robot to face a game piece/goal

@calcmogul calcmogul changed the title point towards and/or point away from constraint "Point toward/away from point" constraint Mar 5, 2024
@calcmogul calcmogul added type: enhancement New feature or request component: backend Rust/Tauri backend labels Mar 5, 2024
@shueja
Copy link
Collaborator

shueja commented Mar 5, 2024

This would be extra nice when used with #297

@calcmogul
Copy link
Member

calcmogul commented Mar 20, 2024

This constraint could be implemented like so:

heading = atan2(point.y - y, point.x - x)
tan(heading) = (point.y - y)/(point.x - x)
sin(heading)/cos(heading) = (point.y - y)/(point.x - x)
sin(heading) * (point.x - x) = cos(heading) * (point.y - y)

The rearrangement is to avoid potential ill-conditioning.

@shueja
Copy link
Collaborator

shueja commented Mar 21, 2024

Is there a formulation that could allow a particular error boundary around the desired heading? I expect that would make convergence easier and most uses probably don’t require exact pointing.

@calcmogul
Copy link
Member

I'm not sure how to correctly manipulate nonlinear inequalities, so you'd probably be stuck with the following:

atan2(point.y - y, point.x - x) < heading + ε
atan2(point.y - y, point.x - x) > heading - ε

@calcmogul calcmogul linked a pull request Apr 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: backend Rust/Tauri backend type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants