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

Control missile launcher from terminal #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

kennyhei
Copy link

New, simple file turret.py created for controlling the missile launcher from terminal. File takes two arguments: command (left, right, up, down or fire) and duration of the movement in milliseconds.

@Mrjohns42
Copy link

Pretty sure audio won't work when you shoot a missile. 2 reasons:

  1. You call setSound() after you call turretFire().
  2. You create a new instance of launchControl() everytime you call one of it's methods. So even if you moved launchControl().setSound(True) before launchControl().turretFire(), you're still calling the two functions from different instances.

@kennyhei
Copy link
Author

kennyhei commented Sep 8, 2013

True, I removed everything related to the sound. The idea was that you give the program one command, it executes it and the program quits. A friend of mine wanted it like this because he wants to be able to control the turret from his website by sending HTTP requests to a server which contains turret.py and other necessary files/installations.

I don't have much experience of Python, so you can close this if you want, I don't mind!

@Mrjohns42
Copy link

I actually did the same thing, but in a slightly different way. I keep the turret control program open and running on the server. My version of the program listens to STDIN for single characters corresponding to commands to move (W,A,S,D) or fire (F) the turret.

I prefer it this way for a number of reasons:

  1. You eliminate delay from the overhead of opening and closing the program every time you move the turret.
  2. You don't have to keep opening and closing the driver file.
  3. You can do commands that involve multiple movements, like "reset to center position".
  4. In addition to working with our server setup, you can run the exact same program on your own personal computer connected to the turret and have interactive control of it.

Check out my repository if you'd like to see the code.

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.

2 participants