-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
GPU-accelerated obstacle detection #620
Merged
Merged
Changes from all commits
Commits
Show all changes
229 commits
Select commit
Hold shift + click to select a range
bba2188
added normed center offset functionality
MarshallVielmetti 1a274ed
add starter files for second cam tag detection node
alisonryckman ce56c53
Wrote detection and hit updating 4 long range tags
MarshallVielmetti 1ce57d1
updated Perception README.md
MarshallVielmetti f14d6fb
Created message types
MarshallVielmetti 1ee5d9f
fixed tags issue and added to CmakeLists
MarshallVielmetti de3fd1e
added tag publishing logic
MarshallVielmetti 1dc1f1d
replaced C style casting with static casts
MarshallVielmetti 977e252
added marked image publishing
MarshallVielmetti 35c9bf2
Removed abbreviation
MarshallVielmetti 1544d2f
Merge branch 'master' of github.com:umrover/mrover-ros into percep-se…
alisonryckman 51c664b
add wrapper node
alisonryckman b2c72d0
add detector files
alisonryckman f05e396
x
AjaySum 947417d
save
qhdwight 5ab8d47
Clean starting point
qhdwight fa185e4
Cleanup cmake
qhdwight 5b53847
Add starter files
qhdwight 3442e34
Disambiguate tag detector and obj detector config, add more starter s…
qhdwight ff8bb2d
Add comments
qhdwight 7629bce
created long_range_cam pch
MarshallVielmetti d522377
move tag detectors into their own folders and added long range cam vi…
alisonryckman 8229b24
merge conflict res
alisonryckman 90ae8d3
merged in fillImageMessage
AjaySum ef2e765
Began work on object detector
MarshallVielmetti e70dc0c
Add cmake
jbrhm 716eeba
Merge remote-tracking branch 'origin/master' into percep-second-cam
jbrhm 836961e
Fix cmake
jbrhm 20109b7
Getting Matrix Results
jbrhm 9996b7c
Data Gathered Just Need to Create and Publish Msg
jbrhm 7272be8
Object msg - still needs publisher
jbrhm 133b6e2
Needs work with onnx
jbrhm 8fbb215
imread error and linker error
jbrhm 743226e
Merge remote-tracking branch 'origin/master' into percep/obj-detect
qhdwight 20c3693
Can detect water bottle
jbrhm 154151d
Static Bottle Detection Working
jbrhm 818ce3c
Working camera detection
jbrhm 9adc860
Make Needs to be Updated
jbrhm 112b13f
Segmentation Error
jbrhm b74bf90
get camera images with gstreamer, add nodelet to cmakelists
umroverPerception a8a8147
add bearing function defs
alisonryckman 10ed461
fix cmakelists conflict
alisonryckman 2e63217
Pre ZED Testing
jbrhm d58cb7b
Merge remote-tracking branch 'origin/master' into percep/obj-detect
qhdwight d6dd4fe
ZED Object Detection (Needs Speeding up)
jbrhm a0a88c6
Image Detections Published Properly
jbrhm 0bf3562
Publish Nav Data
jbrhm 488d9f7
fix cmake and bearing starter code
umroverPerception d3c6d50
add nodelet plugins
umroverPerception a007ea2
Merge with master and fix up a few things
qhdwight 49219f8
NOT WORKING BUT TRIED
MarshallVielmetti 1b219ea
Add cuda file
qhdwight 2d6346a
edit object msg type
alisonryckman 5471f2f
Mid Tensor Development
jbrhm f14dd0f
Merge branch 'percep/obj-detect' of github.com:umrover/mrover-ros int…
jbrhm f7ef94f
Working on Inference Class
jbrhm 3d5e10b
working greyscale stream with ros
umroverPerception 22036a9
switch image type from grey -> bgra
umroverPerception 5789ac0
Constructor blocked: Didn't adjust for comments: Unsure about some of…
jbrhm be76f23
I'm confused
jbrhm e731088
DEATH TO THE RED SQUIGGLES: Forward Pass done. Need to parse output
jbrhm 718cb1a
Wrote Parser
jbrhm ac14193
implemented part of getTagBearing()
lorraineqiu828 a12c347
Implementing Mats
jbrhm 33d2fb4
Remove Until Built
jbrhm 6e8c3c0
Pre ONNX Environment setup
jbrhm 5659896
Builds: Removed ReadProtoTensor
jbrhm e958479
Inference.cu builds
jbrhm 6fb7fc6
Pointer Errors with cv::Mat
jbrhm d235b14
Added NVINFER && NVONNXPARSER to CMake
jbrhm 28fc946
fixed segfaults, image wrong format
umroverPerception 0a4db39
tag detector works
umroverPerception 6dc1e10
Everything compiles
jbrhm dc24862
cuda_runtime_api.h' file not found
jbrhm 2dba81c
CUDA COMPILING ::::::))))))))
jbrhm 1f90062
Code Compiles with Wrapper Constructor called
jbrhm 13c10d4
No More Seg Fault
jbrhm f214add
Something is up with running the model
jbrhm 383760a
SEG FAULT :))))))
jbrhm 1843aa9
sadness
jbrhm cccf7b0
builds correctly now
lorraineqiu828 2375874
add launch
umroverPerception b6bd514
Merge branch 'percep-second-cam' of github.com:umrover/mrover-ros int…
umroverPerception 56c6f39
Create and Parse Engine File
jbrhm f065a63
seg fault on Cuda stream sad :(((((((
jbrhm 90293cb
I FORGET WHAT THESE CHANGES ARE
jbrhm 243d590
Initia changes
qhdwight 2e719a9
Minor changeS
qhdwight 5502240
Null Ptr :(((((((
jbrhm 4dcfd13
Get rid of uneeded mat
qhdwight 025af00
Clean up includes, refactor allocation of bindings, make inference fu…
qhdwight 432c22e
Trying
jbrhm bc072bc
Cleanup file names, use ROS as the logger
qhdwight f996b2d
initial files
Emerson-Ramey a75a763
Bruh moment doesn't compile moment :(
jbrhm 8de6b3f
Oops
qhdwight e7f7e9e
camera shouldn't crash
emmalinhart 4f17971
updated tag bearing function
emmalinhart 45ed4af
LETS GOO TENSORRT WORKING, PARSING WORKING, DEBUG SHOWING WORKING :))…
qhdwight b2027cf
Publish Nav Data and Optimized
qhdwight 63f2ace
Parsing Dimensions + Names :))
qhdwight 85be079
Not finished Tidying
qhdwight 57adace
Cleaned Code
qhdwight 7dbe7ff
Parsing point cloud 2 image
qhdwight aa1e693
Update LFS files to track NN files
qhdwight e3f5a9b
Post engine fiasco Changes
jbrhm 9eb1d6a
fix build
alisonryckman f4202d5
Merge branch 'master' into ebr/new-states
Emerson-Ramey 52d5763
outline changes for new states
Emerson-Ramey 023d79d
New Ubuntu
jbrhm 72160d9
Rescaled Pixel Grab
jbrhm 2324c79
commented and builds
jbrhm 6f2674f
Tested
jbrhm 1670a68
Merge branch 'percep/obj-detect' of github.com:umrover/mrover-ros int…
alisonryckman 7ec7957
Immediate and Permanent Thresholding on DetectedObject
jbrhm fa6a6f0
wrote mLongRangeTagsPub
enternal-L 65e776f
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight e722684
Working IRL
jbrhm da1259d
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight ae84400
Changes for obj detect working in sim
qhdwight 0bbb337
I need to charge my battery
jbrhm f9e51bf
Spiral Pattern :)
jbrhm 84a9b69
Fixed Spiral
jbrhm 656f357
Cleaned up TODO's and added filesystem
jbrhm 6867316
Cleaning up
jbrhm cce3b3e
Code Cleaned Up! :)))
jbrhm 704e314
update todos
Emerson-Ramey 9bc75e7
Merge branch 'master' into ebr/new-states
Emerson-Ramey 099e354
Cleaned up comments and Tested
jbrhm 6bfcae6
progress on TODOs
sbarstys f51c02d
add udev rule for usb cam
alisonryckman 059aed1
Merge remote-tracking branch 'origin/integration' into ebr/new-states
qhdwight d6abfe9
Update name
qhdwight 34ae229
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight 5fc95b9
Picture Taking :))))
jbrhm 6bc9b1a
Merge Conflicts
jbrhm 13d3fe0
Removed Image_Capture C++ Infrastructure
jbrhm 240848e
Get rid of print statement
jbrhm eda4a56
Merge branch 'integration' into ebr/new-states
Emerson-Ramey c35561f
change to MALLET
Emerson-Ramey 8ee12e7
edit search and waypoint
Emerson-Ramey aa08599
Merge branch 'percep/obj-detect' of github.com:umrover/mrover-ros int…
alisonryckman 0da4475
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight 22176e1
Fixed CMakelists.txt
jbrhm ca32c2e
Merge remote-tracking branch 'origin/integration' into ebr/new-states
umroverPerception b97bc64
approach object (mallet) working
umroverPerception 0b2f8c8
New Changes UNTESTED
jbrhm 640550a
Merge branch 'percep/obj-detect' of github.com:umrover/mrover-ros int…
alisonryckman 987155a
added target coord calculations
AjaySum 6e92496
added target coord calculations
AjaySum a12aebb
add both classes
alisonryckman 1cdc561
update to approach water bottle too
Emerson-Ramey e006721
fix bearing calc
alisonryckman 3eb039b
navigation ready for long range testing
ankithu 99cf3bb
merge + minor changes to demo long range cam
ankithu ae7a3fb
Testing New Models
jbrhm 16e4b13
max hit count
ankithu bf08fc5
time threshold check for LongRangeTagData
sbarstys 0a5cef5
fix mypy errors
ankithu 7085bb6
More data
jbrhm f9ccb5e
Model Changes
jbrhm 5b5f4f1
merge long range with new states
alisonryckman b9d6957
remove mains from percep nodelets
alisonryckman 34818a9
nav includes
alisonryckman 92379ab
add transtions in navigation.py
umroverPerception dcae199
fix image input to work in sim
alisonryckman 9719868
Merge branch 'ebr/new-states' of github.com:umrover/mrover-ros into e…
alisonryckman ada1a1f
Changes to zed Wrapper
jbrhm aecdb02
merge new states branch
alisonryckman d5da7aa
merge new states
alisonryckman 7e36572
change hit counts + nav tf frame names
alisonryckman 6077876
Pre Refactoring
jbrhm 249bec0
Some minor refactoring
jbrhm beb7b9d
refactoring
jbrhm 2e642cb
refactoring
jbrhm 47428af
Removed Refactoring Bugs
jbrhm 30e9dce
COLORS
jbrhm 01d1b41
Loop Profiler
jbrhm 9f41865
Cleaned up Image Capture
jbrhm 298d32f
updates
jbrhm ff2d351
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight 988bf77
Remove long range stuff from this PR
qhdwight 33cc95f
Mostly style changes
qhdwight f127e22
Undo formatting in tag detector
qhdwight af12b8d
Quintin Told me too
jbrhm b91bd2c
Ros Params
umroverPerception 33c2274
Fixing ROS Params
jbrhm b20cc07
Added Assert
umroverPerception bc331c2
Thread Not DYING :(((((((
jbrhm 6f8c9d1
Merge remote-tracking branch 'refs/remotes/origin/percep/obj-detect' …
jbrhm 94d656a
WIP Working on directories
jbrhm 7edf84a
More Clean up
jbrhm a7cb1b7
Remove starter project changes
jbrhm e840182
Delete starter_project/teleop/src/router/index.js
jbrhm 0ee3f0e
Delete starter_project/teleop/src/index.html
jbrhm 3128092
Delete starter_project/teleop/src/components/MenuButton.vue
jbrhm cd23e4d
Delete starter_project/teleop/src/app.js
jbrhm 0d27810
Delete starter_project/teleop/src/components/Menu.vue
jbrhm a4740a7
Delete starter_project/teleop/src/components/DriveControls.vue
jbrhm 1d403c5
Delete starter_project/teleop/src/App.vue
jbrhm 3624874
Delete starter_project/teleop/package.json
jbrhm 6b105fb
Delete starter_project/teleop/gui_starter.sh
jbrhm 6c71aca
Delete starter_project/teleop/babel.config.js
jbrhm b522f11
Delete starter_project/teleop/README.md
jbrhm 5118686
Delete starter_project/autonomy/config/starter_project.world
jbrhm 407e472
Delete starter_project/autonomy/config/starter_project.rviz
jbrhm f90ef42
Delete starter_project/autonomy/config/soil_normal.png
jbrhm 896b729
Delete starter_project/autonomy/config/soil_base.png
jbrhm 6a49a11
Delete src/perception/tag_detector/zed/tag_detector.threshold.cpp
jbrhm 0f67990
Delete src/preload/format
jbrhm 63f3848
Delete src/perception/tag_detector/zed/tag_detector.processing.cpp
jbrhm 7fc3486
Delete src/perception/tag_detector/zed/tag_detector.hpp
jbrhm 29ac531
Delete src/perception/tag_detector/zed/tag_detector.cpp
jbrhm bf460bc
Delete src/perception/tag_detector/zed/pch.hpp
jbrhm 098f007
Delete config/DetectorParams.cfg
jbrhm 1c188d7
Delete config/navigation.yaml
jbrhm 2872390
Delete config/TagDetectorParams.cfg
jbrhm 921597c
Delete plugins/tag_detector_plugin.xml
jbrhm 087d8a8
Delete scripts/debug_course_publisher.py
jbrhm 85fb4af
Delete src/perception/tag_detector/README.md
jbrhm 9191442
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight 6207ad8
Revert files that should not have been changed
qhdwight cc5b00d
Minor changes
qhdwight 489ffdd
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
umroverPerception e9996e3
Fixed Frames
jbrhm 22852a6
Merge branch 'percep/obj-detect' of github.com:umrover/mrover-ros int…
jbrhm 35f529e
baja.onnx
jbrhm aab6bb0
Merge remote-tracking branch 'origin/integration' into percep/obj-detect
qhdwight eb6781c
Changes from Baja, rename class names to be lowercase, publish to cor…
qhdwight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
text=auto | ||
# Image files | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
# Model files | ||
*.dae filter=lfs diff=lfs merge=lfs -text | ||
*.blend filter=lfs diff=lfs merge=lfs -text | ||
*.stl filter=lfs diff=lfs merge=lfs -text | ||
*.blend filter=lfs diff=lfs merge=lfs -text | ||
# Neural network files | ||
*.pt filter=lfs diff=lfs merge=lfs -text | ||
*.onnx filter=lfs diff=lfs merge=lfs -text | ||
*.engine filter=lfs diff=lfs merge=lfs -text | ||
# Model files | ||
*.glb filter=lfs diff=lfs merge=lfs -text | ||
*.fbx filter=lfs diff=lfs merge=lfs -text | ||
# Packages | ||
*.deb filter=lfs diff=lfs merge=lfs -text | ||
# Program files | ||
ansible/roles/esw/files/bin/fdcanusb_daemon filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
PACKAGE = "mrover" | ||
|
||
from dynamic_reconfigure.parameter_generator_catkin import * | ||
|
||
gen = ParameterGenerator() | ||
|
||
# TODO(percep/obj-detector): add parameters | ||
|
||
exit(gen.generate(PACKAGE, "object_detector", "ObjectDetectorParams")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
<launch> | ||
<arg name="run_tag_detector" default="true" /> | ||
<arg name="run_object_detector" default="true" /> | ||
|
||
<!-- Nodelet to detect AR tags and publish them to the TF tree --> | ||
<node if="$(arg run_tag_detector)" | ||
pkg="nodelet" type="nodelet" name="tag_detector" | ||
pkg="nodelet" type="nodelet" name="zed_tag_detector" | ||
args="load mrover/TagDetectorNodelet nodelet_manager" output="screen" /> | ||
</launch> | ||
|
||
<node if="$(arg run_tag_detector)" | ||
pkg="nodelet" type="nodelet" name="long_range_tag_detector" | ||
args="load mrover/LongRangeTagDetectorNodelet nodelet_manager" output="screen" /> | ||
|
||
<node if="$(arg run_object_detector)" | ||
pkg="nodelet" type="nodelet" name="object_detector" respawn="true" | ||
args="load mrover/ObjectDetectorNodelet perception_nodelet_manager" output="screen" /> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
<!-- Example: --> | ||
<!-- <author email="[email protected]">Jane Doe</author> --> | ||
|
||
|
||
<!-- The *depend tags are used to specify dependencies --> | ||
<!-- Dependencies can be catkin packages or system dependencies --> | ||
<!-- Examples: --> | ||
|
@@ -78,9 +77,10 @@ | |
|
||
<!-- The export tag contains other, unspecified, tags --> | ||
<export> | ||
<nodelet plugin="${prefix}/plugins/tag_detector_plugin.xml" /> | ||
<nodelet plugin="${prefix}/plugins/zed_plugin.xml" /> | ||
<nodelet plugin="${prefix}/plugins/can.xml" /> | ||
<nodelet plugin="${prefix}/plugins/simulator.xml" /> | ||
<nodelet plugin="${prefix}/plugins/tag_detector_plugin.xml"/> | ||
<nodelet plugin="${prefix}/plugins/zed_plugin.xml"/> | ||
<nodelet plugin="${prefix}/plugins/can.xml"/> | ||
<nodelet plugin="${prefix}/plugins/simulator.xml"/> | ||
<nodelet plugin="${prefix}/plugins/object_detector_plugin.xml"/> | ||
</export> | ||
</package> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<library path="lib/libobject_detector_nodelet"> | ||
<class name="mrover/ObjectDetectorNodelet" | ||
type="mrover::ObjectDetectorNodelet" | ||
base_class_type="nodelet::Nodelet"> | ||
</class> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pynput import keyboard | ||
|
||
import rospkg | ||
|
||
import os | ||
|
||
# python linear algebra library | ||
import numpy as np | ||
|
||
# library for interacting with ROS and TF tree | ||
import rospy | ||
|
||
import cv2 | ||
|
||
import datetime | ||
|
||
|
||
# ROS message types we need to use | ||
from sensor_msgs.msg import Image | ||
|
||
|
||
def on_press(key): | ||
if key == keyboard.Key.enter: | ||
msg = rospy.wait_for_message("/camera/left/image", Image, timeout=5) | ||
data = np.empty(msg.height * msg.width * 4, dtype=np.uint8) | ||
for x in range(msg.height * msg.width * 4): | ||
data[x] = msg.data[x] | ||
|
||
image = np.reshape(data, [msg.height, msg.width, 4]) | ||
unique_id = "{date:%Y-%m-%d_%H:%M:%S}".format(date=datetime.datetime.now()) | ||
rospack = rospkg.RosPack() | ||
pkgPath = rospack.get_path("mrover") | ||
imagePath = pkgPath + f"/data/Images" | ||
if not os.path.exists(imagePath): | ||
os.mkdir(imagePath) | ||
|
||
print(cv2.imwrite(imagePath + f"image_{unique_id}.jpg", image)) | ||
|
||
|
||
def on_release(key): | ||
while False: | ||
continue | ||
|
||
|
||
class image_capturepy: | ||
def __init__(self): | ||
while False: | ||
continue | ||
|
||
|
||
def main(): | ||
# initialize the node | ||
rospy.init_node("image_capturepy") | ||
|
||
listener = keyboard.Listener(on_press=on_press, on_release=on_release) | ||
listener.start() | ||
|
||
# let the callback functions run asynchronously in the background | ||
rospy.spin() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
what is this script for?
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.
That script is used for taking pictures through the zed. Could probably be removed from this commit because it has certain things specific to my machine.
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.
maybe just remove your personal file path and move it to the scripts folder
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.
Theres also an import
from pynput.keyboard import Key, Controller
that I think is a package specific to my machine. Its necessary to kill the thread, and I'm not sure how you feel about leaving that in here.