-
Notifications
You must be signed in to change notification settings - Fork 2
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
add simple tag direction and distance guesstimator #20
base: dev
Are you sure you want to change the base?
Changes from all commits
7c6d2f4
5c9d49d
5be0296
cbfb7d5
1c5a2ac
63bfae4
01b2756
44426bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
import cv2 | ||
|
||
class Navigator(): | ||
|
||
states = ["WHERETHEFUCKAMI",] | ||
|
||
def __init__(self, interface): | ||
self.state = self.states[0] | ||
self.interface = interface | ||
self.find_glass = False | ||
|
||
def iterate(self, tag_name, tag_angle, tag_distance, sensors, tag_image): | ||
print(self.state, tag_name) | ||
if self.state == "WHERETHEFUCKAMI": | ||
|
||
# TODO: replace with a decent controller | ||
if not (tag_name is None): | ||
if tag_name == "Y.png": | ||
|
||
# TODO: we need to avoid abruptal direction changes on the wheels, as the | ||
# escs have a required timeout | ||
speed = 1 | ||
if tag_angle is not None and tag_angle[0] > 4: | ||
self.interface.set_right_speed(- speed) | ||
self.interface.set_left_speed(speed) | ||
elif tag_angle is not None and tag_angle[0] < -4: | ||
self.interface.set_right_speed(speed) | ||
self.interface.set_left_speed(-speed) | ||
else: | ||
self.interface.set_right_speed(speed) | ||
self.interface.set_left_speed(speed) | ||
|
||
if sensors['fr'][0]: | ||
#got to a wall? | ||
#self.state = "GETHEFUCKINGCUP" | ||
pass | ||
print("distance:", tag_distance) | ||
else: | ||
print(tag_name, tag_name is None) | ||
print("FUCK, GOT ", tag_name, tag_name is not None, type(tag_name)) | ||
self.state = "GENERALIZEDCHAOS" | ||
self.interface.set_left_speed(0) | ||
self.interface.set_right_speed(0) | ||
cv2.imshow("fail", tag_image) | ||
if self.state == "GETTHEFUCKINGCUP": | ||
print("should be trying to get the cup, now") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
model_checkpoint_path: "model.ckpt-10000" | ||
all_model_checkpoint_paths: "model.ckpt-1" | ||
all_model_checkpoint_paths: "model.ckpt-5000" | ||
all_model_checkpoint_paths: "model.ckpt-5001" | ||
all_model_checkpoint_paths: "model.ckpt-10000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
srly ?
🙅♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=]