Skip to content

A Python interface for advanced drone trajectory planning that generates smooth, collision-free flight paths in complex 3D environments.

License

Notifications You must be signed in to change notification settings

u-k-g/drone-pathgen

Repository files navigation

drone-pathgen

overview

drone-pathgen is a lightweight python wrapper around gcopter – a trajectory optimizer for multicopters. it lets you generate smooth, collision-free drone paths directly from python swiftly and painlessly.

applications
  • autonomous delivery
  • search & rescue navigation
  • infrastructure inspection
  • simulation & research prototypes
  • indoor warehouse flight planning
features
  • smart path planning that avoids obstacles and respects real drone physics
  • voxel-map support for arbitrary 3d environments
  • smooth, jerk-limited trajectories within safe-flight-corridors (sfc)
  • built-in optimization for time, energy and feasibility
  • numpy-friendly api – results come back as plain ndarrays
  • optional open3d visualization extras [see screenshot below]
image
installation

prerequisites – make sure ompl, eigen3 and boost are available on your system.

# macos [homebrew]
brew install ompl eigen boost

# ubuntu / debian
sudo apt-get update
sudo apt-get install libompl-dev libeigen3-dev libboost-all-dev

install the library:

core only
uv add git+https://github.com/u-k-g/drone-pathgen.git
# or with pip 
pip install git+https://github.com/u-k-g/drone-pathgen.git
with visualization support [adds open3d]
uv add "git+https://github.com/u-k-g/drone-pathgen.git[viz]"
# or with pip
pip install "git+https://github.com/u-k-g/drone-pathgen.git[viz]"

supported python versions [3.8 → 3.12]

quick start
import numpy as np
import gcopter_cpp as gc

# create api and configure environment
api = gc.GCopterAPI()
api.configure_map(
    map_size=np.array([20, 20, 10], dtype=np.int32),
    origin=np.array([-5.0, -5.0, 0.0]),
    voxel_scale=0.5,
    obstacle_points=[np.array([0.0, 0.0, 2.0])],
    dilation_radius=2
)

# set trajectory endpoints
start = np.array([[-4.0], [-4.0], [1.0]])
goal = np.array([[4.0], [4.0], [3.0]])
api.set_endpoints(start, goal)

# plan trajectory
success = api.run_inference(
    planning_timeout=5.0,
    time_weight=50.0,
    segment_length=2.0,
    smoothing_epsilon=1e-3,
    integral_resolution=8,
    magnitude_bounds=np.array([5., 10., np.pi/3, 5., 15.]),
    penalty_weights=np.array([1, 1, 1, 1, 1]),
    physical_params=np.array([1., 9.81, 0., 0., 0., 0.01])
)

# get results
if success:
    stats = gc.TrajectoryStatistics()
    api.get_statistics(stats)
    print(f"✅ planned {stats.total_duration:.2f}s trajectory")
documentation

comprehensive documentation available in docs/

working examples in examples/

license

released under the mit license – see license file for details.

About

A Python interface for advanced drone trajectory planning that generates smooth, collision-free flight paths in complex 3D environments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages