ReedsShepp¶
python_motion_planning.curve_generation.reeds_shepp.ReedsShepp
¶
Bases: Curve
Class for Reeds shepp curve generation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
step
|
float
|
Simulation or interpolation size |
required |
max_curv
|
float
|
The maximum curvature of the curve |
required |
Examples:
>>> from python_motion_planning.curve_generation import ReedsShepp
>>> points = [(0, 0, 0), (10, 10, -90), (20, 5, 60)]
>>> generator = ReedsShepp(step, max_curv)
>>> generator.run(points)
References
[1] Optimal paths for a car that goes both forwards and backwards
Path
¶
class for Path element
CCC(x, y, phi)
¶
8¶
Circle-Circle-Circle generation mode(using reflect, timeflip and backwards).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x of goal position |
required |
y
|
float
|
y of goal position |
required |
phi
|
float
|
goal orientation |
required |
Returns:
Name | Type | Description |
---|---|---|
paths |
list
|
Available paths |
CCCC(x, y, phi)
¶
8¶
Circle-Circle(beta)-Circle(beta)-Circle generation mode (using reflect, timeflip and backwards).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x of goal position |
required |
y
|
float
|
y of goal position |
required |
phi
|
float
|
goal orientation |
required |
Returns:
Name | Type | Description |
---|---|---|
paths |
list
|
Available paths |
CCSC(x, y, phi)
¶
16¶
Circle-Circle(pi/2)-Straight-Circle and Circle-Straight-Circle(pi/2)-Circle generation mode (using reflect, timeflip and backwards).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x of goal position |
required |
y
|
float
|
y of goal position |
required |
phi
|
float
|
goal orientation |
required |
Returns:
Name | Type | Description |
---|---|---|
paths |
list
|
Available paths |
CCSCC(x, y, phi)
¶
4¶
Circle-Circle(pi/2)-Straight--Circle(pi/2)-Circle generation mode (using reflect, timeflip and backwards).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x of goal position |
required |
y
|
float
|
y of goal position |
required |
phi
|
float
|
goal orientation |
required |
Returns:
Name | Type | Description |
---|---|---|
paths |
list
|
Available paths |
CSC(x, y, phi)
¶
8¶
Circle-Straight-Circle generation mode(using reflect, timeflip and backwards).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x of goal position |
required |
y
|
float
|
y of goal position |
required |
phi
|
float
|
goal orientation |
required |
Returns:
Name | Type | Description |
---|---|---|
paths |
list
|
Available paths |
LRL(x, y, phi)
¶
Left-Right-Left generation mode. (L+R-L-)
LRLRn(x, y, phi)
¶
Left-Right(beta)-Left(beta)-Right generation mode. (L+R+L-R-)
LRLRp(x, y, phi)
¶
Left-Right(beta)-Left(beta)-Right generation mode. (L+R-L-R+)
LRSL(x, y, phi)
¶
Left-Right(pi/2)-Straight-Left generation mode. (L+R-S-L-)
LRSLR(x, y, phi)
¶
Left-Right(pi/2)-Straight-Left(pi/2)-Right generation mode. (L+R-S-L-R+)
LRSR(x, y, phi)
¶
Left-Right(pi/2)-Straight-Right generation mode. (L+R-S-R-)
LSL(x, y, phi)
¶
Left-Straight-Left generation mode. (L+S+L+)
LSR(x, y, phi)
¶
Left-Straight-Right generation mode. (L+S+R+)
M(theta)
¶
Truncate the angle to the interval of -π to π.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
float
|
Angle value |
required |
Returns:
Name | Type | Description |
---|---|---|
theta |
float
|
Truncated angle value |
R(x, y)
¶
Return the polar coordinates (r, theta) of the point (x, y) i.e. rcos(theta) = x; rsin(theta) = y
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x-coordinate value |
required |
y
|
float
|
y-coordinate value |
required |
Returns:
Type | Description |
---|---|
r, theta (float): Polar coordinates |
SCS(x, y, phi)
¶
2¶
Straight-Circle-Straight generation mode(using reflect).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x of goal position |
required |
y
|
float
|
y of goal position |
required |
phi
|
float
|
goal orientation |
required |
Returns:
Name | Type | Description |
---|---|---|
paths |
list
|
Available paths |
SLS(x, y, phi)
¶
Straight-Left-Straight generation mode.
generation(start_pose, goal_pose)
¶
Generate the Reeds Shepp Curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_pose
|
tuple
|
Initial pose (x, y, yaw) |
required |
goal_pose
|
tuple
|
Target pose (x, y, yaw) |
required |
Returns:
Name | Type | Description |
---|---|---|
best_cost |
float
|
Best planning path length |
best_mode |
Best motion modes |
|
x_list |
list
|
Trajectory of x |
y_list |
list
|
Trajectory of y |
yaw_list |
list
|
Trajectory of yaw |
interpolate(mode, length, init_pose)
¶
Planning path interpolation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
motion, e.g., L, S, R |
required |
length
|
float
|
Single step motion path length |
required |
init_pose
|
tuple
|
Initial pose (x, y, yaw) |
required |
Returns:
Name | Type | Description |
---|---|---|
new_pose |
tuple
|
New pose (new_x, new_y, new_yaw) after moving |
run(points)
¶
Running both generation and animation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
points
|
list[tuple]
|
path points |
required |