2
2
"cells" : [
3
3
{
4
4
"cell_type" : " markdown" ,
5
+ "metadata" : {},
5
6
"source" : [
6
7
" # Quintic polynomials planner"
7
- ],
8
- "metadata" : {
9
- "collapsed" : false
10
- }
8
+ ]
11
9
},
12
10
{
13
11
"cell_type" : " markdown" ,
12
+ "metadata" : {},
14
13
"source" : [
15
14
" ## Quintic polynomials for one dimensional robot motion\n " ,
16
15
" \n " ,
17
- " We assume a dimensional robot motion $x(t)$ at time $t$ is formulated as a quintic polynomials based on time as follows:\n " ,
16
+ " We assume a one- dimensional robot motion $x(t)$ at time $t$ is formulated as a quintic polynomials based on time as follows:\n " ,
18
17
" \n " ,
19
- " $x(t) = a_0+a_1t+a_2t^2+a_3t^3+a_4t^4$ \n " ,
18
+ " $x(t) = a_0+a_1t+a_2t^2+a_3t^3+a_4t^4+a_5t^5$ --(1) \n " ,
20
19
" \n " ,
21
- " a_0, a_1. a_2, a_3 are parameters of the quintic polynomial.\n " ,
20
+ " $ a_0, a_1. a_2, a_3, a_4, a_5$ are parameters of the quintic polynomial.\n " ,
22
21
" \n " ,
23
- " So, when time is 0,\n " ,
22
+ " It is assumed that terminal states (start and end) are known as boundary conditions.\n " ,
23
+ " \n " ,
24
+ " Start position, velocity, and acceleration are $x_s, v_s, a_s$ respectively.\n " ,
24
25
" \n " ,
25
- " $x(0) = a_0 = x_s$ \n " ,
26
+ " End position, velocity, and acceleration are $x_e, v_e, a_e$ respectively. \n " ,
26
27
" \n " ,
27
- " $x_s$ is a start x position .\n " ,
28
+ " So, when time is 0 .\n " ,
28
29
" \n " ,
29
- " Then, differentiating this equation with t, \n " ,
30
+ " $x(0) = a_0 = x_s$ -- (2) \n " ,
30
31
" \n " ,
31
- " $x'(t) = a_1+2a_2t+3a_3t^2+4a_4t^3$\n " ,
32
+ " Then, differentiating the equation (1) with t, \n " ,
33
+ " \n " ,
34
+ " $x'(t) = a_1+2a_2t+3a_3t^2+4a_4t^3+5a_5t^4$ -- (3)\n " ,
32
35
" \n " ,
33
36
" So, when time is 0,\n " ,
34
37
" \n " ,
35
- " $x'(0) = a_1 = v_s$\n " ,
38
+ " $x'(0) = a_1 = v_s$ -- (4) \n " ,
36
39
" \n " ,
37
- " $v_s$ is a initial speed for x axis. \n " ,
40
+ " Then, differentiating the equation (3) with t again, \n " ,
38
41
" \n " ,
39
- " === TBD ==== \n "
40
- ],
41
- "metadata" : {
42
- "collapsed" : false
43
- }
42
+ " $x''(t) = 2a_2+6a_3t+12a_4t^2$ -- (5)\n " ,
43
+ " \n " ,
44
+ " So, when time is 0,\n " ,
45
+ " \n " ,
46
+ " $x''(0) = 2a_2 = a_s$ -- (6)\n " ,
47
+ " \n " ,
48
+ " so, we can calculate $a_0$, $a_1$, $a_2$ with eq. (2), (4), (6) and boundary conditions.\n " ,
49
+ " \n " ,
50
+ " $a_3, a_4, a_5$ are still unknown in eq(1).\n "
51
+ ]
52
+ },
53
+ {
54
+ "cell_type" : " markdown" ,
55
+ "metadata" : {},
56
+ "source" : [
57
+ " We assume that the end time for a maneuver is $T$, we can get these equations from eq (1), (3), (5):\n " ,
58
+ " \n " ,
59
+ " $x(T)=a_0+a_1T+a_2T^2+a_3T^3+a_4T^4+a_5T^5=x_e$ -- (7)\n " ,
60
+ " \n " ,
61
+ " $x'(T)=a_1+2a_2T+3a_3T^2+4a_4T^3+5a_5T^4=v_e$ -- (8)\n " ,
62
+ " \n " ,
63
+ " $x''(T)=2a_2+6a_3T+12a_4T^2+20a_5T^3=a_e$ -- (9)\n "
64
+ ]
65
+ },
66
+ {
67
+ "cell_type" : " markdown" ,
68
+ "metadata" : {},
69
+ "source" : [
70
+ " From eq (7), (8), (9), we can calculate $a_3, a_4, a_5$ to solve the linear equations.\n " ,
71
+ " \n " ,
72
+ " $Ax=b$\n " ,
73
+ " \n " ,
74
+ " $\\ begin{bmatrix} T^3 & T^4 & T^5 \\\\ 3T^2 & 4T^3 & 5T^4 \\\\ 6T & 12T^2 & 20T^3 \\ end{bmatrix}\n " ,
75
+ " \\ begin{bmatrix} a_3\\\\ a_4\\\\ a_5\\ end{bmatrix}=\\ begin{bmatrix} x_e-x_s-v_sT-0.5a_sT^2\\\\ v_e-v_s-a_sT\\\\ a_e-a_s\\ end{bmatrix}$\n " ,
76
+ " \n " ,
77
+ " We can get all unknown parameters now"
78
+ ]
79
+ },
80
+ {
81
+ "cell_type" : " markdown" ,
82
+ "metadata" : {},
83
+ "source" : [
84
+ " ## Quintic polynomials for two dimensional robot motion (x-y)\n " ,
85
+ " \n " ,
86
+ " If you use two quintic polynomials along x axis and y axis, you can plan for two dimensional robot motion in x-y plane.\n " ,
87
+ " \n " ,
88
+ " $x(t) = a_0+a_1t+a_2t^2+a_3t^3+a_4t^4+a_5t^5$ --(10)\n " ,
89
+ " \n " ,
90
+ " $y(t) = b_0+b_1t+b_2t^2+b_3t^3+b_4t^4+b_5t^5$ --(11)\n " ,
91
+ " \n " ,
92
+ " It is assumed that terminal states (start and end) are known as boundary conditions.\n " ,
93
+ " \n " ,
94
+ " Start position, orientation, velocity, and acceleration are $x_s, y_s, \\ theta_s, v_s, a_s$ respectively.\n " ,
95
+ " \n " ,
96
+ " End position, orientation, velocity, and acceleration are $x_e, y_e. \\ theta_e, v_e, a_e$ respectively.\n " ,
97
+ " \n " ,
98
+ " Each velocity and acceleration boundary condition can be calculated with each orientation.\n " ,
99
+ " \n " ,
100
+ " $v_{xs}=v_scos(\\ theta_s), v_{ys}=v_ssin(\\ theta_s)$\n " ,
101
+ " \n " ,
102
+ " $v_{xe}=v_ecos(\\ theta_e), v_{ye}=v_esin(\\ theta_e)$\n "
103
+ ]
104
+ },
105
+ {
106
+ "cell_type" : " code" ,
107
+ "execution_count" : null ,
108
+ "metadata" : {},
109
+ "outputs" : [],
110
+ "source" : []
44
111
}
45
112
],
46
113
"metadata" : {
52
119
"language_info" : {
53
120
"codemirror_mode" : {
54
121
"name" : " ipython" ,
55
- "version" : 2
122
+ "version" : 3
56
123
},
57
124
"file_extension" : " .py" ,
58
125
"mimetype" : " text/x-python" ,
59
126
"name" : " python" ,
60
127
"nbconvert_exporter" : " python" ,
61
- "pygments_lexer" : " ipython2 " ,
62
- "version" : " 2 .7.6 "
128
+ "pygments_lexer" : " ipython3 " ,
129
+ "version" : " 3 .7.5 "
63
130
},
64
131
"pycharm" : {
65
132
"stem_cell" : {
66
133
"cell_type" : " raw" ,
67
- "source" : [],
68
134
"metadata" : {
69
135
"collapsed" : false
70
- }
136
+ },
137
+ "source" : []
71
138
}
72
139
}
73
140
},
74
141
"nbformat" : 4 ,
75
- "nbformat_minor" : 0
76
- }
142
+ "nbformat_minor" : 1
143
+ }
0 commit comments