multirotor.trajectories¶
Module Contents¶
Classes¶
Iterate over waypoints for a multirotor. The trajectory class can segment a |
|
Functions¶
|
Generate a list of points following the Eight curve pattern. |
Attributes¶
- multirotor.trajectories.ScurvePlanner = False¶
- class multirotor.trajectories.Trajectory(vehicle: multirotor.simulation.Multirotor, points: numpy.ndarray, proximity: float = None, resolution: float = None)¶
Iterate over waypoints for a multirotor. The trajectory class can segment a list of waypoints into smaller sections and feed them to the controller when the vehicle is within a radius of its current waypoint.
For example:
m = Multirotor(…) traj = Trajectory(
points=[(0,0,0), (0,0,2), (10,0,2)], vehicle=m, proximity=0.1, resolution=0.5)
- for point in traj:
Each point is spaced resolution units apart in euclidean distance. When m.position is within proximity of current point, the next point in the trajectory is yielded.
- __len__()¶
- __getitem__(i: int)¶
- get_params()¶
- set_params(**params)¶
- __iter__()¶
- generate_trajectory(curr_pos=None)¶
- add_waypoint(point: numpy.ndarray)¶
- next_waypoint()¶
- reached(wp: numpy.ndarray) bool¶
- class multirotor.trajectories.GuidedTrajectory(vehicle: multirotor.simulation.Multirotor, waypoints: Iterable[numpy.ndarray], steps: int = 10, proximity: float = 2.0, max_velocity: float = 7.0, max_acceleration: float = 3.0, max_jerk: float = 100, turn_factor: float = 1 / np.sqrt(2))¶
- _setup()¶
- __iter__()¶
- reached(wp: numpy.ndarray) bool¶
- multirotor.trajectories.eight_curve(a: float = 10, N: int = 20) numpy.ndarray¶
Generate a list of points following the Eight curve pattern.
Parameters¶
- aint, optional
The scale of the curve, by default 50
- Nint, optional
Number of points to generate, by default 20
Returns¶
- np.ndarray
A Nx3 array of points.