#Simon Tscherne
FROM osrf/ros:noetic-desktop-full
 
# Change the default shell to Bash
SHELL [ "/bin/bash" , "-c" ]
 
# Install some needed stuff
RUN apt update && apt install -y git vim liborocos-kdl-dev python3 python-is-python3 python3-pip tmux

RUN pip install imutils opencv-python


RUN source ./ros_entrypoint.sh \
 && mkdir -p /catkin_ws/src \
 && cd /catkin_ws/ \
 && catkin_make \
 && cd src/ \
 && git clone https://github.com/turtlebot/turtlebot.git \
 && git clone https://github.com/turtlebot/turtlebot_msgs.git \
 && git clone https://github.com/turtlebot/turtlebot_apps.git \
 && git clone https://github.com/turtlebot/turtlebot_simulator \
 && git clone https://github.com/yujinrobot/yujin_ocs.git \
 && mv yujin_ocs/yocs_cmd_vel_mux yujin_ocs/yocs_controllers yujin_ocs/yocs_velocity_smoother . \
 && rm -rf yujin_ocs \
 && git clone https://github.com/yujinrobot/kobuki.git

RUN source ./ros_entrypoint.sh \
 && cd /catkin_ws/src \
 && rosdep install --from-paths . --ignore-src -r -y \
 && cd .. \
 && source ./devel/setup.bash \
 && catkin_make \
 && cd build \
 && make install
 
RUN echo "source /ros_entrypoint.sh" >> ~/.bashrc
RUN echo "source /catkin_ws/devel/setup.bash" >> ~/.bashrc

#Now astra camera

RUN apt install -y libgflags-dev  ros-noetic-image-geometry ros-noetic-camera-info-manager ros-noetic-image-transport ros-noetic-image-publisher libgoogle-glog-dev libusb-1.0-0-dev libeigen3-dev

RUN git clone https://github.com/libuvc/libuvc.git \
&& cd libuvc \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make -j4 \
&& sudo make install \
&& sudo ldconfig

RUN source /catkin_ws/devel/setup.bash \
&& cd /catkin_ws/src \
&& git clone https://github.com/orbbec/ros_astra_camera.git \
&& rosdep install --from-paths . --ignore-src -r -y \
&& cd .. \
&& catkin_make \
&& roscd astra_camera


# Set the working folder at startup
WORKDIR /catkin_ws
