diff --git a/pyproject.toml b/pyproject.toml index b0ab101..550d4a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,7 @@ python = "3.12" dependencies = [ "coverage[toml]>=6.5", "pytest", + "python-socketio[client]==5.11.1", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/scripts/move_tester.py b/scripts/move_tester.py new file mode 100644 index 0000000..4c546b5 --- /dev/null +++ b/scripts/move_tester.py @@ -0,0 +1,21 @@ +import json + +import socketio + +if __name__ == "__main__": + sio = socketio.Client() + sio.connect("http://localhost:8081") + + 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})) + + 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)...")