From 44dca2308e706fa9897d56a5f8c7028f9133acfe Mon Sep 17 00:00:00 2001 From: "Tassos (nakano) Natsakis" <891234ser@eipieq.com> Date: Sat, 7 Oct 2023 21:11:22 +0300 Subject: [PATCH] Small fixes on wording and definitions --- theory/lab01_Transformations.ipynb | 114 +++++++---------------------- 1 file changed, 27 insertions(+), 87 deletions(-) diff --git a/theory/lab01_Transformations.ipynb b/theory/lab01_Transformations.ipynb index cf229ed..e2907e8 100644 --- a/theory/lab01_Transformations.ipynb +++ b/theory/lab01_Transformations.ipynb @@ -10,7 +10,7 @@ "\n", "<img src=\"../artwork/stranded/mars_landing_site_with_base.png\" width=60%/>\n", "\n", - "She could get readings from the camera about the position of a very important package with food supplies, however she needed to understand where exactly is the package relative to her base. She had to understand the basics of coordinate systems and transformations." + "She could get readings from the camera about the position of a very important package with food supplies, however she needed to understand where exactly is the package relative to her base. She had to understand the basics of coordinate frames and transformations." ] }, { @@ -48,6 +48,16 @@ "\\end{bmatrix}\n", "$$\n", "\n", + "or simpler:\n", + "\n", + "$$\n", + "V = \\begin{bmatrix}\n", + " X_x & Y_y & Z_x \\\\\n", + " X_y & Y_y & Z_y \\\\\n", + " X_z & Y_z & Z_z \\\\\n", + "\\end{bmatrix}\n", + "$$\n", + "\n", "where $P_x^Y$ is the $x$ coordinate of the $Y$ axis. This is called the __transformation matrix__ and it tells us how is a _target_ coordinate frame __oriented__ relative to a _reference_ frame. In order to calculate it, we assume that the origin of the vectors are at the origin of the reference frame, and that they all have length 1. Since we always need to express a _target_ coordinate frame w.r.t (with respect to) a _reference_ frame, we need to use appropriate notation. We denote $T_r^t$ the transformation matrix of frame $t$ w.r.t frame $r$. This is called a [_3D rotation group_ and is often denoted as __SO(3)__](https://en.wikipedia.org/wiki/3D_rotation_group).\n", "\n", "You can visualize how the numbers in this matrix are changing when changing the orientation of a target frame $t$ w.r.t. a reference frame $r$, in the interactive widget below." @@ -55,34 +65,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "d520b347aeb541eda6787ebe91ae2044", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "interactive(children=(IntSlider(value=0, description='x', max=90, min=-90), IntSlider(value=0, description='y'…" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/plain": [ - "<function __main__.showAxes(x=0, y=0, z=0)>" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from ipywidgets import interact\n", "from spatialmath.base import *\n", @@ -106,9 +91,9 @@ "\n", "$$\n", "V = \\begin{bmatrix}\n", - " P_x^X & P_x^Y & P_x^Z \\\\\n", - " P_y^X & P_y^Y & P_y^Z \\\\\n", - " P_z^X & P_z^Y & P_z^Z \\\\\n", + " X_x & Y_y & Z_x \\\\\n", + " X_y & Y_y & Z_y \\\\\n", + " X_z & Y_z & Z_z \\\\\n", "\\end{bmatrix} = \\begin{bmatrix}\n", " 1 & 0 & 0 \\\\\n", " 0 & 1 & 0 \\\\\n", @@ -125,24 +110,9 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "bb42467647fe4941a2e1b7359a1cc744", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Tab(children=(interactive(children=(FloatSlider(value=0.0, description='r', max=3.14, min=-3.14), Output()), _…" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "from ipywidgets import interact, widgets\n", "from spatialmath.base import *\n", @@ -333,24 +303,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "1b75b0fa35e24c92aa4f9ba8fa61fbb7", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Tab(children=(interactive(children=(FloatSlider(value=0.0, description='a', max=3.14, min=-3.14), Output()), _…" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "from ipywidgets import interact, widgets\n", "from spatialmath.base import *\n", @@ -391,24 +346,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "25bccabba771439db778b70648b6a714", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Tab(children=(interactive(children=(FloatSlider(value=0.0, description='a', max=3.14, min=-3.14), Output()), _…" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "from ipywidgets import interact, widgets\n", "from spatialmath.base import *\n", @@ -496,7 +436,7 @@ "\n", "# Calculate coordinate '3' frame after three consecutive transformations\n", "t13 = t1@t2@t3\n", - "print(t13)\n" + "print(t13)" ] }, { @@ -532,10 +472,10 @@ "import numpy as np\n", "\n", "# Define point P with coordinates 1,2,3\n", - "P = np.array([[1,2,3,1]]).T\n", + "P3 = np.array([[1,2,3,1]]).T\n", "\n", - "# Calculating coordinates of point P in frame '3'\n", - "t13@P" + "# Calculating coordinates of point P w.r.t. frame '1', if we know its coordinates w.r.t. frame 3\n", + "t13@P3" ] }, { @@ -544,7 +484,7 @@ "source": [ "## Helping dr. Vasilescu\n", "\n", - "Now that you know enough about coordinate frames and transformations, go ahead and help dr. Vasilescu [find necessary resources](../assignments/Assignment01_Transformations.ipynb)" + "Now that you know enough about coordinate frames and transformations, go ahead and help dr. Vasilescu [find necessary resources for survival](../assignments/Assignment01_Transformations.ipynb)" ] } ], -- GitLab