elephantrobotics/mycobot_ros

Run MoveIt tutorial from Docker

mostlyjason opened this issue · 1 comments

Hi I followed the instructions in tutorial posted on the ROS wiki to run the project in Docker. When I got to Step 3.3 for MoveIt, it said to run the command roslaunch mycobot_ros mycobot_moveit.launch. It wasn't clear to me how to run this command inside the Docker container. I tried to exec into the container and the bash environment is not setup correctly.

$ d exec -it mycobot_ros_nvidia-ros_1 /bin/bash
root@3cf5ce98d945:/catkin_ws# roslaunch
bash: roslaunch: command not found

I'm not sure the best way to run this command, so I opened up the docker-compose.yml file and I added this command to services. I was able to get it running successfully.

nvidia-moveit:
    <<: *common
    command: [ "roslaunch mycobot_320_moveit mycobot320_moveit.launch" ]
    runtime: nvidia

Does it make sense to add this to the docker-compose file or is a better way to run it? Happy to submit a PR if it'd be helpful.

Also, the documentation does not mention it, but I had to install the nvidia-docker2 system package on Ubuntu to get the Nvidia runtime installed. As of Docker 19.03 I think its not required anymore, but it wouldn't run without it. See here to learn more https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html

Would it make sense to mention these details in the documentation?

An easier way to do this would be to change the following line in the docker-compose.yml from

  command: [ "roslaunch mycobot_320 mycobot_320_slider.launch" ]

to

  command: [ "roslaunch ${LAUNCH_TARGET:-mycobot_320 mycobot_320_slider.launch}" ]

Which sets the default value for the LAUNCH_TARGET documentation, but allows it to be configurable. Then in the documentation explain that if you want to change the roslaunch target, to set the environment variable LAUNCH_TARGET. In your case, you would do:

export LAUNCH_TARGET=mycobot_ros mycobot_moveit.launch