docker pull simoncmyk/ntnu-arl:latest
docker run -it --name ntnu-arl --net=host --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --privileged simoncmyk/ntnu-arl:latest
If error try docker rm ntnu-arl
source /opt/ros/noetic/setup.bash
source devel/setup.bash
Then one may run
roslaunch rotors_gazebo mav_hovering_example.launch
Autocomplete should work with tab here.
Alternatively
Dockerfile (filename)
# Use the official ROS Noetic ROS Base image (lighter than desktop-full)
FROM ros:noetic-ros-base
# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive
# Update and install additional necessary packages
RUN apt-get update && apt-get install -y \
ros-noetic-desktop-full \
build-essential \
cmake \
git \
python3-rosdep \
python3-catkin-tools
# Initialize rosdep if not already initialized
RUN if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then \
rosdep init; \
fi
# Always update rosdep
RUN rosdep update
# Create a workspace and clone the specific repository branch
RUN mkdir -p /catkin_ws/src
WORKDIR /catkin_ws/src
# Clone the rotors_simulator repository
RUN git clone --branch ubuntu20+noetic https://github.com/ntnu-arl/rotors_simulator.git
# Clone mav_msgs from the ETHZ-ASL repository
RUN git clone https://github.com/ethz-asl/mav_comm.git
# Install any required dependencies
WORKDIR /catkin_ws
RUN rosdep install --from-paths src --ignore-src -r -y
# Build the workspace using catkin
RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && catkin_make"
# Source the workspace in every new shell
RUN echo "source /catkin_ws/devel/setup.bash" >> ~/.bashrc
# Set the working directory
WORKDIR /catkin_ws
# Default command: launch the rotor simulator
CMD ["/bin/bash", "-c", "source /opt/ros/noetic/setup.bash && source /catkin_ws/devel/setup.bash"]
Create a folder and run in a terminal inside with the Dockerfile
docker build -t rotors_simulator_noetic .
docker run -it rotors_simulator_noetic
To get into the container I had to run
docker start rotors_simulator_container
and
docker attach rotors_simulator_container
And for gazebo to work
xhost +local:docker
Once inside call
source /opt/ros/noetic/setup.bash && source devel/setup.bash
Then you should be able to
roslaunch rotors_gazebo mav_hovering_example.launch
Content type
Image
Digest
sha256:c83951eb1…
Size
1.4 GB
Last updated
about 2 years ago
docker pull simoncmyk/ntnu-arl