diff --git a/Control System/Propioception.py b/Control System/Propioception.py index ea65c47..4676e09 100644 --- a/Control System/Propioception.py +++ b/Control System/Propioception.py @@ -132,78 +132,78 @@ class Propioception: return 1 -# Test -stuff = Propioception( - left_hip_pitch= 0, - left_hip_yaw= 0, - left_hip_roll= 0, - left_knee_pitch= 0, - left_ankle_pitch= 0, - left_ankle_yaw= 0, - left_ankle_roll= 0, - right_hip_pitch= 0, - right_hip_yaw= 0, - right_hip_roll= 0, - right_knee_pitch= 0, - right_ankle_pitch= 0, - right_ankle_yaw= 0, - right_ankle_roll= 0, - left_shoulder_pitch= 0, - left_shoulder_yaw= 0, - left_shoulder_roll= 0, - left_elbow_pitch= 0, - right_shoulder_pitch= 0, - right_shoulder_yaw= 0, - right_shoulder_roll= 0, - right_elbow_pitch= 0, - torso_pitch= 0, - torso_yaw= 0, - torso_roll= 0, - neck_pitch= 0, - neck_yaw= 0, - neck_roll= 0 - ) +# # Test +# stuff = Propioception( +# left_hip_pitch= 0, +# left_hip_yaw= 0, +# left_hip_roll= 0, +# left_knee_pitch= 0, +# left_ankle_pitch= 0, +# left_ankle_yaw= 0, +# left_ankle_roll= 0, +# right_hip_pitch= 0, +# right_hip_yaw= 0, +# right_hip_roll= 0, +# right_knee_pitch= 0, +# right_ankle_pitch= 0, +# right_ankle_yaw= 0, +# right_ankle_roll= 0, +# left_shoulder_pitch= 0, +# left_shoulder_yaw= 0, +# left_shoulder_roll= 0, +# left_elbow_pitch= 0, +# right_shoulder_pitch= 0, +# right_shoulder_yaw= 0, +# right_shoulder_roll= 0, +# right_elbow_pitch= 0, +# torso_pitch= 0, +# torso_yaw= 0, +# torso_roll= 0, +# neck_pitch= 0, +# neck_yaw= 0, +# neck_roll= 0 +# ) -"""Update cases""" -# Success case -print(stuff.data['neck_roll']) -stuff.update({'neck_roll': 21}) -print(stuff.data['neck_roll']) +# """Update cases""" +# # Success case +# print(stuff.data['neck_roll']) +# stuff.update({'neck_roll': 21}) +# print(stuff.data['neck_roll']) -# -1 case -print(stuff.update(None)) - -# -2 case -print(stuff.update([])) - -# -3 case -print(stuff.update({'test': 21})) - -"""Remove cases""" -# Success case -print(stuff.data['neck_roll']) -print(stuff.remove(['neck_roll'])) - -# -1 case -print(stuff.remove(None)) +# # -1 case +# print(stuff.update(None)) # # -2 case -print(stuff.remove({})) +# print(stuff.update([])) -# -3 case -print(stuff.remove(['test'])) +# # -3 case +# print(stuff.update({'test': 21})) -"""Add cases""" -# Success case -print('test' in stuff.data.keys()) -stuff.add({'test': 21}) -print(stuff.data['test']) +# """Remove cases""" +# # Success case +# print(stuff.data['neck_roll']) +# print(stuff.remove(['neck_roll'])) -# -1 case -print(stuff.add(None)) +# # -1 case +# print(stuff.remove(None)) -# -2 case -print(stuff.add([])) +# # # -2 case +# print(stuff.remove({})) -# -3 case -print(stuff.add({'test': 21})) \ No newline at end of file +# # -3 case +# print(stuff.remove(['test'])) + +# """Add cases""" +# # Success case +# print('test' in stuff.data.keys()) +# stuff.add({'test': 21}) +# print(stuff.data['test']) + +# # -1 case +# print(stuff.add(None)) + +# # -2 case +# print(stuff.add([])) + +# # -3 case +# print(stuff.add({'test': 21})) \ No newline at end of file diff --git a/Control System/__pycache__/bootup.cpython-38.pyc b/Control System/__pycache__/bootup.cpython-38.pyc new file mode 100644 index 0000000..8af6431 Binary files /dev/null and b/Control System/__pycache__/bootup.cpython-38.pyc differ diff --git a/Control System/bootup.py b/Control System/bootup.py index 4708284..d92276b 100644 --- a/Control System/bootup.py +++ b/Control System/bootup.py @@ -4,6 +4,9 @@ # 1 for reading sensor data # Updates sensor data through wifi and propiosense system # 1 for executing the first action in the priority queue + +from Propioception import * + import threading import socket import heapq @@ -54,16 +57,14 @@ class Receiver: print("Inside execute",self.actions) def sensorData(self): - print("Test") + # Test + # Read from Arduinos to know what motors and sensors there are def runSimul(self): threading.Thread(target=self.priorityQueue).start() threading.Thread(target=self.execute()).start() threading.Thread(target=self.sensorData()).start() -def main(): +def startBoot(): simulation = Receiver('10.235.1.127',12345) simulation.runSimul() - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Control System/instructions.py b/Control System/instructions.py index da3caff..3d38c27 100644 --- a/Control System/instructions.py +++ b/Control System/instructions.py @@ -1,3 +1,4 @@ # Use methods online to dehash data packages/ instructions # Add instruction to priority queue +def readInstruction \ No newline at end of file diff --git a/Control System/main.py b/Control System/main.py new file mode 100644 index 0000000..4701413 --- /dev/null +++ b/Control System/main.py @@ -0,0 +1,8 @@ +import sys +from bootup import * + +def main(): + startBoot() # when Olympian is booted up for first time + +if __name__ == "__main__": + main() \ No newline at end of file