Hi,
can any body provide an example/instruction how to use sim.followPath (https://www.coppeliarobotics.com/helpFi ... owPath.htm)?
i could not find any path following using this approach
an instruction for sim.followPath
Re: an instruction for sim.followPath
Hello,
sim.followPath is deprecated and should not be used anymore. If possible, also try to avoid path objects, since they are not that flexible and there will be a better option in next release (i.e. V4.2.0). But for the time being, do something like:
Cheers
sim.followPath is deprecated and should not be used anymore. If possible, also try to avoid path objects, since they are not that flexible and there will be a better option in next release (i.e. V4.2.0). But for the time being, do something like:
Code: Select all
-- init:
path=sim.getObjectHandle('myPath')
pathLength=sim.getPathLength(path)
-- e.g. place an object at 0.1 meter from the start of the path:
local dist=0.1
local relDist=dist/pathLength
local pos=sim.getPositionOnPath(path,relDist)
local euler=sim.getOrientationOnPath(path,relDist)
sim.setObjectPosition(myObjectHandle,pos)
sim.setObjectOrientation(myObjectHandle,euler)
Re: an instruction for sim.followPath
Thanks,
the approach with set-get position works
you may need to update the instruction to avoid confusing people ;)
the approach with set-get position works
you may need to update the instruction to avoid confusing people ;)
-
- Posts: 22
- Joined: 07 Sep 2020, 21:20
- Contact:
Re: an instruction for sim.followPath
Hello
How to make a object follow path in coppeliasim 4.2.0 (rev5) because the above code is not working and sim.followpath() is already deprecated.
I also tried https://www.coppeliarobotics.com/helpFiles/en/paths.htm follow path method describe in it but that also not working.
I think this particular part should be clearly describe in a post because lots of version having different methods to follow path and people will get lot of confusion.
Thanks in advance
How to make a object follow path in coppeliasim 4.2.0 (rev5) because the above code is not working and sim.followpath() is already deprecated.
I also tried https://www.coppeliarobotics.com/helpFiles/en/paths.htm follow path method describe in it but that also not working.
I think this particular part should be clearly describe in a post because lots of version having different methods to follow path and people will get lot of confusion.
Thanks in advance
Re: an instruction for sim.followPath
Always make sure to use the newest CoppeliaSim version. In CoppeliaSim V4.2 and V4.3, you'll find a demo scene scenes/movingAlongAPath.ttt: there you will find many different examples on how to have an object follow a path.
Cheers
Cheers