Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ The content shown in this work is based on my own expert knowledge (and interpre

## Contents

- [The Basics of Kinematic Modeling and Control of Serial-link Manipulators Using `numpy`](basic_lessons/README.md).
- [Kinematic modeling and control of serial-link robotic manipulators using `dqrobotics`: From zero to hero.](other/dqrobotics).
- [The Basics of Kinematic Modelling and Control of Serial-link Manipulators Using `numpy`](basic_lessons/README.md).
- [Kinematic modelling and control of serial-link robotic manipulators using `dqrobotics`: From zero to hero.](other/dqrobotics).



Expand Down
2 changes: 1 addition & 1 deletion basic_lessons/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The Basics of Kinematic Modeling and Control of Serial-link Manipulators Using `numpy`
# The Basics of Kinematic Modelling and Control of Serial-link Manipulators Using `numpy`

In this five-lesson tutorial, we start from the very basics of scalar and matricial operations in Python using `numpy`,
all the way until the basics of kinematic control. Until kinematic control, most is based on [@spong2020robot].
Expand Down
2 changes: 1 addition & 1 deletion basic_lessons/lesson1_exercise_answers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
84 changes: 42 additions & 42 deletions basic_lessons/lesson1_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"*Author: Murilo M. Marinho (murilo.marinho@manchester.ac.uk)*\n",
"\n",
"### Pre-requisites\n",
"### Prerequisites\n",
"The user of this notebook is expected to have prior knowledge in\n",
"- Basic Python [[Tutorial]](https://docs.python.org/3/tutorial/index.html)\n",
"- Numpy \n",
Expand All @@ -21,7 +21,7 @@
"### I found an issue\n",
"Thank you! Please report it at https://github.com/MarinhoLab/OpenExecutableBooksRobotics/issues\n",
"\n",
"### Latex Macros"
"### Latex Macros\n"
]
},
{
Expand All @@ -33,7 +33,7 @@
},
"source": [
"$\\providecommand{\\myvec}[1]{{\\mathbf{\\boldsymbol{{#1}}}}}$\n",
"$\\providecommand{\\mymatrix}[1]{{\\mathbf{\\boldsymbol{{#1}}}}}$"
"$\\providecommand{\\mymatrix}[1]{{\\mathbf{\\boldsymbol{{#1}}}}}$\n"
]
},
{
Expand All @@ -52,7 +52,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# A quick Python refresher"
"# A quick Python refresher\n"
]
},
{
Expand All @@ -65,7 +65,7 @@
"\n",
"$$a\\triangleq 10,b\\triangleq 5.$$\n",
"\n",
"We can replicate the above in Python with"
"We can replicate the above in Python with\n"
]
},
{
Expand All @@ -83,7 +83,7 @@
"metadata": {},
"source": [
"## Output variables\n",
"Variables can be output using `print`. For example, for $a$"
"Variables can be output using `print`. For example, for $a$\n"
]
},
{
Expand All @@ -109,7 +109,7 @@
"source": [
"\n",
"### Output text and variables using f-strings\n",
"To output $a$ and $b$ within a string, we can use `print` and f-strings as follows"
"To output $a$ and $b$ within a string, we can use `print` and f-strings as follows\n"
]
},
{
Expand Down Expand Up @@ -139,7 +139,7 @@
"\n",
"#### Sum\n",
"\n",
"$$c = a + b.$$"
"$$c = a + b.$$\n"
]
},
{
Expand All @@ -166,7 +166,7 @@
"metadata": {},
"source": [
"#### Subtraction\n",
"$$c = a - b.$$"
"$$c = a - b.$$\n"
]
},
{
Expand All @@ -193,7 +193,7 @@
"metadata": {},
"source": [
"#### Multiplication\n",
"$$c=ab$$"
"$$c=ab$$\n"
]
},
{
Expand All @@ -220,7 +220,7 @@
"metadata": {},
"source": [
"#### Division\n",
"$$c = \\frac{a}{b}$$"
"$$c = \\frac{a}{b}$$\n"
]
},
{
Expand All @@ -247,7 +247,7 @@
"metadata": {},
"source": [
"### Exponentiation\n",
"$$c = a^{b}$$"
"$$c = a^{b}$$\n"
]
},
{
Expand Down Expand Up @@ -275,7 +275,7 @@
"source": [
"### Math functions\n",
"\n",
"For the following functions, we will need Python's built-in `math` module."
"For the following functions, we will need Python's built-in `math` module.\n"
]
},
{
Expand All @@ -293,7 +293,7 @@
"source": [
"### Square root\n",
"\n",
"$$c = \\sqrt{a}$$"
"$$c = \\sqrt{a}$$\n"
]
},
{
Expand All @@ -314,15 +314,15 @@
"\n",
"$$c= \\sqrt[n]{a}, n \\in \\mathbb{N},$$\n",
"\n",
"does not seem to have a shorthanded version in Python, but can computed through simple properties such as\n",
"does not seem to have a shorthand version in Python, but can be computed through simple properties such as\n",
"\n",
"$$c = \\sqrt[n]{a} = a^{\\frac{1}{n}} = e^{\\frac{ln(a)}{n}}.$$\n",
"\n",
"For example, suppose that\n",
"\n",
"$$n = 3.$$ \n",
"\n",
"Then,"
"Then,\n"
]
},
{
Expand All @@ -338,7 +338,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"and we can calculate the n-th root like so"
"and we can calculate the n-th root like so\n"
]
},
{
Expand All @@ -365,7 +365,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"or like so"
"or like so\n"
]
},
{
Expand Down Expand Up @@ -398,7 +398,7 @@
"$$ \\phi = \\frac{\\pi}{4},$$\n",
"$$ s_{\\phi} = \\sin \\left( \\phi \\right),$$\n",
"$$ c_{\\phi} = \\cos \\left( \\phi \\right),$$\n",
"$$ t_{\\phi} = \\tan \\left( \\phi \\right).$$"
"$$ t_{\\phi} = \\tan \\left( \\phi \\right).$$\n"
]
},
{
Expand Down Expand Up @@ -437,7 +437,7 @@
"\n",
"### Installing the library\n",
"\n",
"Just in case `numpy` is not already installed, we can install it with the following command. Nothing will happen if the library is already installed."
"Just in case `numpy` is not already installed, we can install it with the following command. Nothing will happen if the library is already installed.\n"
]
},
{
Expand All @@ -455,7 +455,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Importing the library"
"### Importing the library\n"
]
},
{
Expand All @@ -472,12 +472,12 @@
"metadata": {},
"source": [
"### Instantiating vectors\n",
"A row vector can be instanteated from a list of list. For instance, for \n",
"A row vector can be instantiated from a list of lists. For instance, for \n",
"$$\\myvec{v} = \\left[\\begin{array}{ccc}\n",
" 1 & 2 \n",
" \\end{array}\\right],\n",
"$$ \n",
"we have"
"we have\n"
]
},
{
Expand All @@ -504,12 +504,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"A column vector can be instanted from a list of singleton *lists*. For instance, for \n",
"A column vector can be instantiated from a list of singleton *lists*. For instance, for \n",
"$$\\myvec{u} = \\left[\\begin{array}{ccc}\n",
" 1 \\\\\n",
" 2\n",
" \\end{array}\\right],$$ \n",
"we have"
"we have\n"
]
},
{
Expand Down Expand Up @@ -540,7 +540,7 @@
"source": [
"### Dot product\n",
"\n",
"$$\\myvec{c} = <\\myvec{u},\\myvec{u}>$$ "
"$$\\myvec{c} = <\\myvec{u},\\myvec{u}>$$ \n"
]
},
{
Expand Down Expand Up @@ -588,7 +588,7 @@
"\n",
"we can obtain the cross product\n",
"\n",
"$$\\myvec{c} = \\myvec{u}_3 \\times \\myvec{v}_3$$ "
"$$\\myvec{c} = \\myvec{u}_3 \\times \\myvec{v}_3$$ \n"
]
},
{
Expand Down Expand Up @@ -623,7 +623,7 @@
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"Note that the function is np.<b>linalg</b>.norm, as the norm calculation is within the module <b>linalg</b>.\n",
"</div>"
"</div>\n"
]
},
{
Expand Down Expand Up @@ -659,7 +659,7 @@
" 5 & 6 \\\\\n",
" 7 & 8 \n",
" \\end{array}\\right] \n",
"$$"
"$$\n"
]
},
{
Expand Down Expand Up @@ -694,7 +694,7 @@
"source": [
"### Transpose\n",
"\n",
"$$\\mymatrix{C} = \\mymatrix{A}^T$$ "
"$$\\mymatrix{C} = \\mymatrix{A}^T$$ \n"
]
},
{
Expand Down Expand Up @@ -723,7 +723,7 @@
"source": [
"### Sum\n",
"\n",
"$$ \\mymatrix{C} = \\mymatrix{A} + \\mymatrix{B} $$"
"$$ \\mymatrix{C} = \\mymatrix{A} + \\mymatrix{B} $$\n"
]
},
{
Expand Down Expand Up @@ -752,7 +752,7 @@
"source": [
"### Subtraction\n",
"\n",
"$$ \\mymatrix{C} = \\mymatrix{A} - \\mymatrix{B} $$"
"$$ \\mymatrix{C} = \\mymatrix{A} - \\mymatrix{B} $$\n"
]
},
{
Expand Down Expand Up @@ -788,7 +788,7 @@
"<div class=\"alert alert-block alert-info\">\n",
"The matrix multiplication operator, <b>@</b>, is very unusual. Pay close attention.\n",
"Mistaking this can be a major source of bugs and confusion.\n",
"</div>"
"</div>\n"
]
},
{
Expand Down Expand Up @@ -822,7 +822,7 @@
" \\end{array}\\right],\n",
"$$\n",
"$$ \\myvec{d} = \\myvec{v}\\myvec{u} = 5.\n",
"$$"
"$$\n"
]
},
{
Expand Down Expand Up @@ -858,7 +858,7 @@
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"We only use the \".\" sign to denote matrix multiplication when otherwise it would be difficult to read the equation.\n",
"</div>"
"</div>\n"
]
},
{
Expand Down Expand Up @@ -888,7 +888,7 @@
"source": [
"### Diagonal matrices\n",
"\n",
"Diagonal matrices get increasingly sparse with size, so it is important to have shorthanded commands for creating them. For instance, suppose that we have the following diagonal matrix\n",
"Diagonal matrices get increasingly sparse with size, so it is important to have shorthand commands for creating them. For instance, suppose that we have the following diagonal matrix\n",
"\n",
"$$\\mymatrix{D} = \\left[\\begin{array}{ccc}\n",
" 1 & 0 & 0 \\\\\n",
Expand All @@ -897,7 +897,7 @@
" \\end{array}\\right] ,\n",
"$$\n",
"\n",
"this can be instanteated in `numpy` with"
"this can be instantiated in `numpy` with\n"
]
},
{
Expand Down Expand Up @@ -936,7 +936,7 @@
" \\end{array}\\right],\n",
"$$ \n",
"\n",
"can be instanteated in `numpy` with"
"can be instantiated in `numpy` with\n"
]
},
{
Expand Down Expand Up @@ -977,7 +977,7 @@
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"The <b>np.zeros</b> function takes a tuple to generate a properly sized matrix. Do not confuse it with <b>np.eye</b> that accepts a scalar.\n",
"</div>"
"</div>\n"
]
},
{
Expand Down Expand Up @@ -1013,7 +1013,7 @@
"\n",
"$$ e_1 = \\sin(\\phi) + 4\\cos(\\frac{\\phi}{5}).$$\n",
"\n",
"Using the `math` module which is already imported, calculate the value of $e_1$ and store it in the variable `e1` shown in the cell below."
"Using the `math` module which is already imported, calculate the value of $e_1$ and store it in the variable `e1` shown in the cell below.\n"
]
},
{
Expand Down Expand Up @@ -1045,7 +1045,7 @@
"Let\n",
"$$\\mymatrix{C}_2 = \\mymatrix{A}_2 + \\mymatrix{B}_2 + \\mymatrix{A}_2\\mymatrix{B}_2 - \\mymatrix{B}_2\\mymatrix{A}_2.$$\n",
"\n",
"Using the numpy module which is already imported, calculate the value of $\\mymatrix{C}_2$ and store it in the variable `C2` shown in the cell below."
"Using the numpy module which is already imported, calculate the value of $\\mymatrix{C}_2$ and store it in the variable `C2` shown in the cell below.\n"
]
},
{
Expand Down Expand Up @@ -1077,4 +1077,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Loading