Skip to content

Commit

Permalink
Update build files and script.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpolzin committed May 8, 2024
1 parent 877b1f0 commit dd6c32d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FROM ros:${ROS_DISTRO}-ros-core
RUN apt update && apt install -y --no-install-recommends \
build-essential \
python3-colcon-common-extensions \
libpcap0.8-dev \
ros-humble-yaml-cpp-vendor \
&& rm -rf /var/lib/apt/lists/*

COPY ros_entrypoint.sh .
Expand All @@ -17,5 +19,5 @@ COPY rslidar_msg src/rslidar_msg
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && colcon build --symlink-install --event-handlers console_direct+

RUN echo 'alias build="colcon build --symlink-install --event-handlers console_direct+"' >> ~/.bashrc
RUN echo 'source /opt/ros/humble/setup.bash; source /colcon_ws/install/setup.bash; echo UID: $UID; echo ROS_DOMAIN_ID: $ROS_DOMAIN_ID; ros2 launch ros_encoder ros_encoder.launch.py' >> /run.sh && chmod +x /run.sh
RUN echo 'source /opt/ros/humble/setup.bash; source /colcon_ws/install/setup.bash; echo UID: $UID; echo ROS_DOMAIN_ID: $ROS_DOMAIN_ID; ros2 run rslidar_sdk rslidar_sdk_node' >> /run.sh && chmod +x /run.sh
RUN echo 'alias run="su - ros --whitelist-environment=\"ROS_DOMAIN_ID\" /run.sh"' >> /etc/bash.bashrc
2 changes: 1 addition & 1 deletion ros_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e
id -u ros &>/dev/null || adduser --quiet --disabled-password --gecos '' --uid ${UID:=1000} ros

source /opt/ros/${ROS_DISTRO}/setup.bash
source /colcon_ws/install/setup.bash
source /colcon_ws/install/setup.bash || true

exec "$@"
2 changes: 1 addition & 1 deletion rslidar_sdk

0 comments on commit dd6c32d

Please sign in to comment.