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

Automatic Alignment #177

Open
CarlyAmar opened this issue Mar 9, 2015 · 4 comments
Open

Automatic Alignment #177

CarlyAmar opened this issue Mar 9, 2015 · 4 comments

Comments

@CarlyAmar
Copy link
Contributor

We have 2 long range IR's and the pixycams to do this

@CarlyAmar CarlyAmar mentioned this issue Mar 9, 2015
@CarlyAmar
Copy link
Contributor Author

We need this to do #178 : Autonomous for picking up crates and we may also use this in teleop attached to a button

@CarlyAmar
Copy link
Contributor Author

See: #126

@calvin-godfrey
Copy link
Contributor

So I graphed how the ratio of width/height changes based on the angle.

image

and the python code I used to make this is:

import matplotlib
from math import sqrt
matplotlib.use('Agg')
import matplotlib.pyplot as plt
width = 26.9
length = 16.9
widthChange = 26.9/90
lengthChange = 16.9/90
startCoords = [0.0, 0.0]
endCoords = [26.9, 0.0]
ratio = []
angle = [x for x in range(1, 91)]
def distance(x1, y1, x2, y2):
    return sqrt((x1-x2)**2+(y1-y2)**2)
for i in range(90):
    d = distance(startCoords[0], startCoords[1], endCoords[0], endCoords[1])
    ratio.append(d/12.1) #height
    startCoords[0] += widthChange
    endCoords[1] += lengthChange
for i in ratio:
    print "(" + str(angle[ratio.index(i)]) + "," + str(i) + ")"

calvin-godfrey added a commit that referenced this issue Mar 14, 2015
@calvin-godfrey
Copy link
Contributor

This doesn't completely work. I'm doing some testing and I think there's some cases where it returns a nonreal answer which will return an error.

calvin-godfrey added a commit that referenced this issue Mar 23, 2015
… function, not even a class. You can choose to include this commit or not based on preference. Issue #177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants