# Use the official ROS Kinetic base image
FROM osrf/ros:kinetic-desktop-full
# Install Ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get install -y \
software-properties-common \
&& apt-add-repository universe \
&& apt-get update \
&& apt-get install -y \
ubuntu-desktop \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Update package lists
RUN apt-get update
# Install X11 apps
RUN apt-get install -y x11-apps
# Install Python development tools and libraries
RUN apt-get install -y \
python-catkin-tools \
python-pip \
python-dev \
libssl-dev \
libffi-dev
# Install miscellaneous tools
RUN apt-get install -y \
cmake \
wget \
git \
nano \
vim \
tmux \
net-tools
# Install ROS packages
RUN apt-get install -y \
ros-kinetic-driver-base \
ros-kinetic-move-base-msgs \
ros-kinetic-octomap \
ros-kinetic-octomap-msgs \
ros-kinetic-humanoid-msgs \
ros-kinetic-humanoid-nav-msgs \
ros-kinetic-camera-info-manager \
ros-kinetic-camera-info-manager-py
RUN apt update
RUN apt -y upgrade
# Clean up APT cache to reduce image size
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
#Installing NAOqi drivers
RUN pip install qi
RUN mkdir /naoqi
WORKDIR /naoqi
RUN tar xzf naoqi-sdk-2.5.5.5-linux64.tar.gz
RUN tar xzf pynaoqi-python2.7-2.5.5.5-linux64.tar.gz
RUN echo 'export PYTHONPATH=${PYTHONPATH}:naoqi/pynaoqi-python2.7-2.5.5.5-linux64/lib/python2.7/site-packages' >> ~/.bashrc
RUN echo 'export QI_SDK_PREFIX=naoqi/pynaoqi-python2.7-2.5.5.5-linux64' >> ~/.bashrc
RUN apt update
RUN apt -y upgrade
RUN apt-get install -y ros-kinetic-nao-robot
#Retun back to the home directory
WORKDIR /
# Setup Catkin workspace
RUN mkdir -p /catkin_ws/src
WORKDIR /catkin_ws/src
RUN apt update
RUN apt -y upgrade
RUN rosdep install -i -y --from-paths ./naoqi_driver
# Initialize Catkin workspace
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && catkin_init_workspace"
RUN apt update
RUN apt -y upgrade
# Build the Catkin workspace
WORKDIR /catkin_ws
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && catkin_make"
# Source the setup script to set up ROS environment variables
RUN echo "source /opt/ros/kinetic/setup.bash" >> /root/.bashrc
# Source the setup script for the Catkin workspace
RUN echo "source /catkin_ws/devel/setup.bash" >> /root/.bashrc
RUN apt update
RUN apt -y upgrade
#Retun back to the home directory
WORKDIR /
# Set up entry point
CMD ["bash"]
# Set the display environment variable
ENV DISPLAY=0
ENV QT_X11_NO_MITSHM=1
############################# Build command #############################
#sudo docker build -t ros1pepper --build-arg DISPLAY=$DISPLAY .
############################# Run command #############################
#sudo docker run -it --rm --privileged --gpus all --name roskinetic --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ros1pepper
############################# Run the following as soon as you run the docker file to download the dependencies required for the robot #############################
#sudo dpkg-reconfigure debconf (tab to move around and enter to select) select Dialog and low in the window
#sudo apt-get install ros-kinetic-pepper-.*
############################# Command to open a new terminal #############################
#sudo docker exec -it --privileged roskinetic /bin/bash
############################# Display error ############################## xhost +local: