I can't drive my robot arm by thread script

Typically: "How do I... ", "How can I... " questions
Post Reply
xiemzuo
Posts: 10
Joined: 29 Nov 2017, 01:52

I can't drive my robot arm by thread script

Post by xiemzuo »

Hello

I'm trying to drive my by using the following code(It is a thread script):

Code: Select all

-- Set-up some of the RML vectors:
vel=20
accel=10
jerk=10
currentVel={0,0,0,0}
currentAccel={0,0,0,0}
maxVel={vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180}
maxAccel={accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180}
maxJerk={jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180}
targetVel={0,0,0,0}

targetPos1={90*math.pi/180,60*math.pi/180,90*math.pi/180,-90*math.pi/180}
simRMLMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos1,targetVel)

targetPos2={-90*math.pi/180,-60*math.pi/180,-90*math.pi/180,90*math.pi/180}
simRMLMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos2,targetVel)

targetPos3={0,0,0,0}
simRMLMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos3,targetVel)
I did this as the "PhantomXPincher",but i can't control it.Can you tell me what's wrong with mine.
This is my file "https://1drv.ms/u/s!AmNQPbMfN-sCapGY7IhuumVKyLc"
Thank you very much
Mingzuo

coppelia
Site Admin
Posts: 10360
Joined: 14 Dec 2012, 00:25

Re: I can't drive my robot arm by thread script

Post by coppelia »

Hello,

first of all, make sure your robot is stable and behaves correctly when passive. This is not at all the case in your situation: the various links collide with each other, and the masses/inertias of the various links is not correct. Make sure to carefully read this page, mainly design considerations 1, 2, 3, 7 and 8. Also, this tutorial might be helpful.

Cheers

Post Reply