Skip to main content

README

Overview

This package is a Reeds-Shepp library implementation with Python that is compatible with Python versions >= 3.9, including 3.11.

Contains the following files:

  • planner: Path planning code. path function outputs the optimal Reeds-Shepp path with or without a runway.
  • curves: Curve formulas for all of the curve types in the Reeds-Shepp paper.
  • primitives: Three class architectures (Waypoint, Segment, and Path).
    • Waypoint class (stores x, y, yaw of the waypoint and the curvature and length of the segment the waypoint is on as well as if the segment is a runway)
    • Segment class (stores left/right/straight type, forward/backward direction, length, and turn radius of the segment)
    • Path class (stores start and end points, turn radius, step size, and list of Segments. Also contains a cached waypoints function to get a list of Waypoints for the path)
  • helpers: Helper functions for planner, primitives, and curves files.
  • demo: Demo/visualization of paths.

Usage

Installation

You can install this software using pip:

$ pip3 install -U rsplan

Running

See demo.py for example usage

path(start_pose, end_pose, turn_radius, runway_length, step_size, length_tolerance (optional))

  • return a Reeds-Shepp path from start_pose to end_pose with specified turning radius and step_size between points. The length_tolerance default is 2 meters but can be set to user preference — if paths’ total lengths are within length tolerance of each other, the path function will choose the one with fewer segments as the optimal path. The runway_length is for the runway at the end of the path that helps improve accuracy in reaching the final position — this can be set to 0, or a positive or negative number for a forwards or backwards driving runway.
  • start_pose and end_pose are in the format Tuple[float, float, float] of x, y, yaw values.

FAQ

What are t, u, and v parameters?

  • As a whole, t, u, v are segment parameters generated in each of the curve helper functions that represent the distance (angular distance for curved segments, linear distance for straight segments) of their respective segments.
  • If there are 3 segments (ccc or csc), t is for segment 1, u is for segment 2, and v is for segment 3.
  • If there are 4 or 5 segments, the format is:
    • t, u, u, v for cccc paths (2nd and 3rd segments have same angular distance)
    • t, pi/2, u, v for ccsc paths (2nd segment has angle pi/2)
    • t, u, pi/2, v for cscc paths (3rd segment has angle pi/2)
    • t, pi/2, u, pi/2, v for ccscc paths (2nd and 4th segments have angle pi/2)
  • These are represented generally in the Segment class in the "distance" parameter, which we pass in t, u, v, or pi/2 for depending on the segment.

Exhibits

How to run the demo

  • Clone this repository

  • Update _END_POSES path coordinates in demo.py to the paths you would like to visualize

  • In terminal in the rsplan subfolder of this rsplan repository, run: $ python3 demo.py

Example paths visualized from demo.py:

Paths start from origin

Format: (end x, end y, yaw, turn radius, runway length)

  1. (5, 6, np.pi, 1, 0)
  2. (15, 3, np.pi / 2.0, 2, 6)
  3. (-2, -4, np.pi, 4, 3)
  4. (-7, 2, np.pi, 4, 0)
  5. (-7, -7, 0.0, 6, 1)
  6. (0.7, 1.8, 1, 1, 1)
  7. (-5, 6, np.pi / 3.0, 2, 1)
  8. (7, 2, 0.0, 6, 3)
  9. (-4, -1, -np.pi / 2.0, 1, 3)

Screenshot from 2023-07-18 11-50-32

References

Paper providing more information on the algorithm: Reeds, J., & Shepp, L. (1990). Optimal paths for a car that goes both forwards and backwards. https://msp.org/pjm/1990/145-2/pjm-v145-n2-p06-s.pdf

Curve formulas can be found on page 390-391. Inspiration for this Python implementation of the Reeds-Shepp algorithm: https://github.com/boyali/reeds_and_shepp_curves/tree/master

Release files for rsplan 1.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rsplan 1.0.10
File Size Uploaded
rsplan-1.0.10.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rsplan 1.0.10
File Interpreter ABI Platform
rsplan-1.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / rsplan-1.0.10.tar.gz

Download URL rsplan-1.0.10.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
07c7202cc0d638f080d164563f9cec3c5d7c5159c43b24c340c40b53c29ebb91
BLAKE2b-256 checksum
How to use checksums
bed6824a43a939afba7ac03cacc9d687a9d93736d5a52be2f8c07b77d891d1ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / rsplan-1.0.10-py3-none-any.whl

Download URL rsplan-1.0.10-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31921e71883bc48aefd41c2aa0b414ca9d04f590f20de62f55d050b5da4d741c
BLAKE2b-256 checksum
How to use checksums
9644958c338824aae30b60a4f99bacf51d0d4ad01266e630e2403e06b2351af4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0.10 This release

2 release files

1.0.9

2 release files

1.0.8

1 release file

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page