|
253 | 253 | "source": [ |
254 | 254 | "# 2D poses (combined translation/orientation)\n", |
255 | 255 | "\n", |
256 | | - "2D poses can be represented using elements of SE(2). Translations and rotations can be combined into a single $\\mymatrix{H}\\in\\mathbb{R}^{3 \\times 3}$ with the following structure\n", |
257 | | - "\n", |
258 | | - "$$\\mymatrix{H}(x,y,\\theta) = \\left[\\begin{array}{ccc}\n", |
| 256 | + "2D poses can be represented using elements of SE(2). A translation followed by a rotation can be combined into a single $\\mymatrix{H}\\in\\mathbb{R}^{3 \\times 3}$ with the following structure\n", |
| 257 | + "\n", |
| 258 | + "$$\\mymatrix{H}(x,y,\\theta) =\n", |
| 259 | + "\\left[\\begin{array}{ccc}\n", |
| 260 | + " 1 & 0 & x \\\\\n", |
| 261 | + " 0 & 1 & y \\\\\n", |
| 262 | + " 0 & 0 & 1\n", |
| 263 | + " \\end{array}\\right]\n", |
| 264 | + "\\left[\\begin{array}{ccc}\n", |
| 265 | + " \\cos{\\theta} & -\\sin{\\theta} & 0 \\\\\n", |
| 266 | + " \\sin{\\theta} & \\cos{\\theta} & 0 \\\\\n", |
| 267 | + " 0 & 0 & 1\n", |
| 268 | + " \\end{array}\\right] =\n", |
| 269 | + "\\left[\\begin{array}{ccc}\n", |
259 | 270 | " \\cos{\\theta} & -\\sin{\\theta} & x \\\\\n", |
260 | 271 | " \\sin{\\theta} & \\cos{\\theta} & y \\\\\n", |
261 | 272 | " 0 & 0 & 1\n", |
262 | 273 | " \\end{array}\\right].$$\n", |
263 | 274 | "\n", |
264 | 275 | "<div class=\"alert alert-block alert-info\">\n", |
265 | | - "The pose written as a homogenous matrix shown above represents a translation followed by a rotation. To see the difference, check the exercises at the end of this lesson.\n", |
| 276 | + "The translation and rotation order is extremelly important. Check the exercises at the end of this lesson.\n", |
266 | 277 | "</div>\n", |
267 | 278 | "\n", |
268 | 279 | "For $\\theta = \\frac{\\pi}{2}$, $x = 0.1$, and $y = 0.2$, we have the following equivalent piece of code." |
|
363 | 374 | "source": [ |
364 | 375 | "## Compositions of rotations in SO(3)\n", |
365 | 376 | "\n", |
366 | | - "Compositions in SO(3) follow the same rules as SO(2), where sequential frame transformations are represented by right multiplications. For instance,\n", |
| 377 | + "Compositions in SO(3) follow the same rules as SO(2), where sequential rotations are represented by right multiplications. For instance,\n", |
367 | 378 | "\n", |
368 | 379 | "$$\\mymatrix{R}_c = \\mymatrix{R}_a\\mymatrix{R}^a_b\\mymatrix{R}^b_c.$$\n", |
369 | 380 | "\n", |
|
428 | 439 | "source": [ |
429 | 440 | "# 3D poses\n", |
430 | 441 | "\n", |
431 | | - "3D poses are represented in SE(3) with matrices $\\mymatrix{H}\\in\\mathbb{R}^{4 \\times 4}$ with the following structure\n", |
432 | | - "\n", |
433 | | - "$$\\mymatrix{H}(\\myvec{t},\\mymatrix{R}) = \\left[\\begin{array}{ccc}\n", |
| 442 | + "A translation followed by a rotation in 3D is represented in SE(3) with matrices $\\mymatrix{H}\\in\\mathbb{R}^{4 \\times 4}$ with the following structure\n", |
| 443 | + "\n", |
| 444 | + "$$\\mymatrix{H}(\\myvec{t},\\mymatrix{R}) =\n", |
| 445 | + "\\left[\\begin{array}{ccc}\n", |
| 446 | + " \\mymatrix{I} & \\myvec{t} \\\\\n", |
| 447 | + " \\myvec{0} & 1\n", |
| 448 | + " \\end{array}\\right]\n", |
| 449 | + "\\left[\\begin{array}{ccc}\n", |
| 450 | + " \\mymatrix{R} & \\myvec{0} \\\\\n", |
| 451 | + " \\myvec{0} & 1\n", |
| 452 | + " \\end{array}\\right] =\n", |
| 453 | + "\\left[\\begin{array}{ccc}\n", |
434 | 454 | " \\mymatrix{R} & \\myvec{t} \\\\\n", |
435 | 455 | " \\myvec{0} & 1 \n", |
436 | | - " \\end{array}\\right].$$" |
| 456 | + " \\end{array}\\right].$$\n", |
| 457 | + "\n", |
| 458 | + "<div class=\"alert alert-block alert-info\">\n", |
| 459 | + "The translation and rotation order is extremelly important.\n", |
| 460 | + "</div>" |
437 | 461 | ] |
438 | 462 | }, |
439 | 463 | { |
|
614 | 638 | ], |
615 | 639 | "outputs": [], |
616 | 640 | "execution_count": null |
| 641 | + }, |
| 642 | + { |
| 643 | + "metadata": {}, |
| 644 | + "cell_type": "markdown", |
| 645 | + "source": [ |
| 646 | + "## Exercise d\n", |
| 647 | + "\n", |
| 648 | + "Consider the same variables as in `Exercise c` by replacing the subscripts with `d`. Calculate, instead, the rotation followed by the translation. Store the result in the variable `H_d` shown in the cell below.\n", |
| 649 | + "\n", |
| 650 | + "Is `H_c` the same as `H_d`? What does that indicate?" |
| 651 | + ] |
| 652 | + }, |
| 653 | + { |
| 654 | + "metadata": {}, |
| 655 | + "cell_type": "code", |
| 656 | + "outputs": [], |
| 657 | + "execution_count": null, |
| 658 | + "source": [ |
| 659 | + "θ_d = pi/3.0 # As given in the exercise\n", |
| 660 | + "x_d = 2.0 # As given in the exercise\n", |
| 661 | + "y_d = 5.0 # As given in the exercise\n", |
| 662 | + "\n", |
| 663 | + "H_d = None # Replace None with your solution to this exercise." |
| 664 | + ] |
617 | 665 | } |
618 | 666 | ], |
619 | 667 | "metadata": { |
|
0 commit comments