Initial commit

This commit is contained in:
2025-12-22 03:35:48 +03:00
commit 73295bcb28
8 changed files with 233 additions and 0 deletions

34
Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
FROM ros:jazzy-ros-base-noble
# Install pyserial
RUN apt-get update && apt-get install -y \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --break-system-packages pyserial
# Create workspace
WORKDIR /ros2_ws
# Copy the package
COPY ultrasonic_sensor /ros2_ws/src/ultrasonic_sensor
# Build the package
RUN . /opt/ros/jazzy/setup.sh && \
colcon build --packages-select ultrasonic_sensor
# Source setup in bashrc for interactive use
RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \
echo "source /ros2_ws/install/setup.bash" >> ~/.bashrc
# Create entrypoint script
RUN echo '#!/bin/bash\n\
set -e\n\
source /opt/ros/jazzy/setup.bash\n\
source /ros2_ws/install/setup.bash\n\
exec "$@"' > /ros2_entrypoint.sh && \
chmod +x /ros2_entrypoint.sh
ENTRYPOINT ["/ros2_entrypoint.sh"]
CMD ["ros2", "run", "ultrasonic_sensor", "ultrasonic_node"]