-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwaypoints.py
36 lines (27 loc) · 839 Bytes
/
waypoints.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
"""
author: John Bass
email: [email protected]
license: MIT
Please feel free to use and modify this, but keep the above information. Thanks!
"""
import numpy as np
from numpy import pi
import config
deg2rad = pi / 180.0
def makeWaypoints(t, waypoint0, waypoint, yaw0, yaw, v_average=1.6):
t0 = 0
# wp_ini = np.array([0, 0, 0])
# yaw_ini = 0
# v_average = 1.6
# t = np.array([2, 5, 8, 11, 14])
# wp = np.array([[2, 2, 1],
# [-2, 3, -3],
# [-2, -1, -3],
# [3, -2, 1],
# [0, 0, 0]])
# yaw = np.array([20, -90, 120, 45, 0])
t = np.hstack((t0, t)).astype(float)
wp = np.vstack((waypoint0, waypoint)).astype(float)
yaw = np.hstack((yaw0, yaw)).astype(float)
return t, wp, yaw, v_average