diff --git a/.github/workflows/setup.sh b/.github/workflows/setup.sh index 801efbe0..6d7e1ab3 100755 --- a/.github/workflows/setup.sh +++ b/.github/workflows/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash sudo apt update -sudo apt install -y libceres-dev +DEBIAN_FRONTEND=noninteractive sudo apt install -y libceres-dev #rosdep init rosdep update --include-eol-distros @@ -13,7 +13,7 @@ git submodule update --init --recursive pip3 install -r requirements.txt #rosdep install -rosdep install --from-paths . -y --ignore-src -r +DEBIAN_FRONTEND=noninteractive rosdep install --from-paths . -y --ignore-src -r # - Importing all dependencies colcon build --symlink-install \ No newline at end of file diff --git a/.rosinstall_ros1 b/.rosinstall_ros1 index 6de6504d..04292662 100644 --- a/.rosinstall_ros1 +++ b/.rosinstall_ros1 @@ -62,8 +62,4 @@ repositories: s_graphs_utils/voxblox: type: git url: https://github.com/ethz-asl/voxblox.git - version: master - s_graphs_utils/ros1_graph_manager_interface: - type: git - url: git@github.com:snt-arg/ros1_graph_manager_interface.git - version: main \ No newline at end of file + version: master \ No newline at end of file diff --git a/README.md b/README.md index c0676095..513adc4a 100644 --- a/README.md +++ b/README.md @@ -192,13 +192,13 @@ git clone git@github.com:snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs && 3. Build image -> [!NOTE] -> In case you have a different ssh key name for your GitHub account, change `id_ed25519` oto yours. - ```sh -docker build -t sntarg/s_graphs --ssh default=$HOME/.ssh/id_ed25519 . +docker build -t sntarg/s_graphs . ``` +> [!NOTE] +There are two docker files, one for foxy and another for humble. The above commands build the foxy image, you use the same commands to build the humble image if needed. + ## 🚀 Example on Datasets > [!WARNING] diff --git a/docker/build.sh b/docker/build.sh deleted file mode 100755 index 99e857f1..00000000 --- a/docker/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -docker build --tag s_graphs -f noetic/Dockerfile .. diff --git a/docker/foxy_noetic/Dockerfile b/docker/foxy_noetic/Dockerfile index 44fae0c4..7b1cf799 100644 --- a/docker/foxy_noetic/Dockerfile +++ b/docker/foxy_noetic/Dockerfile @@ -24,23 +24,17 @@ RUN apt install --no-install-recommends -y \ ros-foxy-velodyne \ ros-foxy-teleop-twist-keyboard -# Authorize SSH Host (GitHub) -RUN mkdir -p -m 0700 /root/.ssh && \ - ssh-keyscan -H github.com >> /root/.ssh/known_hosts +# Creating working spaces directory and clone s_graphs inside it +RUN mkdir -p /root/workspaces +WORKDIR /root/workspaces +RUN git clone https://github.com/snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs -# Creating working spaces directory and clone s_graphs_ros2_ws inside it -RUN mkdir -p /root/workspaces/s_graphs_ros2_ws/src -WORKDIR /root/workspaces/s_graphs_ros2_ws/src -RUN --mount=type=ssh \ - git clone git@github.com:snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs - -# Fetching all packages specified in the .rosinstall file and running build everything with colcon build. -WORKDIR /root/workspaces/s_graphs_ros2_ws/src/s_graphs -RUN --mount=type=ssh \ - vcs import --recursive ../ < .rosinstall_ros2 -WORKDIR /root/workspaces/s_graphs_ros2_ws/ +# Fetching all packages specified in the gitsubmodules and running build everything with colcon build. +WORKDIR /root/workspaces/s_graphs +RUN git submodule update --init --recursive +WORKDIR /root/workspaces/s_graphs RUN sudo apt install python3-rosdep -RUN rosdep install --from-paths src -y --ignore-src -r +RUN rosdep install --from-paths . -y --ignore-src -r SHELL ["/bin/bash", "-c"] RUN source /opt/ros/foxy/setup.bash && \ colcon build --symlink-install @@ -62,11 +56,9 @@ RUN rosdep update --include-eol-distros # Setup ROS1 workspace for ROS1 related dependencies of s_graphs RUN mkdir -p /root/workspaces/s_graphs_ros1_ws/src WORKDIR /root/workspaces/s_graphs_ros1_ws/src -RUN --mount=type=ssh \ - git clone git@github.com:snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs +RUN git clone https://github.com/snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs WORKDIR /root/workspaces/s_graphs_ros1_ws/src/s_graphs -RUN --mount=type=ssh \ - vcs import --recursive ../ < .rosinstall_ros1 +RUN vcs import --recursive ../ < .rosinstall_ros1 WORKDIR /root/workspaces/s_graphs_ros1_ws RUN rosdep install --from-paths src --ignore-src -y -r RUN apt install --no-install-recommends -y \ @@ -77,7 +69,6 @@ RUN source /opt/ros/noetic/setup.bash && \ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release && \ catkin build - # Install mprocs WORKDIR /root RUN wget https://github.com/pvolok/mprocs/releases/download/v0.6.4/mprocs-0.6.4-linux64.tar.gz @@ -86,8 +77,5 @@ RUN tar -xf mprocs* && \ mv mprocs /usr/local/bin # alias for mprocs -RUN echo "alias mprocs_real='mprocs -c /root/workspaces/s_graphs_ros2_ws/src/s_graphs/.real_mprocs.yaml'" >> /root/.bashrc -RUN echo "alias mprocs_virtual='mprocs -c /root/workspaces/s_graphs_ros2_ws/src/s_graphs/.virtual_mprocs.yaml'" >> /root/.bashrc - -# Removing SSH Host authorization (GitHub) -RUN rm -rf /root/.ssh/ +RUN echo "alias mprocs_real='mprocs -c /root/workspaces/s_graphs/.real_mprocs.yaml'" >> /root/.bashrc +RUN echo "alias mprocs_virtual='mprocs -c /root/workspaces/s_graphs/.virtual_mprocs.yaml'" >> /root/.bashrc \ No newline at end of file diff --git a/docker/howtouse.md b/docker/howtouse.md deleted file mode 100644 index d2532a4c..00000000 --- a/docker/howtouse.md +++ /dev/null @@ -1,40 +0,0 @@ -# s_graphs - -Original repository: https://github.com/koide3/s_graphs - - -## Build -```bash -cd s_graphs/docker -./build.sh -``` - -## Run - -### On host: -```bash -roscore -``` - -```bash -rosparam set use_sim_time true - -cd s_graphs/rviz -rviz -d s_graphs.rviz -``` - -```bash -rosbag play --clock hdl_400.bag -``` -http://www.aisl.cs.tut.ac.jp/databases/s_graphs/hdl_400.bag.tar.gz - -### On docker image: -```bash -cd s_graphs/docker -./run.sh - -roslaunch s_graphs s_graphs_400.launch -``` - - -![s_graphs](https://user-images.githubusercontent.com/31344317/98347836-4fed5a00-205b-11eb-931c-158f6cd056bf.gif) diff --git a/docker/humble/Dockerfile b/docker/humble/Dockerfile new file mode 100644 index 00000000..4bf62355 --- /dev/null +++ b/docker/humble/Dockerfile @@ -0,0 +1,38 @@ +FROM ros:humble + +# Install necessary and useful packages +RUN apt update && \ + apt install --no-install-recommends -y \ + ssh \ + vim \ + python3-pip \ + python3-vcstool \ + python3-catkin-tools \ + wget \ + git + +# Creating working spaces directory and clone s_graphs inside it +RUN mkdir -p /root/workspaces +WORKDIR /root/workspaces +RUN git clone https://github.com/snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs + +# Fetching all packages specified in the .rosinstall file and running build everything with colcon build. +WORKDIR /root/workspaces/s_graphs +RUN git submodule update --init --recursive +WORKDIR /root/workspaces/s_graphs +RUN sudo apt install python3-rosdep +RUN rosdep install --from-paths . -y --ignore-src -r +SHELL ["/bin/bash", "-c"] +RUN source /opt/ros/humble/setup.bash && \ + colcon build --symlink-install + +# Install mprocs +WORKDIR /root +RUN wget https://github.com/pvolok/mprocs/releases/download/v0.6.4/mprocs-0.6.4-linux64.tar.gz +RUN tar -xf mprocs* && \ + rm mprocs*.tar.gz && \ + mv mprocs /usr/local/bin + +# alias for mprocs +RUN echo "alias mprocs_real='mprocs -c /root/workspaces/s_graphs/.real_mprocs.yaml'" >> /root/.bashrc +RUN echo "alias mprocs_virtual='mprocs -c /root/workspaces/s_graphs/.virtual_mprocs.yaml'" >> /root/.bashrc \ No newline at end of file diff --git a/docker/noetic/Dockerfile b/docker/noetic/Dockerfile deleted file mode 100644 index eb9d3c03..00000000 --- a/docker/noetic/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM ros:noetic - -# - ssh keys to get the s_graphs repo (only temporary) -ARG ssh_prv_key -ARG ssh_pub_key - -RUN apt-get update && apt-get install -y --no-install-recommends libtool \ - wget nano vim build-essential libomp-dev clang lld git\ - ros-noetic-geodesy ros-noetic-pcl-ros ros-noetic-nmea-msgs \ - ros-noetic-rviz ros-noetic-tf-conversions ros-noetic-libg2o \ - python3 python3-pip python3-vcstool git \ - openssh-server libmysqlclient-dev - -RUN pip3 install -U catkin_tools - -# Authorize SSH Host (only temporary) -RUN mkdir -p /root/.ssh && \ - chmod 0700 /root/.ssh && \ - ssh-keyscan github.com > /root/.ssh/known_hosts - -# Add the ssht keys and set permissions (only temporary) -RUN echo "$ssh_prv_key" > /root/.ssh/id_rsa && \ - echo "$ssh_pub_key" > /root/.ssh/id_rsa.pub && \ - chmod 600 /root/.ssh/id_rsa && \ - chmod 600 /root/.ssh/id_rsa.pub - -# - Creating S-Graphs working space -RUN mkdir -p /root/s_graphs_ws/src -WORKDIR /root/s_graphs_ws/src -RUN git clone git@github.com:snt-arg/s_graphs.git && cd s_graphs && git checkout v2.1.0 -b v2.1.0-stable-release - -# - Installing S-Graphs dependencies -WORKDIR /root/s_graphs_ws/src/s_graphs -RUN vcs import --recursive ../ < .rosinstall -WORKDIR /root/s_graphs_ws -RUN rosdep install --from-paths src --ignore-src -r -y - -# - Updating rosdep -RUN rosdep update - -# - Catkin build -RUN catkin config --extend /opt/ros/noetic/ && catkin build -j10 -# RUN catkin config --install - -# - Removing cpp source files from s_graphs -RUN rm src/s_graphs/src/s_graphs/*.cpp && rm -rf src/s_graphs/apps - -# Remove SSH keys -RUN rm -rf /root/.ssh/ diff --git a/docker/run.sh b/docker/run.sh deleted file mode 100755 index e3e51ca8..00000000 --- a/docker/run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -docker run --net=host -it --rm \ - -v $(realpath ..):/root/catkin_ws/src/s_graphs \ - -w /root/catkin_ws/src/s_graphs \ - $@ \ - s_graphs