Ruckig Online generator

Typically: "How do I... ", "How can I... " questions
Post Reply
abrarMahrous
Posts: 7
Joined: 04 Jun 2024, 10:04

Ruckig Online generator

Post by abrarMahrous »

I am trying to use Ruckig online generator on a 6DOF robot manipulator
I want to set a maximum velocity, acceleration and jerk for each joint

but i am struggeling to understand sim.ruckigPos() function

Code: Select all

int handle = sim.ruckigPos(int dofs, float baseCycleTime, int flags, float[] currentPosVelAccel, 
                           float[] maxVelAccelJerk, int[] selection, float[] targetPosVel)
it gives the following error when I try to set the n dofs to 6 and give it a list of the jerk, velocity and acceleration values

Code: Select all

sim.ruckigPos: incorrect table size. 

here's how i wrote the fuction

Code: Select all

        
        posVelAccel={0,0,0,0,0,0}
        targetPosVel={lengths[#lengths],0}
        rmlHandle=sim.ruckigPos(6,0.0001,-1,posVelAccel,{maxVel,maxAccel,maxJerk},{1,1,1,1,1,1},targetPosVel)
and hers the valeos send to it

Code: Select all

  
    local vel=110   
    local accel=40
    local jerk=80


    local maxVel={vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180}
    local maxAccel={accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180}
    local maxJerk={jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180}

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

Re: Ruckig Online generator

Post by coppelia »

Hello,

sorry for the late reply. Your values need to be all consecutive, e.g.:

Code: Select all

instead of:
{maxVel1, ..., maxVelN}, {maxAccel1, ..., maxAccelN}, {maxJerk1, ..., maxJerkN}

it should be:
{maxVel1, ..., maxVelN, maxAccel1, ..., maxAccelN, maxJerk1, ..., maxJerkN}
Also, posVelAccel should contain 18 values, not 6

Cheers
Post Reply