Typically: "How do I... ", "How can I... " questions
Bellinsbauer
Posts: 21
Joined: 22 Apr 2018, 07:44

Hello,
I'm using the sim.rmlPos function for my task and one of its input is "maxVelAccelJerk".
In my script i defined this as:

Code: Select all

local maxVelAccelJerk={0.2,0.2,0.2,0.4,0.4,0.4,0.6,0.6,0.6}
The values inside should be in rad/s, rad/s^2 and rad/s^3. In this way the maximum values for velocity , acceleration and jerk should be 11.46 °/sec, 22.92 °/sec^2 and 34.37 °/sec^3. But when I plot the graph based on the velocity it shows values higher then those mentioned before. And I'm wondering why.
I post here my scene
https://www.dropbox.com/s/klgdskyf5226t ... 1.ttt?dl=0

Kind regards,
Leonardo.

coppelia
Posts: 7400
Joined: 14 Dec 2012, 00:25

Hello,

this should not happen. It is difficult to read through your code, but try some more simple examples maybe. Did you have a look at this demo scene?

Cheers

Bellinsbauer
Posts: 21
Joined: 22 Apr 2018, 07:44

Yes, I saw it several times before doing what I posted.
It's really strange, because I cannot understand what is going on. Do you have any advices? Or any idea on how to solve it?

Bellinsbauer
Posts: 21
Joined: 22 Apr 2018, 07:44

And one more question:
in RMLExamples.ttt, joint2 has this script:

Code: Select all

function sysCall_threadmain()
h=sim.getObjectAssociatedWithScript(sim.handle_self)

rmlObject=sim.rmlPos(1,0.0001,-1,{0,0,0},{maxVel,maxAccel,maxJerk},{1},{180*math.pi/180,0,0})

result=0
while result==0 do
result,newPosVelAccel=sim.rmlStep(rmlObject,sim.getSimulationTimeStep())
if result~=-1 then
sim.setJointPosition(h,newPosVelAccel[1]) -- or sim.setJointTargetPosition, depending on the joint mode
end
end

sim.rmlRemove(rmlObject)
end
sim.setJointPosition is used if the joint is in passive mode. sim.setJointTargetPosition is used if the joint is in force/torque mode. If my joint is in inverse kinematics mode what should i use? I used sim.setObjectPosition in order to move the target in the direction of the object which should i reach. Is it correct?

coppelia
Posts: 7400
Joined: 14 Dec 2012, 00:25

Yes, typically you would change the position of the IK target object (i.e. a dummy) via sim.setObjectPosition.

Cheers

Bellinsbauer
Posts: 21
Joined: 22 Apr 2018, 07:44

Thanks.
And what about the issue before? The one related with the maximum vel, accel and jerk? Any suggestions?

coppelia
Posts: 7400
Joined: 14 Dec 2012, 00:25

Please try provide a minimalistic example that illustrates your problem. We cannot afford to debug complex code / scenes of others.

Cheers

Bellinsbauer
Posts: 21
Joined: 22 Apr 2018, 07:44

I commented each single line of my code and I deleted what is useless. Now, it should be much clearer.
The script is divided in two parts which make the same things but for different purposes. In the first part the Scara goes to pick up the object with the minimum actuation time. In the second part the Scara goes to the second convejor belt to deposit its object with the minimum actuation time again.

https://www.dropbox.com/s/0ot4wpqddjx34 ... 1.ttt?dl=0

Hope it could be easier now for you to understand.

Bellinsbauer
Posts: 21
Joined: 22 Apr 2018, 07:44

I made a simpler example as you suggested. Here there are just two joints, the object doesn't move along a convejor belt and I use the inverse kinematics and I still have the same problem. I set the maximum velocity as 0.05 rad/s for both joints and the graph shows that the joints velocities exceed this value.

https://www.dropbox.com/s/x21ugdb18oxjz ... s.ttt?dl=0

coppelia