Code: Select all
pathLength = sim.getPathLength(path)
Additionally, I created the tip and the target for path following, but the tip did not follow the trajectory.
Here is my code for one of the targets:
Code: Select all
threadfunction = function()
while true do
sim.followPath(target, path, 1, posOnPath, v, 0)
end
end
path = sim.getObjectHandle('/FL_Path')
target = sim.getObjectHandle('/FL_target')
pathLength = sim.getPathLength(path)
posOnPath = 0
-- v = 0.0849 --0.0797 -- 0.025 m/s
v = 0.0687
res, err =xpcall(threadfunction, function(err) return debug.traceback(err) end)
if not res then
sim.addStatusbarMessage('lua runtime error: ' .. err)
end