Virtual Coach Tutorial


#1

Hello everyone,

I installed NRP on Ubuntu 20.04 as docker installation. I am trying to go through Virtual Coach Tutorial. For this I switched to backend container and write the first command

cle-virtual-coach jupyter notebook

in the container terminal. It gives me some URLs, however I cannot open Jupyter notebook on browser with these URLs. After many trial, I skipped this and run Python interpretation by running this command

cle-virtual-coach python

After that I run this command

from hbp_nrp_virtual_coach.virtual_coach import VirtualCoach

and get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'hbp_nrp_virtual_coach'

So I cannot proceed with this tutorial. What is the problem here?


#2

Dear user,

Docker has to map port 8888 to some port of your host computer, for example the same: 8888.
For this, add these lines to nrp_installer.sh (assuming you have its latest version 1.21):
After line 83, insert:

notebook_port=`eval [ "$container" != "nrp" ] || echo -p 8888:8888`

After line 87, insert:

$notebook_port \

Your start() function should now look like this:

start(){
container=$1
eval "port=\${${container}_port}"
eval "image=\${${container}_image}"
check_port $port
ipvar=$container"_ip"
echo -e "${BLUE}Starting $container container on port $port using image $image${NC}"
iparg=`eval $is_mac || echo --ip=${!ipvar}`
notebook_port=`eval [ "$container" != "nrp" ] || echo -p 8888:8888`
echo "notebook_port = $notebook_port"
$DOCKER_CMD run -itd \
  -p $port:$port \
  $notebook_port \
  --net=nrpnet \
  $iparg \
  -v nrp_user_data:/home/bbpnrsoa/.opt/nrpStorage \
  -v nrp_models:/home/bbpnrsoa/nrp/src/Models \
  -v nrp_experiments:/home/bbpnrsoa/nrp/src/Experiments \
  --name $container $image
eval setup_$container
echo -e "${GREEN}$container container is now up and running.${NC}"
}

Now, reinstall your nrp (this will reset your Models in the backend container, so in case you changed them, make sure you back them first up)

./nrp_installer.sh install

Check that port 8888 is mapped:

docker port nrp

It should answer:

8080/tcp -> 0.0.0.0:8080
8888/tcp -> 0.0.0.0:8888

Now, open the backend container:

./nrp_installer.sh connect_backend

and in the backend terminal, run the virtual coach notebook server, but change the default ip to 0.0.0.0:

cle-virtual-coach jupyter notebook "--ip=0.0.0.0"

Give the url given in your host computer browser, for example on my computer, it was:
http://localhost:8888/?token=f027e20b23dd04d34ec827c6ff8ee402ccdf4c775d440766

If you have issues with port 8888, try mapping another host port by giving the “-p <other_port>:8888” in line 84 of nrp_installer.sh.

This should work for you.

Best regards
Axel


#3

Fyi, I added this as a permanent feature request for the dev team:
https://hbpneurorobotics.atlassian.net/browse/NUIT-262

thanks for reporting.


#4

I just have to add to axel’s complete answer that importing VirtualCoach has changed from :

from hbp_nrp_virtual_coach import virtual_coach

to:

from pynrp import virtual_coach

in version 3.1 which is equivalent to latest docker tag currently.


#5

The issue has been fixed and the fix will be available in the next release.


#6

One (perhaps obvious) addition: I have NRP installed on a remote server, so I had to replace the ip given in the url of my local browser by the ip of the remote machine, i.e.
http://<ip_remote>:8888/?token=f027e20b23dd04d34ec827c6ff8ee402ccdf4c775d440766.