Skip to content

Commit

Permalink
Movement tester (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjy5 authored Feb 14, 2024
1 parent 1ef4db8 commit 553a8c7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Empty file added scripts/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions scripts/move_tester.py
Original file line number Diff line number Diff line change
@@ -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)...")

0 comments on commit 553a8c7

Please sign in to comment.