Skip to content

APF

python_motion_planning.local_planner.apf.APF

Bases: LocalPlanner

Class for Artificial Potential Field(APF) motion planning.

Parameters:

Name Type Description Default
start tuple

start point coordinate

required
goal tuple

goal point coordinate

required
env Env

environment

required
heuristic_type str

heuristic function type

'euclidean'
**params

other parameters can be found in the parent class LocalPlanner

{}

Examples:

Python Console Session
>>> from python_motion_planning.utils import Grid
>>> from python_motion_planning.local_planner import APF
>>> start = (5, 5, 0)
>>> goal = (45, 25, 0)
>>> env = Grid(51, 31)
>>> planner = APF(start, goal, env)
>>> planner.run()

getAttractiveForce(cur_pos, tgt_pos)

Get the attractive force of APF.

Parameters:

Name Type Description Default
cur_pos ndarray

current position of robot

required
tgt_pos ndarray

target position of robot

required

Returns attr_force (np.ndarray): attractive force

getRepulsiveForce()

Get the repulsive force of APF.

Returns:

Name Type Description
rep_force ndarray

repulsive force of APF

plan()

APF motion plan function.

Returns:

Name Type Description
flag bool

planning successful if true else failed

pose_list list

history poses of robot

run()

Running both plannig and animation.