MPC¶
python_motion_planning.local_planner.mpc.MPC
¶
Bases: LocalPlanner
Class for Model Predicted Control (MPC) 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 MPC
>>> start = (5, 5, 0)
>>> goal = (45, 25, 0)
>>> env = Grid(51, 31)
>>> planner = MPC(start, goal, env)
>>> planner.run()
mpcControl(s, s_d, u_r, u_p)
¶
Execute MPC control process.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
tuple
|
current state |
required |
s_d
|
tuple
|
desired state |
required |
u_r
|
tuple
|
refered control |
required |
u_p
|
tuple
|
previous control error |
required |
Returns:
Name | Type | Description |
---|---|---|
u |
ndarray
|
control vector |
plan()
¶
MPC 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.