From 86219c72e88592e9916ba7ec164380432dfa49bb Mon Sep 17 00:00:00 2001 From: RyandPark2006 <> Date: Sun, 23 Jan 2022 21:46:29 +0000 Subject: [PATCH] Control System Update --- Control System/Propioception.py | 132 +++++++++--------- .../__pycache__/bootup.cpython-38.pyc | Bin 0 -> 2088 bytes Control System/bootup.py | 11 +- Control System/instructions.py | 1 + Control System/main.py | 8 ++ 5 files changed, 81 insertions(+), 71 deletions(-) create mode 100644 Control System/__pycache__/bootup.cpython-38.pyc create mode 100644 Control System/main.py 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 0000000000000000000000000000000000000000..8af64318673cf119798e6dbde1f1bc97dd2c735f GIT binary patch literal 2088 zcmZuyOK%%D5GMDfl`N~aQ#eJ@1VT{+&>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W^q)YcX+0~4z~X<9*9HT!t50?4}2IpCt#g5Li$+{*Ri1V zp_)3!K>UPL5N&Yq!>M1rvT^P6FE*}jT)p;X`W3*^a;!o{X0&)z)8ujdz6V>iLEFa9 z;}&E!0hR$>>JnzufhHzJ_F4d|kBK4|?EZpp)>T^p!f$3_x=AHu?j;_1=rp$e1C5Q> AIsgCw literal 0 HcmV?d00001 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