Skip to content

Commit

Permalink
Updated dockerfile for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-ochman committed Apr 25, 2024
1 parent 1c59b0f commit b1fe7d4
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
environment: modular-slam-ci
container:
image: ghcr.io/marcin-ochman/modular-slam:v0.0.8-arch
image: ghcr.io/marcin-ochman/modular-slam:v0.0.10-conan
credentials:
username: marcin-ochman
password: ${{ secrets.container_registry_token }}
Expand All @@ -22,15 +22,15 @@ jobs:

- name: Configure CMake
shell: bash
run: mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Wall -pedantic -Wextra" ..; cd -
run: mkdir build; cd build; cmake -DCMAKE_TOOLCHAIN_FILE=/conan_install/build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Wall -pedantic -Wextra" ..; cd -

- name: Build
shell: bash
run: cd build; make -j; cd -
run: cd build; source /conan_install/build/Release/generators/conanrun.sh; make -j; cd -

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
run: source /conan_install/build/Release/generators/conanrun.sh; ctest -C ${{env.BUILD_TYPE}} --output-on-failure

- name: Generate Docs
run: cd build; make doc; cd -;
Expand Down
5 changes: 5 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ def requirements(self):
self.requires("nlohmann_json/3.11.3")
self.requires("trompeloeil/47")
self.requires("dbow3/c5ae539abddcef43ef64fa130555e2d521098369")
self.requires("eigen/3.4.0")
self.requires("ceres-solver/2.2.0")
self.requires("spdlog/1.13.0")
self.requires("glm/cci.20230113")
self.requires("opencv/4.8.1", force=True)
self.requires("qt/6.6.2", force=True)
self.requires("libpng/1.6.43", override=True)
self.requires("ffmpeg/6.1", override=True)
self.requires("xkbcommon/1.6.0", override=True)
self.requires("librealsense/2.53.1")
# TODO add eigen

def config_options(self):
if self.settings.os == "Windows":
Expand Down
4 changes: 2 additions & 2 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ target_link_libraries(
Qt6::Core
ModularSlam::ModularSlam
OpenGL::GLU
glm
glm::glm
${OpenCV_LIBS})

add_executable(RgbdSlam slam/rgbd_slam.cpp)
Expand All @@ -67,7 +67,7 @@ target_link_libraries(
Qt6::Core
ModularSlam::ModularSlam
OpenGL::GLU
glm
glm::glm
${OpenCV_LIBS})

get_target_property(QT_CORE_INCLUDE_DIRS Qt6::Core
Expand Down
12 changes: 10 additions & 2 deletions src/app/viewer/pointcloud_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

#include <GL/gl.h>
#include <QMouseEvent>
#include <QSurfaceFormat>
#include <QTimer>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/vec3.hpp>
#include <optional>

// clang-format off
static const GLfloat textureBoxVertices[] = {
1.0f, -1.0f, 0.0f, 1.0f, 1.0f,
Expand Down Expand Up @@ -76,6 +76,13 @@ void PointcloudViewer::addKeyframe(const KeyframeViewData& keyframe)

void PointcloudViewer::initializeGL()
{
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
format.setVersion(3, 2);
format.setProfile(QSurfaceFormat::CoreProfile);
this->setFormat(format);

initializeOpenGLFunctions();
glEnable(GL_PROGRAM_POINT_SIZE);
glEnable(GL_BLEND);
Expand Down Expand Up @@ -141,6 +148,7 @@ void PointcloudViewer::wheelEvent(QWheelEvent* event)

void PointcloudViewer::keyPressEvent(QKeyEvent* event)
{
qDebug() << "Received ";
switch(event->key())
{
case Qt::Key_A:
Expand All @@ -153,7 +161,7 @@ void PointcloudViewer::keyPressEvent(QKeyEvent* event)
camera.move_forward(0.2f);
break;
case Qt::Key_S:
camera.move_forward(-0.2f);
camera.move_forward(0.2f);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/modular_slam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ target_link_libraries(
opencv_features2d
opencv_highgui
Ceres::ceres
PUBLIC realsense2::realsense2 Boost::filesystem Eigen3::Eigen spdlog::spdlog
PUBLIC realsense2::realsense2 Boost::boost Eigen3::Eigen spdlog::spdlog
dbow3::dbow3)

install(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "modular_slam/slam_component.hpp"
#include "modular_slam/types/frontend_output.hpp"
#include <any>
#include <ceres/types.h>
#include <limits>
#include <type_traits>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#include <Eigen/src/Geometry/AngleAxis.h>
#include <cstdint>

#include <eigen3/Eigen/src/Core/Matrix.h>
#include <eigen3/Eigen/src/Geometry/Quaternion.h>

namespace mslam
{

Expand Down
7 changes: 5 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enable_testing()
find_package(Catch2 3 REQUIRED)
find_package(trompeloeil REQUIRED)
find_package(OpenCV 4 REQUIRED)
find_package(Boost REQUIRED)

include(Catch)

Expand All @@ -14,14 +15,16 @@ if(NOT TARGET ModularSlam::ModularSlam)
endif()

add_library(dummy SHARED dummy.cpp)
target_link_libraries(dummy PRIVATE Boost::boost)
add_executable(
modular_slam_tests plugin_loader_test.cpp rgbd_file_provider_test.cpp
parameter_register_test.cpp slam_builder_test.cpp)
target_compile_definitions(
modular_slam_tests PRIVATE DUMMY_DIR="$<TARGET_FILE_DIR:dummy>"
TEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
target_link_libraries(
modular_slam_tests PRIVATE ModularSlam::ModularSlam Catch2::Catch2WithMain
trompeloeil::trompeloeil ${OpenCV_LIBS})
modular_slam_tests
PRIVATE ModularSlam::ModularSlam Catch2::Catch2WithMain
trompeloeil::trompeloeil ${OpenCV_LIBS} Boost::filesystem)

catch_discover_tests(modular_slam_tests)
1 change: 0 additions & 1 deletion test/dummy.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#define CATCH_CONFIG_MAIN

#include <boost/dll/alias.hpp>
#include <catch2/catch_test_macros.hpp>
#include <memory>

std::unique_ptr<int> intFactory()
Expand Down

0 comments on commit b1fe7d4

Please sign in to comment.