Skip to content

Commit

Permalink
Create ros2 migration branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe Quaratino committed May 16, 2024
1 parent 7eaf5a1 commit 36b06ca
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
53 changes: 53 additions & 0 deletions ros2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM osrf/ros:humble-desktop-full

WORKDIR /root/humble_dev_ws

RUN sudo apt-get update && apt-get install -y \
cmake \
curl \
ros-humble-imu-tools \
iputils-ping\
libglu1-mesa-dev \
nano \
python3-pip \
python3-pydantic \
ros-dev-tools \
ruby-dev \
rviz \
tmux \
wget \
xorg-dev \
vim

RUN pip3 install setuptools==58.2.0
RUN pip3 install python-statemachine pyserial

RUN wget https://github.com/openrr/urdf-viz/releases/download/v0.38.2/urdf-viz-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvzf urdf-viz-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/ && \
chmod +x /usr/local/bin/urdf-viz && \
rm -f urdf-viz-x86_64-unknown-linux-gnu.tar.gz

RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

RUN echo "export DISABLE_AUTO_TITLE=true" >> /root/.bashrc
RUN echo 'LC_NUMERIC="en_US.UTF-8"' >> /root/.bashrc
RUN echo "source /opt/ros/humble/setup.bash" >> /root/.bashrc

RUN echo 'alias rosdi="rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y"' >> /root/.bashrc
RUN echo 'alias cbuild="colcon build --symlink-install"' >> /root/.bashrc
RUN echo 'alias ssetup="source ./install/local_setup.bash"' >> /root/.bashrc

# RUN echo "autoload -U bashcompinit" >> /root/.bashrc
# RUN echo "bashcompinit" >> /root/.bashrc
RUN echo 'eval "$(register-python-argcomplete3 ros2)"' >> /root/.bashrc
RUN echo 'eval "$(register-python-argcomplete3 colcon)"' >> /root/.bashrc

RUN echo 'source /opt/ros/humble/setup.bash' >> /root/.bashrc
RUN echo 'export RMW_IMPLEMENTATION=rmw_fastrtps_cpp' >> /root/.bashrc
RUN echo 'export ROS_DOMAIN_ID=0' >> /root/.bashrc

RUN apt update && apt upgrade -y

CMD ["bash"]
16 changes: 16 additions & 0 deletions ros2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'

services:
ros2_master:
build: ./
container_name: ros2_master
tty: true
privileged: true
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
network_mode: host
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- ./:/root/humble_dev_ws/
- /dev/ttyACM0:/dev/ttyACM0

0 comments on commit 36b06ca

Please sign in to comment.