Wondering if I should play with gripper angle or open close?
Yes, that’s a good idea.
You could also try making the arm go lower or higher. You can find that part of the code here:
x = params["baseradius"] + params["cbFrame"] + params["sqSize"] * sqNumber - params["sqSize"]*1/2
y = params["sqSize"] * sqletter - copysign(params["sqSize"]*1/2,sqletter)
return(x,y)
def executeMove(move, params, color, homography, cap, selectedCam):
allMotors.setColorLED(lssc.LSS_LED_Cyan)
z = params["cbHeight"] + params["pieceHeight"]
angles_rest = (0,-1155,450,1050,0)
gClose = -2
gOpen = -9.5
goDown = 0.6*params["pieceHeight"]
gripState = gOpen
x, y = 0, 0
for i in range(0,len(move),2):
# Calculate position and FPC
x0, y0 = x, y
x, y = CBtoXY((move[i],move[i+1]), params, color)
# Go down
shoulder.setFilterPositionCount(15)
elbow.setFilterPositionCount(15)
angles_BSEWG2 = LSS_IK([x, y, z - 1 - goDown, gripState])
print("2) GO DOWN")
arrived2,issue2 = LSSA_moveMotors(angles_BSEWG2)
askPermision(angles_BSEWG2, arrived2, issue2, homography, cap, selectedCam)
if (i/2)%2: # Uneven move (go lower to grab the piece)
gripState = gOpen
goDown = 0.6*params["pieceHeight"]
else: # Even move (go a little higher to drop the piece)
gripState = gClose
goDown = 0.5*params["pieceHeight"]
# Close / Open the gripper
gripper.moveCH(int(gripState*10), 500)
time.sleep(1)
print("3) CLOSE/OPEN the gripper\n")
# Go up
Thanks Geraldine. Will try.
I have posted a video of the Chess Robot in Linkdin. Opened the gripper and it is better now. Still work to be done but happy with progress so far.
1 Like
Appreciate the video! I thought pawns could only move forward by one space?
Someone’s idea of adding magnets underneath seems quite good to re-center each piece.
1 Like
Opened the gripper and it is better now.
Awesome! Looks great with the eyes
I thought pawns could only move forward by one space?
They can move two spaces on their first move
1 Like