## How to get table of path points

Typically: "How do I... ", "How can I... " questions
LowKick
Posts: 1
Joined: 11 Apr 2021, 12:10

### How to get table of path points

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?

Code: Select all

function sysCall_init()
objectToFollowPath=sim.getObjectHandle(sim.handle_self)
path=sim.getObjectHandle('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

CoppeliaSim v4.1.0

coppelia