Skip to content

Commit

Permalink
Remove unused imports and fix f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Oct 25, 2024
1 parent 376e3f8 commit 79f6d67
Showing 1 changed file with 35 additions and 38 deletions.
73 changes: 35 additions & 38 deletions examples/mpc-ik.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/ami-iit/adam/blob/main/examples/mpc-ik.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "MmkmgG_gGWVi"
},
"source": [
"## Install Mujoco, adam, and mediapy.\n",
"\n",
"Download also mujoco-menagerie for the panda model and the urdf needed from adam.\n",
"Set some stuff for the visualization."
],
"metadata": {
"id": "MmkmgG_gGWVi"
}
]
},
{
"cell_type": "code",
Expand All @@ -47,12 +47,12 @@
},
{
"cell_type": "markdown",
"source": [
"## Import packages"
],
"metadata": {
"id": "Dz4cHPy2Gtmq"
}
},
"source": [
"## Import packages"
]
},
{
"cell_type": "code",
Expand All @@ -66,20 +66,17 @@
"import mediapy as media\n",
"from adam.casadi import KinDynComputations\n",
"import numpy as np\n",
"import casadi as cs\n",
"import distutils.util\n",
"import os\n",
"import subprocess"
"import casadi as cs"
]
},
{
"cell_type": "markdown",
"source": [
"## Import the panda scene in mujoco"
],
"metadata": {
"id": "2zw4FO-IGxdR"
}
},
"source": [
"## Import the panda scene in mujoco"
]
},
{
"cell_type": "code",
Expand All @@ -95,17 +92,17 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "CZMO7PsmKUB6"
},
"source": [
"## Import urdf in adam\n",
"\n",
"Set the commanded joint list and impor the urdf in adam.\n",
"\n",
"For now I have to use a separate urdf for adam.\n",
"An importer for a mujoco model could be an idea for the future!"
],
"metadata": {
"id": "CZMO7PsmKUB6"
}
]
},
{
"cell_type": "code",
Expand All @@ -122,12 +119,12 @@
},
{
"cell_type": "markdown",
"source": [
"## A wrapper interface with mujoco"
],
"metadata": {
"id": "g5LX5kQAKwaM"
}
},
"source": [
"## A wrapper interface with mujoco"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -173,15 +170,15 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "wuY9hqdlD3Vo"
},
"source": [
"# Model Inverse Kinematics as an MPC\n",
"\n",
"An MPC is maybe not the best way to solve an IK problem.\n",
"I just want to show how to use the casadi interface."
],
"metadata": {
"id": "wuY9hqdlD3Vo"
}
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -239,6 +236,9 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "Hf-Uq8PWFy6v"
},
"source": [
"# Simulation loop\n",
"\n",
Expand All @@ -247,10 +247,7 @@
"\n",
"On the notebook it is a bit slow.\n",
"To run it real time set OMP_NUM_THREADS=1 on your laptop!"
],
"metadata": {
"id": "Hf-Uq8PWFy6v"
}
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -314,6 +311,10 @@
}
],
"metadata": {
"colab": {
"include_colab_link": true,
"provenance": []
},
"kernelspec": {
"display_name": "adam_env",
"language": "python",
Expand All @@ -330,10 +331,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
},
"colab": {
"provenance": [],
"include_colab_link": true
}
},
"nbformat": 4,
Expand Down

0 comments on commit 79f6d67

Please sign in to comment.