Page 1 of 2

Posted: 08 Aug 2018, 12:23
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.

Posted: 08 Aug 2018, 18:38
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

Posted: 08 Aug 2018, 20:14
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?

Posted: 09 Aug 2018, 08:41
And one more question:
in RMLExamples.ttt, joint2 has this script:

Code: Select all

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?

Posted: 09 Aug 2018, 11:00
Yes, typically you would change the position of the IK target object (i.e. a dummy) via sim.setObjectPosition.

Cheers

Posted: 09 Aug 2018, 12:55
Thanks.
And what about the issue before? The one related with the maximum vel, accel and jerk? Any suggestions?

Posted: 09 Aug 2018, 12:59
Please try provide a minimalistic example that illustrates your problem. We cannot afford to debug complex code / scenes of others.

Cheers

Posted: 10 Aug 2018, 08:56
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.