mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-09-15 07:40:20 +08:00
Docker: Updated kinetic and melodic images to use less time to build
This commit is contained in:
+8
-15
@@ -1,20 +1,13 @@
|
||||
### Docker
|
||||
|
||||
* Create rtabmap image (example with melodic) from this Dockerfile:
|
||||
```dockerfile
|
||||
FROM ros:melodic-perception
|
||||
# install rtabmap packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ros-melodic-rtabmap \
|
||||
ros-melodic-rtabmap-ros \
|
||||
&& rm -rf /var/lib/apt/lists/
|
||||
* Available images (https://hub.docker.com/repository/docker/introlab3it/rtabmap_ros):
|
||||
```
|
||||
* To build an image with latest rtabmap version from source, use Dockerfile inside one of the `latest` subdirectories.
|
||||
introlab3it/rtabmap_ros:indigo-latest
|
||||
introlab3it/rtabmap_ros:kinetic-latest
|
||||
introlab3it/rtabmap_ros:melodic-latest
|
||||
```
|
||||
* Those images are automatically built from latest version of `rtabmap` and `rtabmap_ros` from source.
|
||||
|
||||
* Build it:
|
||||
```bash
|
||||
$ docker build --tag ros:rtabmap .
|
||||
```
|
||||
|
||||
* The following example show how to launch a camera on host computer and run our pre-built rtabmap container. All examples from [RGB-D tutorial](http://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping) and [stereo tutorial](http://wiki.ros.org/rtabmap_ros/Tutorials/StereoHandHeldMapping) should work using rtabmap from the container instead. Launch camera on host computer (set ROS_IP as the IP used for docker):
|
||||
```bash
|
||||
@@ -24,11 +17,11 @@
|
||||
$ export ROS_NAMESPACE=rtabmap && rosrun rtabmap_ros rtabmapviz _frame_id:=camera_link
|
||||
```
|
||||
|
||||
* Launch rtabmap from inside the container, saving the database on host `~/.ros/rtabmap.db`:
|
||||
* Launch `rtabmap` from inside the container (no gui), saving the database on host `~/.ros/rtabmap.db`:
|
||||
```bash
|
||||
$ docker run -it --rm \
|
||||
--env ROS_MASTER_URI=http://172.17.0.1:11311 --env ROS_IP=172.17.0.2 \
|
||||
-v ~/.ros:/root \
|
||||
ros:rtabmap \
|
||||
introlab3it/rtabmap_ros:kinetic-latest \
|
||||
roslaunch rtabmap_ros rtabmap.launch rtabmapviz:=false database_path:=/root/rtabmap.db rtabmap_args:="--delete_db_on_start"
|
||||
```
|
||||
|
||||
@@ -1,35 +1,13 @@
|
||||
FROM ros:kinetic-perception
|
||||
# install rtabmap packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ros-kinetic-rtabmap-ros \
|
||||
&& apt-get remove -y \
|
||||
ros-kinetic-rtabmap \
|
||||
&& rm -rf /var/lib/apt/lists/
|
||||
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
|
||||
WORKDIR /root/
|
||||
FROM introlab3it/rtabmap:16.04
|
||||
|
||||
ARG CACHE_DATE=2016-01-01
|
||||
|
||||
RUN git clone https://github.com/introlab/rtabmap.git
|
||||
|
||||
# Build RTAB-Map project
|
||||
RUN source /ros_entrypoint.sh && \
|
||||
cd rtabmap/build && \
|
||||
cmake .. && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
cd ../.. && \
|
||||
rm -rf rtabmap && \
|
||||
ldconfig
|
||||
|
||||
RUN source /ros_entrypoint.sh && \
|
||||
mkdir -p catkin_ws/src && \
|
||||
cd catkin_ws/src && \
|
||||
catkin_init_workspace && \
|
||||
git clone https://github.com/introlab/rtabmap_ros.git && \
|
||||
cd .. && \
|
||||
catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic install && \
|
||||
catkin_make -j1 -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic install && \
|
||||
cd && \
|
||||
rm -rf catkin_ws
|
||||
|
||||
@@ -1,35 +1,13 @@
|
||||
FROM ros:melodic-perception
|
||||
# install rtabmap packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ros-melodic-rtabmap-ros \
|
||||
&& apt-get remove -y \
|
||||
ros-melodic-rtabmap \
|
||||
&& rm -rf /var/lib/apt/lists/
|
||||
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
|
||||
WORKDIR /root/
|
||||
FROM introlab3it/rtabmap:18.04
|
||||
|
||||
ARG CACHE_DATE=2016-01-01
|
||||
|
||||
RUN git clone https://github.com/introlab/rtabmap.git
|
||||
|
||||
# Build RTAB-Map project
|
||||
RUN source /ros_entrypoint.sh && \
|
||||
cd rtabmap/build && \
|
||||
cmake .. && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
cd ../.. && \
|
||||
rm -rf rtabmap && \
|
||||
ldconfig
|
||||
|
||||
RUN source /ros_entrypoint.sh && \
|
||||
mkdir -p catkin_ws/src && \
|
||||
cd catkin_ws/src && \
|
||||
catkin_init_workspace && \
|
||||
git clone https://github.com/introlab/rtabmap_ros.git && \
|
||||
cd .. && \
|
||||
catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/melodic install && \
|
||||
catkin_make -j1 -DCMAKE_INSTALL_PREFIX=/opt/ros/melodic install && \
|
||||
cd && \
|
||||
rm -rf catkin_ws
|
||||
|
||||
Reference in New Issue
Block a user