Skip to content

Commit

Permalink
Set DISPLAY environment variable for Colab
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed May 21, 2024
1 parent 132b357 commit bea65bc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/PD_controller.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@
"\n",
"# Install JAX and Gazebo SDF\n",
"if IS_COLAB:\n",
" !{sys.executable} -m pip install -qU jaxsim\n",
" !{sys.executable} -m pip install -qU jaxsim[viz]\n",
" !apt install -qq lsb-release wget gnupg\n",
" !wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg\n",
" !echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main\" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null\n",
" !apt -qq update\n",
" !apt install -qq --no-install-recommends libsdformat13 gz-tools2\n",
"\n",
" # Optional dependency for visualization\n",
" !{sys.executable} -m pip install pyvirtualdisplay\n",
" !apt install xvfb\n",
"\n",
" # Start Xvfb and set \"DISPLAY\" environment variable\n",
" import pyvirtualdisplay\n",
" d = pyvirtualdisplay.Display()\n",
" d.start()\n",
"\n",
" clear_output()\n",
"\n",
"import jax\n",
Expand Down

0 comments on commit bea65bc

Please sign in to comment.