diff --git a/examples/PD_controller.ipynb b/examples/PD_controller.ipynb index 9a46f38b3..a220d03f6 100644 --- a/examples/PD_controller.ipynb +++ b/examples/PD_controller.ipynb @@ -15,23 +15,16 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\u001b[34mjaxsim[85289]\u001b[0m \u001b[1;30mINFO\u001b[0m Running on [cuda(id=0)]\n" - ] - } - ], + "outputs": [], "source": [ "from IPython.display import clear_output, HTML\n", + "import sys \n", "\n", "# Install JAX and Gazebo\n", - "!pip install -U -q \"jax[cuda12_pip]\" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html\n", - "!pip install -q git+https://github.com/ami-iit/jaxsim@new_api\n", + "!{sys.executable} -m pip install -U -q \"jax[cuda12_pip]\" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html\n", + "!{sys.executable} -m pip install -U -q jaxsim\n", "!apt -qq update && apt install -qq --no-install-recommends gazebo\n", "clear_output()\n", "\n", @@ -52,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -76,18 +69,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\u001b[34mjaxsim[85289]\u001b[0m \u001b[1;30mINFO\u001b[0m Combining the pose of base link 'rail' with the pose of joint 'world_to_rail'\n", - "\u001b[34mjaxsim[85289]\u001b[0m \u001b[1;30mINFO\u001b[0m The kinematic graph doesn't need to be reduced\n" - ] - } - ], + "outputs": [], "source": [ "from jaxsim.high_level.model import Model\n", "\n", @@ -105,7 +89,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -132,7 +116,7 @@ "try:\n", " from meshcat_viz.world import MeshcatWorld\n", "except:\n", - " !pip install -q git+https://github.com/ami-iit/meshcat-viz-python\n", + " !{sys.executable} -m pip install -q git+https://github.com/ami-iit/meshcat-viz-python\n", " clear_output()\n", " from meshcat_viz.world import MeshcatWorld\n", "\n", @@ -146,6 +130,15 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "world.meshcat_visualizer.render_static()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -191,7 +184,6 @@ "KP = 10.0\n", "KD = 1.0\n", "\n", - "\n", "def pd_controller(\n", " q: jax.Array, q_d: jax.Array, q_dot: jax.Array, q_dot_d: jax.Array\n", ") -> jax.Array:\n",