Skip to content

Commit

Permalink
Merge pull request #4 from christian-rauch/jammy
Browse files Browse the repository at this point in the history
updates for Ubuntu 22.04
  • Loading branch information
christian-rauch authored Dec 28, 2023
2 parents be01f68 + 3288f69 commit 0a2f7e0
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 54 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,28 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

env:
DEBIAN_FRONTEND: noninteractive

container:
image: ${{ matrix.docker_image }}

strategy:
matrix:
include:
- docker_image: ubuntu:20.04
- docker_image: ubuntu:22.04

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: install sudo
run: |
apt update
apt install -y sudo
- uses: actions/checkout@v4

- name: setup
run: |
Expand Down
2 changes: 1 addition & 1 deletion Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ add_definitions(-DNVIDIA_VARYINGS)

CUDA_COMPILE(cuda_objs ${cuda})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -msse -msse2 -msse3 -DSHADER_DIR=${MULTIMOTIONFUSION_SHADER_DIR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3 -DSHADER_DIR=${MULTIMOTIONFUSION_SHADER_DIR}")

if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Debug build.")
Expand Down
3 changes: 2 additions & 1 deletion Core/Model/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ModelMatching.h"

#include <opencv2/opencv.hpp>
#include <opencv2/viz/types.hpp>
#include <opencv2/core/eigen.hpp>

#include "Utils/RigidRANSAC.h"
Expand Down Expand Up @@ -1464,7 +1465,7 @@ void Model::exportTracksPLY(const tracker::Tracks &tracks, const std::string &pa
ss_hdr << "ply" << std::endl << "format " << fmt << " 1.0" << std::endl;

ss_hdr << "element vertex " << vert_id << std::endl;
for(const std::string &c : {"x", "y", "z"}) {
for(const char *c : {"x", "y", "z"}) {
ss_hdr << "property float32 " << c << std::endl;
}
if (with_descriptor) {
Expand Down
17 changes: 11 additions & 6 deletions GUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ set(CMAKE_CXX_STANDARD 17)

message(STATUS "Evaluating GUI/CMAKE")

option(ROSBAG "rosbag reader" ON)
if($ENV{ROS_VERSION} EQUAL 1)
set(HASROS1 ON)
endif()

option(ROSBAG "rosbag reader" ${HASROS1})

option(ROSNODE "read images live as ROS node" ON)
option(ROSNODE "read images live as ROS node" ${HASROS1})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(ZLIB REQUIRED)
find_package(CUDA REQUIRED)
find_package(OpenNI2 REQUIRED)
find_package(OpenCV REQUIRED )
find_package(Boost REQUIRED)
find_package(Boost REQUIRED filesystem)
find_package(JPEG REQUIRED)

# TODO: Why do we have to do this here again?
Expand Down Expand Up @@ -58,7 +62,7 @@ message(STATUS "CMAKE_CURRENT_SOURCE_DIR/../Core: ${${CMAKE_CURRENT_SOURCE_DIR}/
file(GLOB srcs *.cpp)
file(GLOB tools_srcs Tools/*.cpp)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -msse -msse2 -msse3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3")

if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Debug build.")
Expand Down Expand Up @@ -89,8 +93,7 @@ target_link_libraries(MultiMotionFusionTools
${CUDA_LIBRARIES}
${OPENNI2_LIBRARY}
${OpenCV_LIBRARIES}
boost_filesystem
boost_system
Boost::filesystem
pthread
)

Expand All @@ -104,6 +107,8 @@ target_include_directories(MultiMotionFusionTools PUBLIC
${BOOST_INCLUDE_DIRS}
)

set_property(TARGET MultiMotionFusionTools PROPERTY CXX_STANDARD 17)

if(ROSBAG)
target_include_directories(MultiMotionFusionTools PUBLIC
${rosbag_INCLUDE_DIRS}
Expand Down
32 changes: 24 additions & 8 deletions doc/install.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
#!/usr/bin/env bash

set -e

source /etc/lsb-release

if [ "$DISTRIB_RELEASE" = "20.04" ]; then
ROS_DIST="noetic"
elif [ "$DISTRIB_RELEASE" = "22.04" ]; then
ROS_DIST="humble"
else
echo "unsupported Ubuntu distribution"
exit 1
fi

source /opt/ros/${ROS_DIST}/setup.bash

# determine repo from environment variables inside CI or use defaults
MMF_REPO_URL="${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY:-christian-rauch/MultiMotionFusion}"
MMF_BRANCH="${GITHUB_HEAD_REF:-master}"

echo "setup workspace"
source /opt/ros/noetic/setup.bash
mkdir ~/mmf_ws/
mkdir -p ~/mmf_ws/
cd ~/mmf_ws/
vcs import << EOF
repositories:
src/MultiMotionFusion:
type: git
url: https://github.com/christian-rauch/MultiMotionFusion.git
version: master
url: ${MMF_REPO_URL}.git
version: ${MMF_BRANCH}
src/Pangolin:
type: git
url: https://github.com/stevenlovegrove/Pangolin.git
version: master
version: v0.8
src/densecrf:
type: git
url: https://github.com/christian-rauch/densecrf.git
Expand All @@ -34,7 +52,5 @@ EOF
rosdep install --from-paths src --ignore-src -y

echo "build workspace"
source /opt/ros/noetic/setup.bash
export CUDACXX=/usr/local/cuda-11.3/bin/nvcc
cd ~/mmf_ws/
colcon build --cmake-args "-DCMAKE_BUILD_TYPE=Release"
colcon build --cmake-args -D CMAKE_BUILD_TYPE=Release -D CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
46 changes: 34 additions & 12 deletions doc/setup.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
#!/usr/bin/env bash

set -e

sudo apt update
sudo -E apt install -y software-properties-common
sudo add-apt-repository -y universe
sudo apt update
sudo -E apt install -y curl wget

source /etc/lsb-release

if [ "$DISTRIB_RELEASE" = "20.04" ]; then
CUDA_REPO_VER="ubuntu2004"
ROS_VER=""
ROS_DIST="noetic"
elif [ "$DISTRIB_RELEASE" = "22.04" ]; then
CUDA_REPO_VER="ubuntu2204"
ROS_VER="2"
ROS_DIST="humble"
else
echo "unsupported Ubuntu distribution"
exit 1
fi

echo "install CUDA"
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt install --no-install-recommends -y cuda-libraries-dev-11-3 cuda-compiler-11-3 cuda-nvtx-11-3 libcudnn8-dev
wget https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_REPO_VER}/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
rm cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install --no-install-recommends -y cuda-libraries-dev-11-8 cuda-compiler-11-8 cuda-nvtx-11-8 libcudnn8-dev

echo "install ROS"
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
echo "install ROS ${ROS_VER}"
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros${ROS_VER}/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/ros${ROS_VER}.list > /dev/null
sudo apt update
sudo apt install --no-install-recommends -y ros-noetic-ros-base
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
sudo -E apt install --no-install-recommends -y ros-${ROS_DIST}-ros-base ros-dev-tools
echo "source /opt/ros/${ROS_DIST}/setup.bash" >> ~/.bashrc

echo "install vcstool, rosdep, colcon"
sudo pip3 install -U vcstool rosdep colcon-common-extensions
echo "initialise rosdep"
sudo rosdep init
rosdep update
34 changes: 11 additions & 23 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package format="2">
<package format="3">
<name>mmf</name>
<version>0.0.0</version>
<description>The MultiMotionFusion package</description>
Expand Down Expand Up @@ -43,28 +43,16 @@
<!-- <doc_depend>doxygen</doc_depend> -->
<buildtool_depend>cmake</buildtool_depend>

<build_depend>eigen</build_depend>
<build_depend>gslicr</build_depend>
<build_depend>densecrf</build_depend>
<build_depend>libboost-dev</build_depend>
<build_depend>pangolin</build_depend>
<build_depend>suitesparse</build_depend>
<build_depend>libopenni2-dev</build_depend>
<build_export_depend>eigen</build_export_depend>
<build_export_depend>gslicr</build_export_depend>
<build_export_depend>libboost-dev</build_export_depend>
<build_export_depend>pangolin</build_export_depend>
<build_export_depend>suitesparse</build_export_depend>
<build_export_depend>libopenni2-dev</build_export_depend>
<exec_depend>eigen</exec_depend>
<exec_depend>gslicr</exec_depend>
<exec_depend>densecrf</exec_depend>
<exec_depend>libboost-dev</exec_depend>
<exec_depend>pangolin</exec_depend>
<exec_depend>suitesparse</exec_depend>
<exec_depend>libopenni2-dev</exec_depend>
<depend>eigen</depend>
<depend>gslicr</depend>
<depend>densecrf</depend>
<depend>libboost-dev</depend>
<depend>libboost-filesystem-dev</depend>
<depend>pangolin</depend>
<depend>suitesparse</depend>
<depend>libopenni2-dev</depend>

<depend>rosbag</depend>
<depend condition="$ROS_VERSION == 1">rosbag</depend>
<depend>tf2</depend>
<depend>tf2_msgs</depend>
<depend>tf2_eigen</depend>
Expand All @@ -73,7 +61,7 @@
<depend>cv_bridge</depend>
<depend>image_geometry</depend>
<depend>super_point_inference</depend>
<depend>eigen_conversions</depend>
<depend condition="$ROS_VERSION == 1">eigen_conversions</depend>
<depend>cob_srvs</depend>

<export>
Expand Down

0 comments on commit 0a2f7e0

Please sign in to comment.