|
← Back to home
GitHub repository | Sampling-based motion planning with GPU acceleration OverviewThis project implements and benchmarks sampling-based motion planning algorithms — PRM, RRT, and RRT* — with CUDA-accelerated variants for the computationally expensive distance and collision-checking steps. The goal is to speed up path planning in environments ranging from simple open spaces to procedurally generated obstacle fields. The pipeline builds a configuration-space graph by randomly sampling points, connecting nearby nodes, and checking edges for collisions against rectangular and polygonal obstacles. Once a path from start to goal is found, the planner returns the route and its cost. Algorithms and environmentsThe project supports four algorithm modes and four environment types:
Example usage: python CPP.py --alg rrt_star --env complex GPU accelerationThe CUDA variants offload the most expensive operations — pairwise Euclidean distance computation and collision checking across large batches of sampled points — to the GPU using Numba CUDA kernels. This is especially beneficial in the complex pro environment, where hundreds or thousands of iterations are needed to find a feasible path through dense, randomly generated obstacle fields. The project logs per-iteration timing and total planning time, and can export results to Excel for benchmarking across seeds, environments, and algorithm choices. Connection to agriculturePath planning is not just a robotics exercise — it sits at the center of autonomous field operations. In precision agriculture, a robot or implement needs to navigate row crops, avoid obstacles (trees, rocks, irrigation equipment), and reach specific locations in the field efficiently. Sampling-based planners like RRT* are well-suited to this because fields are semi-structured but not perfectly predictable: rows provide general direction, but local conditions (wet spots, fallen branches, terrain variation) create dynamic obstacles. GPU acceleration matters here because agricultural machines often need to replan in real time. A sprayer or scout robot that detects a new obstacle — or receives an updated target location — cannot wait seconds for a CPU-only planner to converge. Faster planning means the machine can react to changing field conditions without stopping. Weed identification → path planning → actuationA concrete pipeline I have been building toward connects perception, planning, and action in the field:
This "identify → plan → act" loop is the same pattern as the VLA driving agents in my other playground projects, but applied to real agricultural machinery. Perception tells you what and where; path planning tells you how to get there; actuation closes the loop. The CUDA path planning work provides the planning layer of that stack. By benchmarking GPU vs. CPU planners across environment complexities, I can choose the right trade-off between planning speed and path quality for field deployment — where replanning latency directly affects how quickly a robot can treat newly detected weeds. Future work
|