FROM introlab3it/rtabmap_ros:noetic-latest
 
# Change the default shell to Bash
SHELL [ "/bin/bash" , "-c" ]

# Install Git
RUN apt update 

RUN apt install -y                     \
    vim \
    git \
# Install ROS dependences for Ouster ROS driver
    ros-noetic-pcl-ros             \
    ros-noetic-rviz \
# Install build dependencies for Ouster ROS driver
    build-essential         \
    libeigen3-dev           \
    libjsoncpp-dev          \
    libspdlog-dev           \
    libcurl4-openssl-dev    \
    cmake \
# Install dependencies for GPS driver 
    usbutils \
# Install dependencies of GPS driver
    ros-noetic-serial \
    ros-noetic-nmea-navsat-driver \ 
# fix python issue with ROS TCP endpoint
    python-is-python3 \
# install ROS utilities 
    ros-noetic-tf2-tools \
# install ping for troubleshooting network issues
    iputils-ping \
# install netcat for configuring Ouster and query time from docker container
    netcat

# Create a Catkin workspace
RUN source /opt/ros/noetic/setup.bash \
 && mkdir -p /3DMS_ws/src \
 && cd /3DMS_ws/src \
 && catkin_init_workspace

RUN source /opt/ros/noetic/setup.bash \
 && cd /3DMS_ws \
 && catkin_make

# Remember to add git clone of 3DMS repositories into dockerfile when they are more developed

RUN echo "source /3DMS_ws/devel/setup.bash" >> ~/.bashrc

# Set the working folder at startup
WORKDIR /3DMS_ws