Thanks to your help, we succeed in reproducing our factory case in V-REP !
It pick Cans from a Conveyor Belt (the cans are automatically generated) and store them on automatically generated cardboard.
Each object (Producer, Conveyor, ...) has its own script and we now want to centralized everything on a controller which aims to be the master which call functions from each script.
I'm currently struggling with the use of
sim.callScriptFunction
=>My controller's Threaded child script need to call a function from my producer's non-threaded child
The function to call is the following (and is written directly in the script associated to the object "Producer_plate"
Code: Select all
function gen_dummies(h,grid_shape,plate_shape,can_shape)
print("I'm Here")
# SOME STUFF WHICH IS WORKING WHEN DIRECTLY CALLED FROM THE SCRIPT
return list_handle_dummies
end
and I'm calling it this way from my controller Threaded Child
Code: Select all
prod_p = sim.getObjectHandle("Producer_plate")
prod_p_script = sim.getScriptAssociatedWithObject(prod_p)
handle_ready_plate = sim.getScriptSimulationParameter(cvfill_script, "objectHandle")
print(prod_p,handle_ready_plate,grid_shape,plate_shape,can_shape)
list_handle_dummies=sim.callScriptFunction("gen_dummies@Producer_plate",prod_p_script,handle_ready_plate,grid_shape,plate_shape,can_shape)
It result to the error
[string "CHILD SCRIPT Controller"]:75: Failed calling script function. (sim.callScriptFunction)
Can you explain me where I miss-use the function ? Is this a way to "allow" the access to the function that I forgot ?
Merci d'avance / Thank you in advance
Cheers