Skip to content
Linus Weigand edited this page May 10, 2025 · 1 revision

Reeds-Shepp Path Planning Library

Welcome to the Reeds-Shepp Path Planning Library for Rust! This library provides functionalities to calculate the shortest path between two configurations (pose: x, y, orientation) for a car-like vehicle. The vehicle is assumed to have a fixed turning radius and can move forwards and backwards.

Features

  • Optimal Path Calculation: Finds the shortest path using a set of predefined path primitives.
  • Core Data Structures: Defines Pose, Steering direction, Gear (forward/backward), and PathElement to construct paths.
  • Path Transformations: Includes functions to timeflip (reverse gear) and reflect (reverse steering) paths, crucial for exploring the complete Reeds-Shepp solution space.
  • Coordinate System Utilities: Provides helper functions for angle normalization, coordinate transformations (Cartesian to Polar, change of basis), and degree-to-radian conversion.

Modules

The library is primarily organized into:

  • lib.rs (this file): Contains the main logic for path generation, data structures like Steering, Gear, PathElement, and the core functions get_optimal_path and get_all_paths.
  • utils.rs: Contains utility functions and the Pose struct, including geometric calculations and coordinate transformations.

How It Works (High-Level)

  1. Given a start and end pose, the get_optimal_path function is called.
  2. This function internally calls get_all_paths to generate a comprehensive list of possible paths.
  3. get_all_paths first transforms the problem into a canonical frame where the start pose is at the origin (0,0) with 0 orientation.
  4. It then iterates through a predefined set of 12 base path generating functions (path1 to path12). Each of these functions computes a specific sequence of maneuvers (e.g., Turn-Straight-Turn).
  5. For each base path, four variations are generated using timeflip and reflect operations to cover all possible Reeds-Shepp path families.
  6. The resulting paths are filtered (removing zero-length segments) and cleaned.
  7. Finally, get_optimal_path selects the path with the minimum total length from all generated valid paths.

Navigation

Clone this wiki locally