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

Add new main module #3

Open
wants to merge 2 commits into
base: Interfacing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions emulator.py

This file was deleted.

46 changes: 0 additions & 46 deletions navsystem.py

This file was deleted.

63 changes: 63 additions & 0 deletions new/MainModule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import sys, termios, tty, os, time

def getch():
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)

finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

def manual_mode():
button_delay = 0.2
print("program started")
while(True):
char = getch()

if (char == "a"):
print("left")
time.sleep(button_delay)

if (char == "s"):
print("back")
time.sleep(button_delay)

elif (char == "d"):
print("right")
time.sleep(button_delay)

elif (char == "w"):
print("forward")
time.sleep(button_delay)

elif (char == "p"):
print("up")
time.sleep(button_delay)

elif (char == "l"):
print("down ")
time.sleep(button_delay)

elif (char == "0"):
break

def main():
while(True):
print("what mode to run? Auto or Manual")
x = input()
if x=="Auto":
print("auto mode selected.")
#put auto mode function here.
if x== "Manual":
manual_mode()






if __name__ == "__main__":
main()
77 changes: 0 additions & 77 deletions pathplanner.py

This file was deleted.

62 changes: 0 additions & 62 deletions pathplanning.py

This file was deleted.

Loading