Code: Select all
function sysCall_thread()
robotCollection=sim.createCollection()
sim.addItemToCollection(robotCollection,sim.handle_tree,simBase,0)
end
function configurationValidationCallback(config)
-- check if a configuration is valid, i.e. doesn't collide
-- save current config:
local tmp=getConfig()
-- apply new config:
setConfig(config)
-- does new config collide?
local res=sim.checkCollision(robotCollection,sim.handle_all)
-- restore original config:
setConfig(tmp)
return res==0
end