-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
258 unregistering manipulators existential error (#359)
* Reset with new CLI parser * Start main * CLI * GUI * Create base commands * Color print error * Make console global * Get positions * Move ABC to util, made helper for exception printing * Implemented the rest except for movement * Implement set_position? * Implement depth * Create platform type getter * uMp-4 bindings * Fix try-except styling, instantiate PlatformHandler * Moved console instance to common, prep for fake platform binding * Remove call to super in Bindings init (there is no super init) * Fake manipulator bindings * Fixed Ruff errors, started server * Connection and disconnection * Use global console * Import console only when available * Get binaries in, need to find solution to global console * Fix console and other IDE issues * Started implementing commands * Helper validation functions (types aren't checking right) * Launch, need to change catch all handler * Fixed catch all, need to test * Test movement * Fix match platform typing * Add type checking to CI * Switch to static port 3000 * Verify async request handling * Repeated prints, will be replaced with rich later * Add debug checkmark to GUI * Version bump * Fixed ump-4 position reporting * Verify stop * Version bump to beta * Auto format code * Static analysis fix --------- Co-authored-by: kjy5 <[email protected]>
- Loading branch information
Showing
35 changed files
with
1,305 additions
and
2,674 deletions.
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
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
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 |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import json | ||
from asyncio import run | ||
|
||
import socketio | ||
from vbl_aquarium.models.ephys_link import GotoPositionRequest | ||
from vbl_aquarium.models.unity import Vector4 | ||
|
||
if __name__ == "__main__": | ||
sio = socketio.Client() | ||
sio.connect("http://localhost:8081") | ||
from ephys_link.back_end.platform_handler import PlatformHandler | ||
from ephys_link.util.console import Console | ||
|
||
sio.emit("register_manipulator", "6") | ||
sio.emit("bypass_calibration", "6") | ||
sio.emit("set_can_write", json.dumps({"manipulator_id": "6", "can_write": True, "hours": 0})) | ||
c = Console(enable_debug=True) | ||
p = PlatformHandler("ump-4", c) | ||
target = Vector4() | ||
# target = Vector4(x=10, y=10, z=10, w=10) | ||
|
||
end = "" | ||
while end == "": | ||
sio.emit("goto_pos", json.dumps({"manipulator_id": "6", "pos": [0, 10, 10, 10], "speed": 0.5})) | ||
|
||
input("Press enter to continue...") | ||
|
||
sio.emit("goto_pos", json.dumps({"manipulator_id": "6", "pos": [10, 10, 10, 10], "speed": 1})) | ||
|
||
end = input("Press enter to continue (or type any key then enter to end)...") | ||
print(run(p.set_position(GotoPositionRequest(manipulator_id="6", position=target, speed=5))).to_string()) | ||
print("Done!") |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from time import sleep | ||
|
||
from socketio import SimpleClient | ||
from vbl_aquarium.models.ephys_link import DriveToDepthRequest, InsideBrainRequest | ||
from vbl_aquarium.models.unity import Vector4 | ||
|
||
with SimpleClient() as sio: | ||
sio.connect("http://localhost:3000") | ||
|
||
print(sio.call("set_inside_brain", InsideBrainRequest(manipulator_id="6", inside=True).to_string())) | ||
|
||
target = Vector4() | ||
# target = Vector4(x=10, y=10, z=10, w=10) | ||
|
||
sio.emit( | ||
"set_depth", | ||
DriveToDepthRequest(manipulator_id="6", depth=10, speed=3).to_string(), | ||
) | ||
sleep(1) | ||
print(sio.call("stop")) | ||
# while True: | ||
# print(sio.call("get_position", "6")) | ||
sio.disconnect() |
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 +1 @@ | ||
__version__ = "1.3.3" | ||
__version__ = "2.0.0b0" |
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
Empty file.
Oops, something went wrong.