Using the manual (https://www.coppeliarobotics.com/helpFiles/en/paths.htm), I created some path and I want to get an array of coordinates of the waypoints. For simple testing, I use the code from the manual, but I get a nil value from sim.readCustomDataBlock(path,'Path'). How i can get an array of coordinates of waypoint?
function sysCall_init()
objectToFollowPath=sim.getObjectHandle(sim.handle_self)
path=sim.getObjectHandle('Path')
pathData=sim.unpackDoubleTable(sim.readCustomDataBlock(path,'PATH'))
local m=Matrix(#pathData/7,7,pathData)
pathPositions=m:slice(1,1,m:rows(),3):data()
pathQuaternions=m:slice(1,4,m:rows(),7):data()
pathLengths,totalLength=sim.getPathLengths(pathPositions,3)
velocity=0.04 -- m/s
posAlongPath=0
previousSimulationTime=0
end
the way path are create and handled changed in CoppeliaSim V4.2.0
The user manual refers to CoppeliaSim V4.2.0. Best is to upgrade to CoppeliaSim V4.2.0 and convert your existing paths to the new paths: select an old path object, open its property window, then click Create similar object
In CoppeliaSim V4.2.0, have also a look at the demo scene: scenes/movingAlongAPath.ttt