awesomebytes / pepper_virtual

13 stars 9 forks source link

Add docker integration #7

Open awesomebytes opened 3 years ago

awesomebytes commented 3 years ago

Hey @frietz58 I just saw your awesome fork (https://github.com/frietz58/pepper_virtual). I was meant to Dockerize it but had a bunch of issues and never got to finish it.

I'd like to help you/collaborate on improving it. An easy thing that can be done to improve it is:

Push a built docker image to DockerHub (or somewhere else). This way people can run the simulation with just pulling it and running. It also can avoid the looong wait of the first time of opening Gazebo where it downloads some models.

You also mention: I found that adding trying th add any of the camera topics to RVIZ crashes the gazebo simulation... However, other topics work fine. I've never seen this happen. But I suspect it will have to do with the GPU, and I suspect further that if doing --privileged on the docker run command it may work.

P.S.: I wanted to keep the conversation public that's why I enabled Issues in my repo and created it. Given I won't be able to maintain this project, you may want to enable Issues in your fork instead.

frietz58 commented 3 years ago

I've opened a pull-request that addresses the installation via dockerfile (or pull from dockerhub) and shows how to replicate your example in docker.

Regarding gazebo crashing when the camera topics are displayed in RVIZ: I'm still not exactly sure what is happening there, but it definitely has to do something with the graphics driver and or docker. Running the container privileged didn't make a difference for me, however, when I launch the container through rocker, the issue no longer occurs! Interestingly, I had a bunch of issues with gazebo in docker after installing CUDA on my system, which all got resolved when I started launching the container with rocker...

Thanks again for your improved pepper model, thanks to this repo I could make some progress with ROS and Pepper while our lab remains close due to covid :/

awesomebytes commented 3 years ago

Just merged your PR, thanks a lot!

I've also added a script called start_docker.sh: https://github.com/awesomebytes/pepper_virtual/blob/simulation_that_works/start_docker.sh that can give you an example of how to launch docker with Nvidia support.

It is based on some docker juggling I do at work, so I know it works (I use similar stuff everyday). Warning it's ugly! But it works in all the machines I have around, has a few warning on what you may need, etc. It also contains a useful trick to load your local repository folder into the docker folder, so you can edit happily on your host machine and play around with the docker container shells.

Screenshot from 2021-03-23 23-49-50

I've tried your pre-compiled container, and I love it! So easy to get gazebo running! That said, I experience an issue with it: If I misstype any command, or autocomplete some stuff (like roscd pepper_[PRESS TAB HERE]) the docker shell dies for some reason. I haven't digged deeper (it's too late) but you may want to fix that?

I didn't know that rocker project. Funny, it's the third 'rocker' project I've seen that adds things to docker. I used one that allowed to do whatever you wanted on the build step a couple of years ago. It was great, but it was discontinued.

Again, thanks a lot for keeping my work alive. I hope you are able to do all the work you need with these tools and get to try on a real robot soon!