Ask Your Question
0

Use map_server inside Docker : node won't launch

asked 2017-11-01 08:41:53 -0500

GuillaumeHauss gravatar image

Hi all,

I'm working with this tutorial to simulate an environment and test my sensors set to benchmark localization and navigation algorithms. I can launch the tutorial with my custom world and sensors, that's okay ; but I can't find a way to load a static map in Rviz. I added a node in the launch file, as usual and the error log is the following:

ERROR: cannot launch node of type [map_server/map_server]: map_server
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/tmp/workspace/src
ROS path [2]=/opt/ros/kinetic/share

So here I am checking on my computer on these locations if I have the map_server package. Obviously, as I have already used it before, I found it in

/opt/ros/kinetic/share

However, I know that Docker creates its own container, and loads ROS packages into it. So I fired up a terminal, typed

docker ps -l

to get the name of the actual docker. Then

docker exec -it <docker_container_name> bash

to open up an interactive console within the container. Then

cd /opt/ros/kinetic/share; ls

And here is the trick : there is no map_server package here. So the node can't be launched. Thus, my question is pretty simple: how can I "pass" the map_server package inside the Docker container, or any other package after that, without using a tremendous number of plugins and tricky command lines?

Thank you very much for your help!

Guillaume

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-11-01 09:04:59 -0500

GuillaumeHauss gravatar image

Found it! you need to modify the Dockerfile that create your image. Add this:

# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list 

# install ros packages
ENV ROS_DISTRO kinetic
RUN apt-get update && apt-get install -y \
   ros-kinetic-map-server \
   ros-kinetic-amcl \
   ros-kinetic-hector-slam \
   <any_ros_package> \
&& rm -rf /var/lib/apt/lists/*

However, this not solve the issue in case of house-made package. So a better, more flexible solution might still be suitable!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-11-01 08:41:53 -0500

Seen: 105 times

Last updated: Nov 01 '17