程序代写代做 Assignment 1: Rotations and Transformations

Assignment 1: Rotations and Transformations
Contact: asathyam@cs.umd.edu February 2020
1 Homogeneous Transformations (10 pts)
1. Consider the matrix product:
H = Rotx ∗ Transx,b ∗ Transz,d ∗ Rotz
Where, Rotx is an arbitrary rotation about the X-axis. Transx,b is a trans- lation of b meters along the X-axis.Transz,d is a translation of d meters along the Z-axis. Rotz is an arbitrary rotation about the the Z-axis.
a. Determine which pairs of the four matrices on the RHS commute.
b. Explain why these pairs commute.
c. Find all permutations of these four matrices that yield the same homoge- neous transformation matrix, H.
2 Rotation Matrix (15 pts)
2. Consider a 3-D rotation about the Z axis with an angle of θ represented by a matrix R.
a. Prove that the Inverse of R results in a rotation of -theta about the Z axis. b. Prove that the product of two 2-D rotation matrices (denoting rotation about the same axis) is equal to the rotation matrix denoting the sum of the individual rotation angles. Does this also apply to 3-D scenarios?
3. Prove, by construction, that the elements of SO(2) and SO(3) do not have a unique inverse.
3 Quaternions (10 pts)
4. Represent the rotation by angle π/6 about the axis denoted by (1,1,1) as a quaternion. What happens when the vector (0,1,0) undergoes this rotation?
1

4 Basic Programming (20 pts)
5. (Use any programming language of choice) Consider a scenario where a mobile robot is navigating through a cluttered environment with dynamic (moving) pedestrians. The robot must sense the pedestrians’ positions and ori- entations with respect to itself to avoid a collision with them.
Assume that we have a global coordinate frame X0 −Y0. A frame Xrob −Yrob is attached to the robot such that the Xrob is pointing towards the robot’s front, and Yrob is pointing towards the robot’s left. Initially, X0 − Y0 and Xrob − Yrob are coincident. The robot then performs the following actions:
(i) Turning by an angle θ.
(ii) Moving 5 meters forward with a velocity 1 m/s.
As the robot starts moving forward, a pedestrian starts from (5, 0) and moves to (5,5) at 1 m/s in the global coordinates. Write a program to compute the relative position of the pedestrian with respect to the robot’s frame for the 5 seconds when the robot and pedestrian are moving. In addition, check that for different values of θ, the orientation of the pedestrian with respect to the robot changes. You may represent the pedestrian orientation as a unit vector. Deliverable: Program file (.cpp / .py / .m) and a PDF reporting the pedes- trian’s relative positions and orientations for different values of θ.
5 Extra Credit (10 pts)
6. (Use any programming language of choice) You are to analyze the area covered by a camera attached to a quadrotor looking downwards for vary- ing pitch and yaw angles for a certain period of time (take 10 seconds).
The view from the camera is modeled as a cone with constant apex angle (take half of apex angle to be 45◦), and the area covered by the camera is the area of the base circle of this cone (see figure 1). Assume that the quadrotor is facing the direction (1,0,0) at an initial height of 5 meters and moving along in that direction with a particular speed. Apply rotations to pitch forward (vary upto 90◦) for different yaw orientations (−90◦ to 90◦). Write a program to plot the circular coverage area when the quadrotor pitches and yaws by different angles.
Assumptions: The pitch axis is along y (0, 1, 0), and the yaw axis is along z (0, 0, 1). Assume that when the quadrotor pitches, it loses altitude. This would in turn reduce the area covered. Also assume that the covered area is always circular.Two simple scenarios are shown in figures 2 and 3. Your final plot should look like the green circles shown in the figures.
HINT: Use the rotation matrices for rotation about x, y, z axes discussed in class to obtain the quadrotor’s orientation.
Deliverable: A program (.cpp / .py/ .m file) and a document containing the output you obtained for 3 different sets of values for pitch and yaw angles.
2

Figure 1: The quadrotor’s frame assignment, coverage cone and the base circle.
Figure 2: Example output for pitch and yaw = 0◦.
3

Figure 3: Example output for pitch ̸= 0◦ and yaw = 0◦.
4