| 1 |
/** |
| 2 |
* @file |
| 3 |
* @brief finds and smooths shortest paths |
| 4 |
* @ingroup public_apis |
| 5 |
* |
| 6 |
* **libpathplan** provides functions for creating spline paths in the plane |
| 7 |
* that are constrained by a polygonal boundary or obstacles to avoid. |
| 8 |
* All polygons must be simple, but need not be convex. |
| 9 |
* |
| 10 |
* [man 3 pathplan](https://graphviz.org/pdf/pathplan.3.pdf) |
| 11 |
* |
| 12 |
*/ |
| 13 |
|
| 14 |
/************************************************************************* |
| 15 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 16 |
* All rights reserved. This program and the accompanying materials |
| 17 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 18 |
* which accompanies this distribution, and is available at |
| 19 |
* https://www.eclipse.org/legal/epl-v10.html |
| 20 |
* |
| 21 |
* Contributors: Details at https://graphviz.org |
| 22 |
*************************************************************************/ |
| 23 |
|
| 24 |
#pragma once |
| 25 |
|
| 26 |
#include "pathgeom.h" |
| 27 |
#include <stddef.h> |
| 28 |
|
| 29 |
#ifdef __cplusplus |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
#ifdef GVDLL |
| 34 |
#ifdef PATHPLAN_EXPORTS |
| 35 |
#define PATHPLAN_API __declspec(dllexport) |
| 36 |
#else |
| 37 |
#define PATHPLAN_API __declspec(dllimport) |
| 38 |
#endif |
| 39 |
#endif |
| 40 |
|
| 41 |
#ifndef PATHPLAN_API |
| 42 |
#define PATHPLAN_API /* nothing */ |
| 43 |
#endif |
| 44 |
|
| 45 |
/* find shortest euclidean path within a simple polygon */ |
| 46 |
PATHPLAN_API int Pshortestpath(Ppoly_t * boundary, Ppoint_t endpoints[2], |
| 47 |
Ppolyline_t * output_route); |
| 48 |
|
| 49 |
/* fit a spline to an input polyline, without touching barrier segments */ |
| 50 |
PATHPLAN_API int Proutespline(Pedge_t *barriers, size_t n_barriers, |
| 51 |
Ppolyline_t input_route, |
| 52 |
Pvector_t endpoint_slopes[2], |
| 53 |
Ppolyline_t *output_route); |
| 54 |
|
| 55 |
/* utility function to convert from a set of polygonal obstacles to barriers */ |
| 56 |
PATHPLAN_API int Ppolybarriers(Ppoly_t ** polys, int npolys, |
| 57 |
Pedge_t ** barriers, int *n_barriers); |
| 58 |
|
| 59 |
/* function to convert a polyline into a spline representation */ |
| 60 |
PATHPLAN_API void make_polyline(Ppolyline_t line, Ppolyline_t* sline); |
| 61 |
|
| 62 |
#undef PATHPLAN_API |
| 63 |
|
| 64 |
#ifdef __cplusplus |
| 65 |
} |
| 66 |
#endif |