0

Drake on Colab. Installation and setup issue.

I used the installation and setup code at the Colab scratchpad link in Appendix A.3 Run an example of the Underactuated Robotics book. I believe Colab executes the code on the cloud so I don't need to do any setup on my machine. I am using Firefox 66.0.2 (64-bit) on Ubuntu 16.04 LTS.

The Colab scratchpad code I am trying to run is copied below for convenience:

# Install drake and the underactuated source repo (only if necessary) and set up the path.  Run this first!
try:
  import pydrake
  import underactuated
except ImportError:
  !curl -s https://raw.githubusercontent.com/RussTedrake/underactuated/master/scripts/setup/jupyter_setup.py > jupyter_setup.py
  from jupyter_setup import setup_underactuated
  setup_underactuated()
# Note: On Google's Colaboratory, this will take a minute, but should only need to reinstall once every 12 hours.
# Colab will ask you to "Reset all runtimes"; say no to save yourself the reinstall.

import os
underactuated_src_dir = os.path.dirname(os.path.dirname(os.path.abspath(underactuated.__file__)))

This is the error I get:

/bin/bash: underactuated/scripts/setup/ubuntu/16.04/install_prereqs: No such file or directory


NameErrorTraceback (most recent call last)

<ipython-input-1-2d88a7eca137> in <module>()
     10 
     11 import os
---> 12 underactuated_src_dir = os.path.dirname(os.path.dirname(os.path.abspath(underactuated.__file__)))

NameError: name 'underactuated' is not defined

The instructions say that I should run this before running any of the examples in the textbook, so I cannot run any of the examples on Colab.

Bourbaki
  • 1
  • 1
  • Should be fixed. Please try it again now? – Russ Tedrake Apr 11 '19 at 00:58
  • @RussTedrake Thank you. I was able to install and run the double pendulum example in simulator.ipynb. How do I run other examples? I tried to run Example 3.2 in the book (cart-pole) by copying the code from http://underactuated.csail.mit.edu/src/cartpole/force_slider_demo.py into the same Colab notebook. I get the following error: ipykernel_launcher.py: error: unrecognized arguments: -f /root/.local/share/jupyter/runtime/kernel-b355e7db-8a7d-40f7-90f9-5d7ae113971b.json – Bourbaki Apr 12 '19 at 02:06

0 Answers0