# Potential FIeld Calculation

We have to implement an algorithm for potential field path planning.

I have implemented so far everything for this formula:

$U(q) = attractive Force + Sum Repulsive Forces (of all obstacles)$


The result should be a velocity vector for x and y direction.

Based on the lecture slides we have the hint:

F = - \nabla U(q) = - [dU/dx, dU/dy]


Can somebody explain me, how to transform the Energy U to the velocities?

Given is a map with a startposition and a targetPosition of a robot in [m] and some positions of obstacles. Furthermore an updatetime of 0.2s

• Is your U(q) a vector or a scalar? It should be a vector. If you are working in 2D it should have 2 components
– 50k4
Jun 27 at 16:55
• I am not 100% sure, but it looks like a scalar. The attractive force is calculated based on the euclidean distance from the current position to the target position. The repulsive forces based on the eucl. distance from the current robot position to the obstacles. THe nable operator is not explained.
– Alex
Jun 27 at 18:17
• The $\nabla$ operator converts your scalar to a vector (very simply explained). However, if you are implementing this, it makes sense to keep all your variables in a vector form (i.e. account for all forces as vectors in the same coordinate system) this way the $\nabla$ operator implementation will be a simple element wise division.
– 50k4
Jun 28 at 9:17