From 3762efa00286b512defa345fe2b00c5937612330 Mon Sep 17 00:00:00 2001 From: holzheim <jan.holzheim@online.de> Date: Sun, 16 Apr 2023 10:25:35 +0200 Subject: [PATCH] Updated task --- .../01_Tutorial_PythonIntroduction.ipynb | 56 ++++++------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/01_IntroductionToPython/01_Tutorial_PythonIntroduction.ipynb b/01_IntroductionToPython/01_Tutorial_PythonIntroduction.ipynb index a40e5ca..5461f1e 100644 --- a/01_IntroductionToPython/01_Tutorial_PythonIntroduction.ipynb +++ b/01_IntroductionToPython/01_Tutorial_PythonIntroduction.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "id": "1a932130-baf8-499d-b2a2-16ec25b2b6b2", "metadata": {}, @@ -11,9 +12,9 @@ "\n", "## Task 1.1\n", "\n", - "The **forward_kinematics** function from the [forward_kinematics module](https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023/-/blob/main/01_IntroductionToPython/forward_kinematics.py) is implemented for an manipulator of **n links** and **n+1 revolute joints** that starts from an **initial position** with all joint rotations $\\theta=0$.\n", + "The **forward_kinematics** function from the [forward_kinematics module](https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023/-/blob/main/01_IntroductionToPython/forward_kinematics.py) is implemented for an manipulator of **n links** and **n+1 revolute joints** that starts from an **initial position** with all joint rotations $\\theta_i=0$.\n", "\n", - "Implement a function named **fk_task_1** inside the [forward_kinematics module](https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023/-/blob/main/01_IntroductionToPython/forward_kinematics.py) that ***returns*** a list which contains for each time step all joint coordinates $x_i$ and $y_i$ for a manipulator (**n links** and **n+1 revolute joints**) with an initial joint rotation that is described by the current rotations $\\theta_{i,0}$ and the desired incremental joint rotations at time t $\\Delta\\theta_{i,t}$ for joint i. The base link is rotating around the given point $[x_0 = 0, y_0 = 1]$. \n", + "Implement a function named **fk_task_1** inside the [forward_kinematics module](https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023/-/blob/main/01_IntroductionToPython/forward_kinematics.py) that ***returns*** a list which contains for each time step all joint coordinates $x_i$ and $y_i$ for a manipulator (**n links** and **n+1 revolute joints**) with an initial joint rotation that is described by the current rotations $\\theta_{i,t}$ for joint i at time t and the desired incremental joint rotations $\\Delta\\theta_{i,t+1}$ for joint i at time t + 1. The base link is rotating around the given point $[x_0 = 0, y_0 = 1]$. \n", "\n", "Test the implemented function inside this jupyter notebook in the following cells. Use the given structure to\n", "\n", @@ -24,20 +25,18 @@ " - initial joint roations $\\theta_{i,t=0}=[90,0,0,0,0]$ in degree\n", " - incremental change of joint rotation $\\Delta\\theta_{i,t=1} = [0,0,90,-30,45]$\n", "3. **Call** the 'fk_task_1' **function** and save the return values under appropriate named variables.\n", - "4. **Create** a **plot** containing the initial manipulator position (red) and the position after incremental rotation (green).\n", + "4. **Create** a **plot** containing the initial manipulator position and the position after incremental rotation. Choose for each time step a different color.\n", "\n", - "**Hint:** Use the the data type [array](https://numpy.org/doc/stable/reference/arrays.ndarray.html) from the [numpy package](https://numpy.org/doc/stable/) to define define the variables which contains sequence of values. That allows you to use arithmetic operators directly on the variables.\n" + "**Hints:** \n", + "- Use the the data type [array](https://numpy.org/doc/stable/reference/arrays.ndarray.html) from the [numpy package](https://numpy.org/doc/stable/) to define the variables which contain a sequence of values. That allows you to use arithmetic operators directly on the variables.\n", + "- To implement **fk_task_1** you can make use of already existing functions inside of the [forward_kinematics module](https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023/-/blob/main/01_IntroductionToPython/forward_kinematics.py).\n" ] }, { "cell_type": "code", "execution_count": 54, "id": "59a9ad77-e04e-40ac-83d6-2e379901020f", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "# Use this cell to import the necessary modules" @@ -47,11 +46,7 @@ "cell_type": "code", "execution_count": 122, "id": "2e47f84e-0363-4a6c-a148-41a4ef2614ea", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "# Use this cell to define the gemoetry and rotation parameters" @@ -61,11 +56,7 @@ "cell_type": "code", "execution_count": 124, "id": "22db17d3-491b-480d-87ac-eff27acb3712", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "# Use this cell to call the function 'fk_task_1'" @@ -75,11 +66,7 @@ "cell_type": "code", "execution_count": 125, "id": "c12897f2-b5d4-4f8c-9d22-0f9511780a23", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -111,11 +98,7 @@ "cell_type": "code", "execution_count": null, "id": "9dfed8f7", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "# Calculation of the incremental rotation steps to reach the final rotation position" @@ -125,11 +108,7 @@ "cell_type": "code", "execution_count": null, "id": "1716ad7e", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "# Use this cell to call the function 'fk_task_1'" @@ -139,11 +118,7 @@ "cell_type": "code", "execution_count": 134, "id": "c698d670-1f83-4d34-9b96-4b1662878030", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -168,7 +143,8 @@ "name": "python3" }, "language_info": { - "name": "" + "name": "python", + "version": "3.10.6" } }, "nbformat": 4, -- GitLab