Skip to content

Lab 9: Python Code for All the Math from Lesson 3 up to Lesson 6

Madi Babaiasl edited this page Nov 12, 2023 · 3 revisions

Objective of lab 9

In this lab, we will develop functions in Python that can compute all the math that we learned from lesson 3 up to lesson 6. We will use these functions when studying the next parts of the course.

Required Software

  • Visual Studio Code or any IDE for Python

Instructions

Based on the lessons that we have learned starting from Lesson 3: Orientation in Robotics (Rotation Matrices) to Lesson 6: Pose in Robotics (Exponential Coordinates of Robot Motions), develop functions in Python that can calculate the following. One function

  • gets the rotation matrix R and returns its inverse

  • gets a 3-vector $\hat{\omega}$ and gives back the $3 \times 3$ skew-symmetric matrix representation of it.

  • gets the angle $\theta$ and the unit axis of rotation $\hat{\omega}$ and returns the rotation matrix representing the rotation about $\hat{\omega}$ by $\theta$. This function should be able to handle the special cases of rotation operators about $\hat{x}$, $\hat{y}$, and $\hat{z}$. Use Rodrigues' formula to write this function.

  • gets the $3 \times 3$ skew-symmetric matrix representation of $\hat{\omega}$ and returns the 3-verctor $\hat{\omega}$.

  • gest the 3-vector exponential coordinates for rotation $\hat{\omega}\theta$ and extracts the rotation axis $\hat{\omega}$ and the rotation amount $\theta$.

  • gets a $3 \times 3$ rotation matrix R and finds the axis $\hat{\omega}$, and angle $\theta$ representation of it.

  • gets the rotation matrix $R \in SO(3)$ and a position vector $p \in \mathbb{R}^3$ and returns the $4 \times 4$ homogenous matrix T coressponding to them.

  • gets the $4 \times 4$ homogenous transformation matrix T and extract the $3 \times 3$ rotation matrix and $3 \times 1$ position vector from it.

  • gets the $4 \times 4$ homogenous transformation matrix T and computes the inverse of it.

  • gets a 3-vector and returns its homogenous coordinates.

  • gets the $4 \times 4$ homogenous transformation matrix T and computes its $6 \times 6$ adjoint representation $[Ad_{T}]$.

  • gets the 6-vector exponential coordinates of motion $\mathcal{S}q$ and extracts the normalized screw axis $\mathcal{S}$ and the distance traveled along the screw q.

  • gets the 6-vector screw axis and computes the matrix representation of it.

  • gets the screw axis $\mathcal{S}$ and q and calculates the corresponding homogenous transformation matrix $T \in SE(3)$.

  • gets the $4 \times 4$ homogenous transformation matrix and computes the screw axis and q.

Guidelines for Lab 8 report

  • Submit one report per group. Note that each member of the group should have an equal contribution to completing the lab and documenting and writing the report (as always be an ethical engineer and disclose all your collaborators including the AI ones).

  • The report should include an example for each function that receives pertinent input and produces accurate output. Provide this in written format.

  • All the developed functions should be uploaded to your repository for this course on GitHub and include the link in the written report.

Pat yourself on the back for completing Lab 9! You've done a fantastic job.

Clone this wiki locally