程序代写案例-COMP4500

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
Coordinate Transforms
Part 2
COMP4500 | Reza Ahmadzadeh
notation
We denote
• Constants and 1D variables with a lowercase character,
• Vectors with a bold lowercase character,
• Matrices with a bold uppercase character,
In different references, you might see:
• Vectors denoted as Ƹ, ෤, ҧ, Ԧ and many others
• Matrices denoted as ෠, ෨ and many others
Normal vs. Homogeneous Format (2D)
Normal Homogeneous
Position =

=


1
Translation
=

=


1
Rotation =
cos − sin
sin cos =
cos − sin 0
sin cos 0
0 0 1
Transformation ƴ = +
=
cos − sin
sin cos
0 0 1
ƴ =
Rotation
Suppose we calculate Rotation between {A} and {B} as
How can we calculate ?
=

−1
=

Calculate the inverse
• −1 =

cos −sin
sin cos
−1
=
cos −sin
sin cos

=
cos sin
−sin cos
Example - 1
• Given a point in
3
4
( 3 + 1)
− ( 3 − 1)
in CS{2},
find the position of point p w.r.t CS{0}.
The angle between {0} and {2} is

3
.
• sin Τ 6 = cos Τ

3 = Τ
1
2
• sin Τ 3 = cos Τ

6 = ൗ
3
2
Example - 1
• 2 =
1
4
3( 3 + 1)
−3( 3 − 1)
• 02 =
cos − sin
sin cos
=
Τ1 2 Τ− 3 2
Τ3 2 Τ1 2
• 0 = 02
2
• 0 =
1
4
Τ1 2 Τ− 3 2
Τ3 2 Τ1 2
3( 3 + 1)
−3( 3 − 1)
=
1.5
1.5
Example - 2
• Given a point in
1.5
1.5
in CS{0}, find the
position of point p w.r.t CS{1}. The angle
between {0} and {1} is

6
.
• sin Τ 6 = cos Τ

3 = Τ
1
2
• sin Τ 3 = cos Τ

6 = ൗ
3
2
Example - 2
• 0 =
1.5
1.5
• 01 =
cos − sin
sin cos
• 1 = 10
0 = ( 01 )
−1 0 = ( 01 )
0
• 1 =
cos sin
−sin cos
1.5
1.5
=
1
4
3( 3 + 1)
3( 3 − 1)
Transformation
Suppose we calculate transformation from {A} to {B} as
How can we calculate ?
=

−1
Calculate the inverse
• −1 =?
• −1 =

1
−1
=

1
Example - 3
• {W} shows world CS
• Cozmo + Cube
Position
• Position of the Robot:
• =
3
2
• Position of the Object:
• =
1
6
Local CS
• Now we attach a CS to
Cozmo {R}
• It should align with
robot’s heading direction
Translation
• Translation vector
between robot {R} and
{W}:
• =
3
2
• Note: translation is the
distance (origin of {R} –
origin of {W})
Rotation
• For this example
• =
cos − sin
sin cos
• Rotation from frame {R}
to frame {W}
Rotation
• If = /4
• =
cos − sin
sin cos
• =
2
2
1 −1
1 1
Transformation
• =

1
• =
cos − sin
sin cos
0 0 1
• =
2
2

2
2
3
2
2
2
2
2
0 0 1
Example - 3
• Position of the object
• =
1
6
• Find
• = ?
Example - 3
• Homogeneous format
• =
1
6
1
• =

• =?
Calculate the inverse
=

−1 =
cos − sin
sin cos
0 0 1
−1
=
cos sin −(cos +sin )
−sin cos −(−sin +cos )
0 0 1
=
Τ2 2 Τ2 2 (−3 Τ2 2 − Τ2 2 2)
− Τ2 2 Τ2 2 (3 Τ2 2 − Τ2 2 2)
0 0 1
Example
• =


Τ2 2 Τ2 2 −5 Τ2 2
− Τ2 2 Τ2 2 Τ2 2
0 0 1
1
6
1
=
• =
2
3 2
1
Note
• We just calculated
=

• If you are given the position of the object w.r.t the robot CS, {R}, you
can calculate the position of the object w.r.t the world CS, {W} as
follows:
=

Lab2
• Due: before 11:59pm on Monday 3/1/2021
• Submit:
Code (only the files that were asked)
Link to a downloadable video of your demo
• One submission per group
• Include your group number and team member names on both code
and the video
Quiz3
• During the last 20min of class on Tuesday (3/2/2021)
• Material Covered: Finite State Machine + Coordinate Systems

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468