Hi,

I am trying to make an object in vrep adjust the velocity it follows its path in real time.

simFollowPath has a velocity parameter that makes the object follow the entire path at the specified velocity. However, if I want the object to slow down at some point along the path that is unknown until running the simulation, is there a way to do that?

Thank you.

## How do I follow path at varying velocities?

### Re: How do I follow path at varying velocities?

Hello,

yes, in that case you should manually move the object on the path via following API commands:

The first one gives you the total length of the path

The second one gives you the position along the path of the red sphere on the path

The third allows you to change the position along the path of the red sphere

The forth one gives you the absolute X/Y/Z position for a random point on the path. If you want the X/Y/Z position of the red sphere, then you would give as second argument: simGetPathPosition(...)/simGetPathLength(...)

Finally, you can then take that X/Y/Z coordinate and apply it to your object with simSetObjectPosition.

Cheers

yes, in that case you should manually move the object on the path via following API commands:

The first one gives you the total length of the path

The second one gives you the position along the path of the red sphere on the path

The third allows you to change the position along the path of the red sphere

The forth one gives you the absolute X/Y/Z position for a random point on the path. If you want the X/Y/Z position of the red sphere, then you would give as second argument: simGetPathPosition(...)/simGetPathLength(...)

Finally, you can then take that X/Y/Z coordinate and apply it to your object with simSetObjectPosition.

Cheers

### Re: How do I follow path at varying velocities?

Thank you! That is exactly what I needed.