Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation in Docker with ROS2-Humble image #110

Open
Igorgrc opened this issue Feb 25, 2025 · 1 comment
Open

Installation in Docker with ROS2-Humble image #110

Igorgrc opened this issue Feb 25, 2025 · 1 comment

Comments

@Igorgrc
Copy link

Igorgrc commented Feb 25, 2025

Hello,

Im trying to install it in Docker and Im encountering some errors:

  • First of all, during the building:
    Starting >>> lslidar_driver
    --- stderr: lslidar_driver
    • WARNING * * io features related to pcap will be disabled
      In file included from /root/lidar_ws/src/lslidar_ros/lslidar_driver/src/lslidar_driver_node.cpp:1:
      /root/lidar_ws/src/lslidar_ros/lslidar_driver/include/lslidar_driver/lslidar_driver.h:128:18: warning: ‘lslidar_driver::c16_vertical_angle’ defined but not used [-Wunused-variable]
      128 | static float c16_vertical_angle[16] = {-16.0f, 0.0f, -14.0f, 2.0f, -12.0f, 4.0f, -10.0f, 6.0f,
      | ^~~~~~~~~~~~~~~~~~

Finished <<< lslidar_driver [24.1s]
--- stderr: ndt_omp_ros2

    • WARNING * * io features related to pcap will be disabled

Finished <<< ndt_omp_ros2 [44.2s]
Starting >>> graph_based_slam
Starting >>> scanmatcher
[Processing: graph_based_slam, scanmatcher]
[Processing: graph_based_slam, scanmatcher]
[Processing: graph_based_slam, scanmatcher]
--- stderr: scanmatcher
CMake Warning (dev) at CMakeLists.txt:36 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

CMake variable PCL_ROOT is set to:

/usr

For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.


Finished <<< scanmatcher [1min 32s]
--- stderr: graph_based_slam
CMake Warning (dev) at CMakeLists.txt:37 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

CMake variable PCL_ROOT is set to:

/usr

For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.


Finished <<< graph_based_slam [1min 58s]
Starting >>> lidarslam
--- stderr: lidarslam
CMake Warning (dev) at CMakeLists.txt:33 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

CMake variable PCL_ROOT is set to:

/usr

For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.


Finished <<< lidarslam [27.0s]

But these warnings allow the build to complete.

  • Then, I check the logs of the container after this command:
    command: ["/bin/bash", "-c", "source /opt/ros/humble/setup.bash && source /root/lidar_ws/install/setup.bash && ros2 launch lidarslam_ros2 lidarslam.launch.py || sleep infinity"]
    The sleep infinity is to prevent the container to restart.

Package 'lidarslam_ros2' not found: "package 'lidarslam_ros2' not found, searching: ['/root/lidar_ws/install/lidarslam', '/root/lidar_ws/install/scanmatcher', '/root/lidar_ws/install/graph_based_slam', '/root/lidar_ws/install/ndt_omp_ros2', '/root/lidar_ws/install/lslidar_driver', '/root/lidar_ws/install/lslidar_msgs', '/root/lidar_ws/install/lidarslam_msgs', '/opt/ros/humble']"

  • When I access the container, I check if the package is recognized, with ros2 pkg prefix lidarslam_ros2 and the output is:

Package not found

I dont know what the problem could be. I also share the Dockerfile in case that the error is in there.

FROM osrf/ros:humble-desktop

RUN apt-get update && apt-get install -y
software-properties-common
ros-humble-pcl-ros
ros-humble-pluginlib
ros-humble-pcl-conversions
ros-humble-sensor-msgs-py
python3-colcon-common-extensions
python3-pip
libpcap-dev
libboost-all-dev
git
build-essential
cmake
libeigen3-dev
libsuitesparse-dev
libqt5opengl5-dev
libqglviewer-dev-qt5
&& rm -rf /var/lib/apt/lists/*

#Build and install g2o from source
WORKDIR /root
RUN git clone https://github.com/RainerKuemmerle/g2o.git &&
cd g2o &&
mkdir build &&
cd build &&
cmake .. &&
make -j$(nproc) &&
make install

WORKDIR /root/lidar_ws/src

#Copy the lslidar_ros package into the workspace
COPY lslidar_ros ./lslidar_ros

#Clone the lidarslam_ros2 repository
RUN git clone --recursive https://github.com/rsasaki0109/lidarslam_ros2.git

WORKDIR /root/lidar_ws

#Build the workspace
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && colcon build --symlink-install"

#Source ROS2 setup in the container
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
RUN echo "source /root/lidar_ws/install/setup.bash" >> ~/.bashrc

COPY requirements.txt ./requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt

WORKDIR /app
COPY . ./

@rsasaki0109
Copy link
Owner

Hmm... I’m not really sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants