Android phone camera instead of webcam teaching <<
Previous Next >> W16
W15
本週進度:字幕翻譯並整理。
part1:
字幕整理:
We saw this simple two-link robot in the previous lecture about forward kinematics.
我們在上一堂關於正向運動學的課程中看到這個簡單的雙連桿機構。
Kinematics : 運動學
The tooltip pose of this robot is described simply by two numbers, the coordinates x and y with respect to the world coordinate frame.
該機構的提示框由兩個數字簡單描述,相對於絕對坐標系的坐標 x 和 y。
So, the problem here is that given x and y, we want to determine the joined angles, q1 and q2.
所以,這裡的問題是有了x和y條件,我們要求解連接角q1和q2的值為多少。
The solution that we’re going to follow in this particular section is a geometric one.
我們利用特定幾何來解決這個問題。
We’re going to start with a simple piece of construction.
我們從一個簡單的結構開始。
We’re going to overlay the red triangle on top of our robot.
我們將在機構上覆蓋紅色三角形。
We know that the end point coordinate is x, y, so the vertical height of the triangle is y, the horizontal width is x.
我們知道最終坐標是x,y,所以三角形的垂直高度為y,水平寬度為x。
And, using Pythagoras theorem, we can write r squared equals x squared plus y squared.
然後,利用Pythagorean theorem(畢氏定理),我們可寫出 r² = x ²+ y²。
So far, so easy.
到目前為止都很容易。
Now, w’re going to look at this triangle highlighted here in red and we want to determine the angle alpha.
現在,我們查看此處凸顯的紅色三角形,並且要確定α角。
(α=alpha)
In order to do that, we need to use the cosine rule.
為了做到這一點,我們須使用餘弦定理。
(餘弦=cosine)
And, if you’re a little rusty on the cosine rule, here is a bit of a refresher.
如果你對餘弦定理有點生疏,這裡可以幫助你複習一下。
We have an arbitrary triangle.
有一個任意三角形。
We don’t have any right angles in it and we’re going to label the length of this edge as A and the angle opposite that edge, we’re going to label as little a.
三角形中沒有任何的直角,將這邊的角度標為小a,而對邊的長度標為A。
And, we do the same for this edge and this angle, and this edge and this angle.
我們再對這邊和這個角,以及這邊和這個叫做同樣的事。
So, all together, the sides are labelled capitals A, B and C, and the angles are labelled little a, little b, and little c.
以此類推,所有邊都標記為A, B, C,角都標記為a, b, c 。
So, the cosine rule is simply this relationship here.
餘弦定理就是這種關係。
It’s a bit like Pythagoras’ theorem except for this extra term on the end with the cos a in it.
它有點像畢達哥拉斯定理,不同之處是末端多出了cos a。
Now, let’s apply the cosine rule to the particular triangle we looked at a moment ago.
將餘弦定理套用於剛剛看到的特定三角形。
It’s pretty straightforward to write down this particular relationship.
寫下此特殊關係很簡單。
We can isolate the term cos alpha which gives us the angle alpha that we’re interested in.
我們可分離出 cosα ,只需要得知α角度作為條件。
And, it’s defined in terms of the constant link lengths, A1 and A2 and the position of the end effector, x and y.
它是根據恆定連桿長度A1和A2以及最終執行器的位置x和y定義。
We can write this simple relationship between the angles alpha and q2.
我們可寫出角度α和q2之間的簡單關係。
And, we know from the shape of the cosine function that cos of q2 must be equal to negative of cos alpha.
並且我們從餘弦函數中得知cos q2必須等於 –cos α。
This time, let’s just write an expression for the cosine of the joined angle q2.
這次寫出餘弦在連接角q2的表達式。
Now, we’re going to draw yet another red triangle and we’re going apply some simple trigonometry here.
我們繪製另一個紅色三角形,並應用三角函數。
If we know q2, then we know this length and this length of the red triangle.
如果我們知道q2,就可知道這個長度和這個三角形的長度。
We can write this relationship for the sine of the joined angle q2.
我們可以在連接角q2寫出正弦關係。
Now, we can consider this bigger triangle whose angle is beta and this side length of this triangle is given here in blue.
現在我們考慮這個大一點的三角形,它角度是β,此三角形的邊長由藍色表示。
(β=beta)
And, the length of the other side of the triangle is this.
且三角形另一邊長度是這個。
So, now we can write an expression for the angle beta in terms of these parameters here.
我們可在此根據參數寫出角度β的表達式。
Going back to the red triangle that we drew earlier, we can establish a relationship between q1 and the angle beta.
回到之前畫的紅色三角形,我們可建立出q1和β的關係。
Introduce yet another angle, this one gamma and we can write a relationship between the angle gamma and the tooltip coordinates x and y.
引入另一個角度ɣ,可寫出角度ɣ和提示框座標x和y之間的關係。
(ɣ=gamma)
Now, we can write a simple relationship between the angles that we’ve constructed, gamma and beta and the joined angle we’re interested in which is q1.
現在我們可建構出角度β和ɣ與連接角度q1之間的關係。
And, the total relationship looks something like this.
而且,整個關係看起來像這樣。
Quite a complex relationship, it gives us the angle of joined one, that’s q1 in terms of the end effector coordinates y and x, and a bunch of constants, a1 and a2, and it’s also a function of the second joint angle, q2.
相當複雜的關係,它提供連接的角度,即最終執行器坐標 y 和 x 的 q1,以及一系列常數 a1 和 a2,它也是第二個關節角度 q2 的函數。
So, let’s summarize what it is that we have derived here.
所以,總結我們在這裡得出了什麼。
We have an expression for the cosine of q2 and we have an expression for q1.
我們有q2餘弦方程式與q1方程式。
Now, the cosine function is symmetrical about 0.
餘弦函數在0對稱。
So, if we know the value of the cosine of q2, then there are two possible solutions a positive angle and a negative angle.
所以我們知道cosq2的值可能為正角和負角。
We’re going to explicitly choose the positive angle. Which means that I can write this expression here.
我們選擇正角,表示我可以寫出此表達式。
And now, we have what we call the inverse kinematic solution for this two-link robot.
現在我們能用逆向運動學來解決雙連桿機構。
(逆向運動學=inverse kinematic,IK)
We have an expression for the two joined angles, q1 and q2 in terms of the end effector pose x and y, and a bunch of constants.
我們有兩個連接角 q1 和 q2 的表達式,根據最終執行器的x 和 y 以及一系列常數。
You notice that the two equations are not independent.
你要注意到兩方程式不是獨立的。
The equation for q1, in fact, depends on the solution for q2.
事實上,q1方程式取決於q2的解。
In this case, q2 is negative and we’re going to write the solution for q2 with a negative sign in front of the inverse cosine.
在這情況下,q2為負,我們將在q2反餘弦的解前面加上負號。
Now, we need to solve for q1, so we’re going to introduce this particular red triangle, the angle beta that we solved previously, and the angle gamma which is defined in terms of y and x.
我們需求解q1,因此采用這個特定的三角形,之前求解的角度β以及根據y和x定義的角度ɣ。
Now, we write a slightly different relationship between q1, gamma and beta, different to what we had before.
q1、ɣ和β之間的關西,和之前求的不同。
There’s a change of sign involved.
涉及到符號的變化。
Then, we can substitute all that previous equation and come up with this expression for q1.
然後我們可代換之前所有等式,並求得此q1方程式。
Again, there is a change of sign here.
同樣,這裡的符號發生了變化。
Previously, this was a negative sign.
先前,這是個負號。
And, here in summary form is the solution for the inverse kinematics of our two-link robot when it is in this particular configuration, where q2 is negative.
這是雙連桿機構在此逆向運動學的總形式,其中q2為負。
Let’s compare the two solutions, the case where q2 is positive and the case where q2 is negative.
讓我們比較兩個解決方案,q2為正和q2為負的情況。
part2:
字幕整理:
Here we have the same two link robot as we just looked at but this time we're going tosolve it using an analytical approach , that is we're going to rely much more on algebra ,particular linear algebra rather than geometry .
在這裡,我們有與前一篇相同的兩連桿機械手臂,但這次我們將使用分析方法來解決它,意味著我們將更多地依賴代數,特別是使用線性代數而不是幾何。
We have an expression E , which is the homogeneous transformation which represents the pose of the robots endefector and we looked at this in the last lecture , we can write the endefector pose as a sequence of elementary homogeneous transformations .
我們有一個表達式 E,它是表示機械手臂最終位置的齊次變換式,我們在上一課中看到了這一點,我們可以將最終位置寫為一系列基本齊次變換式。
A rotation by Q1 , a translation along the X direction by A1 , a rotation by Q2 and then a translation in the X direction by A2 .
Q1 旋轉,A1 沿 X 方向平移,Q2 旋轉,然後 A2 沿 X 方向平移。
If I expand this out , multiply all the transformations together , I get the expression shown here ; a three by three homogeneous transformation matrix representing the pose of the robot's endefector.
如果我將其展開,將所有變換相乘,就會得到此處所示的表達式 E ;它是一個三乘三的齊次變換矩陣,表示機械手臂的最終的位置。
Now for this particular two link robot , we are only interested in the position of its endefector , it's X and Y co - ordinate and they are these two elements within the homogeneous transformation matrix , so I'm going to copy those out .
現在對於這個特殊的兩連桿機器人,我們只對它的最終位置感興趣,與它有關的是 X 和 Y 坐標,它們是齊次變換矩陣中的這兩個元素,所以我將把它們複製出來。
So here again is our expression for X and Y and what we're going to do is a fairly common trick , we're going to square and add these two equations and I get a relationship that looks like this .
所以這裡又是我們對 X 和 Y 的表達式,我們要做的是一個相當常見的技巧,我們要將它平方並將這兩個方程相加,我得到一個看起來像這樣的關係式。
Now I can solve for the joint angle Q2 in terms of the endefector pose X and Y and the robot's constants A1 and A2.
現在我可以根據最終位置X和Y以及機械手臂的常數A1及A2來求出關節角度Q2。
Now what I'm going to do is apply the sum of angles identity .
現在我要做的是應用角度之和的特性。
I'm going to expand these terms, sine of Q1 plus Q2 or cos of Q1 plus Q2 and to make life a little bit easier, I'm going to make some substations, so where ever I had cos Q2, I'm going to write C2 and where ever I had sine Q2, I'm going to write S2.
我將展開這些項,Q1 的正弦加 Q2 或 Q1 的餘弦加 Q2,為了讓生活更輕鬆一點,我將建立一些分部,所以只要有 cos Q2,我會將其取代為C2並且在有正弦Q2的地方,我會將其取代為S2。
It's a fairly common shorthand when people are looking at robot kinematic equations.
當人們解決機械手臂運動學方程式時,這是一個相當常見的快速記法。
And here are the equations after making those substitutions.
這是進行替換後的方程式。
Looking at these two equations, I can see that they fall into a very well known form and for that form there is a very well known solution.
看看這兩個方程式,我可以看到它們屬於一個眾所周知的形式,對於這種形式,有一個淺顯易見的解決方案。
So I'm going to consider just one of the equations, the equation for Y and using our well known identity and it's solution, I can determine the values for the variables little a, little b and little c and once l've determined those, then I can just write down the solution for Q1, which x is the equivalent of theta in this particular case.
所以我將只考慮其中一個方程,Y 的方程,並使用我們眾所周知的恆等式和它的解,我可以確定變量小 a、小 b 和小 c 的值,一旦我確定了這些,然後我可以寫下 Q1 的解決方程,在這種特殊情況下,x 相當於 theta。
Here again is our expression for Q1, copied over from the previous slide and we may remember from earlier in our workings that we determined this particular relationship; X squared plus Y squared is equal to this particular complex expression.
這裡再次是我們對 Q1 的表達,從上一張幻燈片複製過來,我們可能還記得在我們早期的說明中,確定了這種特殊關係; X 平方加 Y 平方等於這個特定的複雜表達式。
So I can substitute that in and do some simplification and I end up with this slightly less complex expression for Q1.
因此,我可以將其替換並進行一些簡化,最終得到 Q1 的這個稍微不那麼複雜的表達式。
And it is the same expression that I got following the geometric approach in the previous section.
這與我在上一節中遵循幾何方法求出的表達式一模一樣。
Android phone camera instead of webcam teaching <<
Previous Next >> W16