I'm working on a project that involves with quadricopters and I'm having trouble running multiple quadricopters simultaneously with a path. One of the quadricopter follows the path, but the other one doesn’t. I need help to make it so that multiple quadricopters move along the path simultaneously when the simulation is running. Here I have provided a screenshot and the scripts for each quadricopter to follow a path.
The quadricopter #0 on the left doesn't move because it says:
3: Object does not exist. (in function 'sim.getObjectHandle')
stack traceback:
[C]: in function 'getObjectHandle'
[string "Quadricopter_target#0@childScript"]:3: in function <[string "Quadricopter_target#0@childScript"]:1>
The quadricpoter in the middle does move with a path.
The screenshot of the quadricopters is here: https://ibb.co/XxFMdny
Script for Quadricopter_target (middle, moves along the path)
Code: Select all
function sysCall_threadmain()
target=sim.getObjectAssociatedWithScript(sim.handle_self)
path=sim.getObjectHandle("Path")
sim.followPath(target,path,1,0,0.3,15)
end
function sysCall_cleanup()
-- Put some clean-up code here
end
-- See the user manual or the available code snippets for additional callback functions and details
Script for Quadricopter_target#0 (left, doesn’t move along the path due to sim.getObjectHandle)
Code: Select all
function sysCall_threadmain()
target=sim.getObjectAssociatedWithScript(sim.handle_self)
path=sim.getObjectHandle("Path0")
sim.followPath(target,path,2,0,0.3,15)
end
function sysCall_cleanup()
-- Put some clean-up code here
end
-- See the user manual or the available code snippets for additional callback functions and details