meaning of inData and outData of sysCall_jointCallback function?

Typically: "How do I... ", "How can I... " questions
Post Reply
Jinhyeok
Posts: 4
Joined: 29 May 2019, 16:53

meaning of inData and outData of sysCall_jointCallback function?

Post by Jinhyeok » 06 Jun 2019, 15:52

Hello, all.
For now, I'm trying to implement sysCall_jointCallback function without remoteAPI.
Here's my code of sysCall_jointCallback.

Code: Select all

function sysCall_jointCallback(inData)   
    inData.handle = joint1_h
    if inData.first then
        print('Joint callback function has called')
    end
    
    local max_vel = 99999
    inData.targetVel = max_vel
    inData.velUpperLimit = max_vel
    inData.maxForce = 10
    local forceOrTorqueToApply=inData.maxForce -- the maximum force/torque that the joint will be able to exert

    -- 5. Following data must be returned to V-REP:
    firstPass=false
    local outData={}
    outData.velocity=maxVelocity
    outData.force=forceOrTorqueToApply
    return outData
end
On the initialization, I have defined handle for joint 1.

Code: Select all

function sysCall_init()
    joint1_h = sim.getObjectHandle('LBR4p_joint1')
end
Even if I defined my maxForce and forceOrTorqueToApply on outData, it seems that my manipulator doesn't move.
As a debugging, I have checked if my jointCallback function works by using print function. It worked!

Is there anything to do after setting my OutData to move my manipulator?
Thanks for your help, in advance.

PS) my joint1 is set as 'Motor_enabled' and 'Control loop enabled' to use jointCallback function.


Sincerely, Jinhyeok

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

Re: meaning of inData and outData of sysCall_jointCallback function?

Post by coppelia » 14 Jun 2019, 12:19

Hello,

what happens if you hard-code the max. force/torque and joint target velocity in the joint callback function? Does it work then?
Can you post a simple scene that illustrates your problem?

Cheers

Post Reply