Public Member Functions | |
def | __init__ (self, pnts, order, tangents=None, normals=None) |
def | compute_polynomial (self, n, i, u) |
def | control_pnts (self) |
def | get_derivative (self, u, order=1) |
def | get_length (self) |
def | interpolate (self, u) |
Static Public Member Functions | |
def | distance (p1, p2) |
def | generate_cubic_curve (pnts) |
def | generate_quintic_curve (pnts) |
Static Private Member Functions | |
def | _get_binomial (n, i) |
Private Attributes | |
_control_pnts | |
_order | |
_pnts | |
Implementation of [Bezier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) of orders 3, 4 and 5 based on [1]. > *Input arguments* * `pnts` (*type:* `list`): List of 3D points as a vector (example: `[[0, 0, 0], [0, 1, 2]]`) * `order` (*type:* `int`): Order of the Bezier curve, options are 3, 4 or 5 * `tangents` (*type:* `list`, *default:* `None`): Optional input of the tangent vectors for each of the input points. In case only two points are provided, the tangents have to be provided, too. Otherwise, the tangents will be calculated. * `normals` (*type:* `list`, *default:* `None`): Optional input of the normal vectors for each of the input points. In case only two points are provided, the normals have to be provided, too. Otherwise, the normals will be calculated. !!! note [1] Biagiotti, Luigi, and Claudio Melchiorri. Trajectory planning for automatic machines and robots. Springer Science & Business Media, 2008.
Definition at line 25 of file bezier_curve.py.
def uuv_trajectory_generator.path_generator.bezier_curve.BezierCurve.__init__ | ( | self, | |
pnts, | |||
order, | |||
tangents = None , |
|||
normals = None |
|||
) |
Definition at line 46 of file bezier_curve.py.
|
staticprivate |
Compute binomial function $\binom{n}{i}$ > *Input arguments* * `n` (*type:* `int`) * `i` (*type:* `int`)
Definition at line 348 of file bezier_curve.py.
def uuv_trajectory_generator.path_generator.bezier_curve.BezierCurve.compute_polynomial | ( | self, | |
n, | |||
i, | |||
u | |||
) |
Compute the Bernstein polynomial $$ \mathbf{B} = {n\choose i} (1 - u)^{(n - i)} u^{i} $$ > *Input arguments* * `n` (*type:* `int`): Degree of the Bezier curve * `i` (*type:* `int`): Index of the control point * `u` (*type:* `float`): Parametric input of the curve in interval [0, 1] > *Returns* `float`: Bernstein polynomial result
Definition at line 328 of file bezier_curve.py.
def uuv_trajectory_generator.path_generator.bezier_curve.BezierCurve.control_pnts | ( | self | ) |
Return the list of control points of the Bezier curve. > *Returns* List of 3D points as `list`
Definition at line 269 of file bezier_curve.py.
|
static |
Compute the distance between two 3D points. > *Input arguments* * `p1` (*type:* list of `float` or `numpy.array`): Point 1 * `p2` (*type:* list of `float` or `numpy.array`): Point 2 > *Returns* Distance between points as a `float`
Definition at line 156 of file bezier_curve.py.
|
static |
Generate cubic Bezier curve segments from a list of points. > *Input arguments* * `pnts` (*type:* list of `float` or of `numpy.array`): List of points > *Returns* List of `BezierCurve` segments
Definition at line 176 of file bezier_curve.py.
|
static |
Generate quintic Bezier curve segments from a list of points. > *Input arguments* * `pnts` (*type:* list of `float` or of `numpy.array`): List of points > *Returns* List of `BezierCurve` segments
Definition at line 219 of file bezier_curve.py.
def uuv_trajectory_generator.path_generator.bezier_curve.BezierCurve.get_derivative | ( | self, | |
u, | |||
order = 1 |
|||
) |
Compute the derivative of the Bezier curve using the input parametric variable `u`. > *Input arguments* * `u` (*type:* `float`): Curve parametric input in the interval `[0, 1]` * `order` (*type:* `int`, *default:* `1`): Order of the derivative > *Returns* `numpy.array`: 3D derivative value from the Bezier curve
Definition at line 297 of file bezier_curve.py.
def uuv_trajectory_generator.path_generator.bezier_curve.BezierCurve.get_length | ( | self | ) |
Get length of the Bezier curve segment. > *Returns* `float`: Length of the curve
Definition at line 319 of file bezier_curve.py.
def uuv_trajectory_generator.path_generator.bezier_curve.BezierCurve.interpolate | ( | self, | |
u | |||
) |
Interpolate the Bezier curve using the input parametric variable `u`. > *Input arguments* * `u` (*type:* `float`): Curve parametric input in the interval `[0, 1]` > *Returns* 3D point from the Bezier curve as `numpy.array`
Definition at line 278 of file bezier_curve.py.
|
private |
Definition at line 71 of file bezier_curve.py.
|
private |
Definition at line 73 of file bezier_curve.py.
|
private |
Definition at line 50 of file bezier_curve.py.