I do not understand what Hw 7 problem 1 is asking. Am I suppose to multiply g = (x y theta)^T by the se(2) vector they are both 3x1 matrix. What is special about the * multiplication?
For #1 I think I should \[g \prime = g * \xi = \left[\begin{matrix}R(\theta) & d \\ 0 & 1\end{matrix}\right] * \left(\begin{matrix}\xi1 \\ \xi2 \\ \xi3 \end{matrix}\right)\]
Close but not quite...remember last week we defined the transformation*twist vector differently than the regular g.
\[\left[\begin{matrix}\omega & v \\ 0 & 0\end{matrix}\right]\] where \[\omega = \left[\begin{matrix}0 & -\xi 3 \\ \xi 3 & 0\end{matrix}\right]\]
No no...what you had was basically right but something is wrong about the g part. One part is there that shouldn't be when you're multiplying g by xi.
\[d = \left(\begin{matrix}0 \\ 0\end{matrix}\right)\]
Yeah d should be 0
why \[d = \left(\begin{matrix}0 \\ 0\end{matrix}\right)\]
this tells me the derivative of a velocity vector \[\xi \] is just a rotation
Keep in mind we are just transforming a velocity vector...not taking its derivative. We're simply expressing the velocity vector in a different frame. If you think about it, the distance between the two frames should not affect the representation of the velocity but the rotation should.
so the distance between two frames does not effect the velocity but the rotation between the frames will. I do understand this. what does the derivative have to do with this problem? And how do you get a set of differential equations from a rotation?
You can think of the left side as just \[\xi_{new}\]You are just being asked to find it symbolically by multiplying out the right side. g' is just another name for xi.
for #2 \[\omega \]hat always = 0 so using the Rodregess formula the exp =1
the magnitude of \[\omega \] hat = 0 not \[\omega \]
How are you calculating \[mag(\omega)?\]
I was taking the magnitude of omega hat, which I now know is incorrect. I need to take the magnitude of omega. I know omega is a vector but what vector that I can take a magnitude of?
You can extract omega from omega_hat by looking at the structure of omega_hat and how it's defined. You should have in your notes a definition of omega_hat in terms of omega1, omega2, and omega3
Remember in last week's homework you were asked to do that.
[0 -z y] [z 0 -x] [-y x 0]
yes so z = omega3 y = omega2 and x = omega1
so the magnitude is square root of x^2+y^2+z^2
correct
is the final answer in the form of a matrix or a number?
What do you think?
the answer should be in the form of a matrix.
Yep
in problem #3 we just take the ln(R) and the answer is a 3x3 matrix.
the sin should be in radians
Yes but to be sure you did it right, you should get something that looks like #2 because the ln is the inverse of the exponential. You should be able to "unhat" it also.
should the angles be in degrees? I say no they should be in radians.
Well in the final answer, it should be angular velocity, not angles. It doesn't matter if it's degrees or radians. Your choice
Actually just stick with radians.
when you take the sin and cos should the argument be in radians?
Yes the R is given in radians for sure.
this applies to #2 as well?
Yes everything is given in radians.
thanks
Np
And also all Taus are assumed to be 1 if not given
problem #3 I use [r32-r23] (1/2sin(2tau)) * [r13-r31] [r21-r12]
I mean [r32-r23] (1/2sin(tau)) * [r13-r31] [r21-r12]
I tried this and omega is a 3x1 vector. do I hat it to get a 3x3 matrix?
You should be multiplying the factor out in front by (R-R^T). R-R^T is a 3x3 matrix so the answer also should be.
for problem #4, in the leftact.m file what does 'type' mean in function x2 = leftact2(g, x, type) ? I do not understand how it is used.
with the new leftact.m, the program will recognize a 2x1 vector and a 3x1 vector but no other combination.
Yes this last part makes sense. The leftact operation applies to transformations of points. Do you still need me to clear up the first question?
yes. what is type for and how is it used? I entered g = SE2([x y], theta) x = [5 6 1]' leftact(g,x) my errors Error in SE2/mtimes (line 13) g.d = g1.d + g1.R * g2.d; Error in SE2/leftact (line 31) x2 = g * x;
I can multipy a 3x3 matrix by a 3x1 matrix (velocity) using *, but when I do this in leftact.m I get an error say I have violated mtimes.m. why do I need to use mtimes in leftact?
Ok I'm confused. Let's start from the beginning. did you modify the SE3 file so that it works?
oh hold on we're doing SE2 still
What am I looking for in #4?
>> g = SE2([10 15], pi/3) 0.5000 -0.8660 10.0000 0.8660 0.5000 15.0000 0 0 1.0000 >> x = [5 6 1]' x = 5 6 1 >> leftact2(g,x) Error using * Inner matrix dimensions must agree. Error in SE2/leftact2 (line 31) x2 = g.d + g.R * x;
So in this case your g.R is 2x2 and your x is 3x1...that's why you're getting the error. you should have code that accounts for the case where the input is a 3x1.
How do you calculate the new point if the original point is given in homogeneous form?
I do understand that R is a 2x2 and x is a 3x1. Do i code in leftact.m to partition x into \[\hat \omega\] and v?
\[\dot x\] \[\dot y \] and \[\dot \theta \]
\[x = ([\hat \omega ], v)\]
So leftact can take 3 things for x: 1) A 2x1 vector representing a point 2) A 3x1 vector representing a point(x;y;1) 3) A 3x1 vector representing a velocity(vx;vy;0) In each case it should multiply the g by the x. I think the easiest way to do this for parts 2 and 3 is to make g a homogeneous form matrix(note the difference from SE2 object) and then multiply it by x directly. Then you have a 3x3 times a 3x1 and you'll get a 3x1 homogeneous answer returned.
Should not the vector point be (x;y;z) and the velocity vector be (x,y,theta)? Why do you put a 1 in place of z and a zero in place of theta?
This is SE2...homogeneous representation of a point is [x;y;1] what would the z represent. The velocity vector is just linear velocity in homogeneous form, not including angular velocity.
I see, SE2 is movement or position in 2 space.
Yes SE2 is special euclidian 2-space and SE3 is special euclidian 3-space.
The task is not to take x down to a 2x1 but to take g up to a 3x3.
Yes...in my opinion. The reason is that a star operation would take different forms for point and velocity x. But the matrix operation is the same whether it's a point or velocity.
the result of g*x is the same but how that result is interpreted determines if the product is a point in 2 space or a velocity in 2 space
Yes exactly but it's up to the user to interpret the result...you just need to provide the result.
I will need to figuer out how to turn a 2x2 into a 3x3
figure
You know how to construct a homogeneous matrix in SE2 yes?
That is not fresh in my mind
g in matrix form is \[\left[\begin{matrix}R & d \\ 0 & 1\end{matrix}\right]\]
yes. I meant on the Matlab side
[g.R g.d; 0 0 1]
Also what if I enter x as a point (x,y,1). R = [cos(1) -sin(1)] {sin(1) cos(1)] This does not translate well
x is not an SE2 object...x is a vector. x = [x;y;1]
I would be using code similar to SE2.m in creating x.R and x.d. I would need to enter x in as x = SE2([x y], 1); this is as if I were entering another g
No. x is a point, not an SE2 object. SE2 objects can be thought of as frames and transformations. g is an SE2 object. x is a vector
x has no rotation. Here's the multiplication you want to do: \[\left[\begin{matrix}g.R & g.d \\ 0 & 1\end{matrix}\right]*\left(\begin{matrix}v1 \\ v2 \\ v3\end{matrix}\right)\]
Where the vector in the right is either \[\left(\begin{matrix}x \\ y \\ 1\end{matrix}\right)\]or \[\left(\begin{matrix}v_x \\ v_y \\ 0\end{matrix}\right)\]
I see, I do not creat an x.R or an x.d
No
My x is a 3x1 vector and it stays a 3x1 vector. Thanks for your patience
No problem
I got in running. Thanks
Cool
I do the same for updating the adjoint.m file
Write out what you plan to multiply to get that adjoint.
if (isa(x,'SE2')) % if x is a Lie group, then deal with properly. z = g*x*inv(g); elseif ( (size(x,1) == 3) && (size(x,2) == 1) ) % if x is vector form of Lie algebra, then deal with properly. a = [g.R g.d; 0 0 1]; z = g*x*inv(g); elseif ( (size(x,1) == 3) && (size(x,2) == 3) ) % if x is a homogeneous matrix form of Lie algebra, ... a = [g.R g.d; 0 0 1]; z = g*x*inv(g); end end
You're defining a but never using it. Also in the second case, where x is a 3x1...think about what you're multiplying.
if (isa(x,'SE2')) % if x is a Lie group, then deal with properly. z = g*x*inv(g); elseif ( (size(x,1) == 3) && (size(x,2) == 1) ) % if x is vector form of Lie algebra, then deal with properly. a = [g.R g.d; 0 0 1]; z = a*x*inv(a); elseif ( (size(x,1) == 3) && (size(x,2) == 3) ) % if x is a homogeneous matrix form of Lie algebra, ... a = [g.R g.d; 0 0 1]; z = a*x*inv(a); end end In case 2 and 3, I am multiplying a*x*inv(a). a is a 3x3, x is a 3x1 and inv(a) is a 3x3. That is a bad order to multiply matrices. I will have to do a*inv(a)*x.
a*inv(a) is just the identity. You !cannot! move around matrices arbitrarily. Matrix multiplication is not commutative in general. You need to find another solution.
In part 3 x is a 3x3 so that actually makes sense right.
[0 -z y] [z 0 -x] [-y x 0]
x is a transformation. You want to describe a transformation as a 3x3 matrix.
For the second part
\[x = \left[\begin{matrix}R(-\theta) & -R(-\theta)d \\ 0 & 1\end{matrix}\right]\]
why?
You seem to have written the inverse of a transformation. x is just a transformation.
\[x = \left[\begin{matrix}R & d \\ 0 & 1\end{matrix}\right]\]
Join our real-time social learning platform and learn together with your friends!