Hi Coppelia,
Thank you for your response.
But it appears that your response does not really address my concern.
For instance, customization script does not work since I only want to set simulation parameters (e.g. speed of a robot) at the the instant that I run sim.startSimulation() and not some static scene or model parameter. (
Note: I tried moving the signal code shown later below in the child script into the sysCall_init() function of the customization script of the robot, but it had no effect.)
I also tried using signal in the sysCall_init() function to get some certain value from an external script thus:
External script
Code: Select all
sim.startSimulation() #I wan to set the following values exactly at the point of starting the simulator
sim.setInt32Signal("waitTimeRobot", timestep)
sim.setFloatSignal("velRobot", vel)
Robot Child script
Code: Select all
local waitTimeRobot = sim.getInt32Signal("waitTimeRobot")
waitTime = waitTimeRobot
local speedRobot = sim.getFloatSignal("velRobot")
speed = speedRobot
Now what I noticed is this; when I use signals for setting the variables of interest in the sysCall_init(), it works but unfortunately the sysCall_actuation() would have already started, thereby returning an error at this point in my actuation function:
Code: Select all
if counter < waitTimeRobot then --this is line 90
counter = counter + 1
end
An example error is this:
[LBR_iiwa_7_R800@childScript:error] [string "LBR_iiwa_7_R800@childScript"]:90: attempt to compare number with nil
stack traceback:
[string "LBR_iiwa_7_R800@childScript"]:90: in function 'sysCall_actuation'
So please could you point me to an example to explain to me how I really can do this?