From c22a740e1394392e916bf6610282a27e4ca4b2da Mon Sep 17 00:00:00 2001 From: ketrptr Date: Fri, 28 Mar 2025 17:11:49 +0100 Subject: [PATCH] test --- __pycache__/meControll.cpython-313.pyc | Bin 3535 -> 3614 bytes meControll.py | 1 + servoTest/servoTest.ino | 4 +-- testSequence1 | 2 ++ testSequence1.py | 35 +++++++++++++++++++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 testSequence1 create mode 100644 testSequence1.py diff --git a/__pycache__/meControll.cpython-313.pyc b/__pycache__/meControll.cpython-313.pyc index 3004f9940a2789f1626a10e508146d3de0424b2f..c1a97bef391d828a7085643294468a67c5f54644 100644 GIT binary patch delta 207 zcmX>vJx_-3GcPX}0}!YmeU>i3zLBquo$=Y^sq8x^&tX^K4`pNpN|`c(6fiKTO!nuf zVoaEPio;X#BP)Z5@)tG+0pSTI)2$|2%}AbTf0@@?&RRxBoy}9ZCNi?Jv#NX* znXJv@&B6Vd31~vF;pB22CC1N_XYok!vK6@kg^Jujg!|+@JmprtKqknp;w~WZftit! u@iqhRT?Vo5Y=(>q9~pqehb%@07M_l(%gmCuxU3tTZgHi62bKETr zid=vkP1Yh;AXVfrnVYxV${WaJ1S#nP5+9fu85wUg@ZMz*`_5*-sPK^iNPNg(WMJXx YsJhH7d5g=s!RZ!PEQm0fyoWal02t{od;kCd diff --git a/meControll.py b/meControll.py index eb756a7..e73b573 100644 --- a/meControll.py +++ b/meControll.py @@ -38,6 +38,7 @@ class meArm: for cmd in self.moves[idx]: print(f"sending: {cmd}") self.sendCmd(cmd) + return len(self.moves[idx]) def getPos(self): diff --git a/servoTest/servoTest.ino b/servoTest/servoTest.ino index 6aff4fa..02e91d4 100644 --- a/servoTest/servoTest.ino +++ b/servoTest/servoTest.ino @@ -55,7 +55,7 @@ void movePos(CMD dir) { int delta = servoPos[dir] - val; int inc; while (delta) { - if(dir!=T) inc = (abs(delta) > 20) ? constrain((abs(delta) / 10), 1, 10) : 1; + if(dir!=T) inc = (abs(delta) > 20) ? constrain((abs(delta) / 10), 1, 5) : 1; else inc =1; if (delta > 0) { axis[dir]->write(val + inc); @@ -67,7 +67,7 @@ void movePos(CMD dir) { val -= inc; } - delay(30); // TODO no delay + delay(20); // TODO no delay } } } diff --git a/testSequence1 b/testSequence1 new file mode 100644 index 0000000..8877192 --- /dev/null +++ b/testSequence1 @@ -0,0 +1,2 @@ +from meController import meArm + diff --git a/testSequence1.py b/testSequence1.py new file mode 100644 index 0000000..ed57849 --- /dev/null +++ b/testSequence1.py @@ -0,0 +1,35 @@ +import meControll + +arm = meControll.meArm() + + +arm.getPos() + + +getCube1 = [b'S1', b'T50', b'R100', b'L50', b'R120', b'L30', b'R140', b'G180', b'R100'] +getCube2 = [b'S1', b'T50', b'R100', b'L50', b'R120', b'L30', b'R140', b'L20', b'R160', b'G180', b'R100'] +gotoDropoff = [b'S1', b'T140', b'R100', b'L40', b'R145', b'G90', b'R100', b'D1'] +gotoDropoff2 = [b'S1', b'T140', b'R100', b'L50', b'R133', b'G90', b'R100', b'D1'] + +gotoCubePickup0 = getCube1[0:-2] + +saveHome = [b'S0', b'R-30', b'D1', b'S1'] + +# getCube2 = [b'S1', b'T140', b'R100', b'L40', b'R145', b'G180', b'R100', b'D1'] + +arm.addMove(getCube1) +arm.addMove(gotoDropoff) +arm.addMove(getCube2) +arm.addMove(gotoDropoff2) +arm.addMove(gotoCubePickup0) +arm.addMove(saveHome) +print(f"Homing") +arm.execMove(5) +print(f"Move0: {arm.execMove(0)} moves") +print(f"Move1: {arm.execMove(1)} moves") +print(f"Move2: {arm.execMove(2)} moves") +print(f"Move3: {arm.execMove(3)} moves") +print(f"Move4: {arm.execMove(4)} moves") +# arm.execMove(2) + +