alsora / ros2-ORB_SLAM2

ROS2 node wrapping the ORB_SLAM2 library
GNU General Public License v3.0
130 stars 30 forks source link

docker file failed on Ubuntu 22.04 and ros2 humble #18

Open astronaut71 opened 1 year ago

astronaut71 commented 1 year ago

Hi

I have Ubuntu.22.04 and ros2 humble. Tried to run the sudo bash build.sh but then got this error.

=> [internal] load build definition from Dockerfile                                                                                        0.1s
 => => transferring dockerfile: 2.20kB                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                           0.1s
 => => transferring context: 2B                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/ubuntu:18.04                                                                             2.2s
 => [ 1/23] FROM docker.io/library/ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98                     0.0s
 => [internal] load build context                                                                                                           0.0s
 => => transferring context: 106B                                                                                                           0.0s
 => CACHED [ 2/23] WORKDIR /root                                                                                                            0.0s
 => CACHED [ 3/23] COPY scripts /root/scripts                                                                                               0.0s
 => CACHED [ 4/23] RUN apt-get update && apt-get install -y     wget     curl     git     vim     nano     python-dev     python3-pip       0.0s
 => CACHED [ 5/23] WORKDIR /root                                                                                                            0.0s
 => CACHED [ 6/23] WORKDIR /root                                                                                                            0.0s
 => CACHED [ 7/23] RUN git clone https://github.com/raulmur/ORB_SLAM2.git                                                                   0.0s
 => CACHED [ 8/23] RUN apt-get install -y   libboost-system-dev                                                                             0.0s
 => CACHED [ 9/23] WORKDIR /root/ORB_SLAM2                                                                                                  0.0s
 => CACHED [10/23] RUN git apply /root/scripts/orbslam.patch                                                                                0.0s
 => CACHED [11/23] RUN chmod +x /root/scripts/build.sh                                                                                      0.0s
 => ERROR [12/23] RUN /bin/bash -c 'export LD_LIBRARY_PATH=~/Pangolin/build/src/:$LD_LIBRARY_PATH;   bash $HOME/scripts/build.sh'           3.0s
------                                                                                                                                           
 > [12/23] RUN /bin/bash -c 'export LD_LIBRARY_PATH=~/Pangolin/build/src/:$LD_LIBRARY_PATH;   bash $HOME/scripts/build.sh':                      
#0 1.043 Configuring and building Thirdparty/DBoW2 ...                                                                                           
#0 1.058 /root/scripts/build.sh: line 6: cmake: command not found
#0 1.066 make: *** No targets specified and no makefile found.  Stop.
#0 1.067 Configuring and building Thirdparty/g2o ...
#0 1.071 /root/scripts/build.sh: line 15: cmake: command not found
#0 1.076 make: *** No targets specified and no makefile found.  Stop.
#0 1.076 Uncompress vocabulary ...
#0 2.702 Configuring and building ORB_SLAM2 ...
#0 2.705 /root/scripts/build.sh: line 30: cmake: command not found
#0 2.706 make: *** No targets specified and no makefile found.  Stop.
#0 2.708 make: *** No rule to make target 'install'.  Stop.
------
Dockerfile:59
--------------------
  58 |     RUN chmod +x $HOME/scripts/build.sh
  59 | >>> RUN /bin/bash -c 'export LD_LIBRARY_PATH=~/Pangolin/build/src/:$LD_LIBRARY_PATH; \
  60 | >>>   bash $HOME/scripts/build.sh'
  61 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c /bin/bash -c 'export LD_LIBRARY_PATH=~/Pangolin/build/src/:$LD_LIBRARY_PATH;   bash $HOME/scripts/build.sh'" did not complete successfully: exit code: 2

Any help?

evenrohancodes commented 11 months ago

Suggestion: error in the message indicates there are missing dependencies and commands in the Dockerfile, which is causing the build to fail. Specifically, the cmake command is not found, and there are no make targets specified. And ensure that the necessary dependencies are installed in the Docker image/file before running the build script

Or I guess try opening the Dockerfile used for building the image. Make sure that the required dependencies, including cmake, are installed. example, and you can try adding the following line to install cmake:

$RUN apt-get update && apt-get install -y cmake

And after updating the 'Dockerfile' try building the Docker image again using the: $sudo bash build.sh

else provide me with the source code to see if i can help :)