Skip to content

Commit

Permalink
Update pip installation
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Dec 6, 2023
1 parent 3504af2 commit 3884b57
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions examples/PD_controller.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -52,7 +45,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -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",
Expand All @@ -105,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -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",
Expand All @@ -146,6 +130,15 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"world.meshcat_visualizer.render_static()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 3884b57

Please sign in to comment.