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

start to add phase support #4

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ install:
- ps: "ls \"C:/Program Files (x86)/Intel RealSense SDK 2.0\""
- set PATH=%PATH%;C:\Program Files (x86)\Intel RealSense SDK 2.0\bin\x64
- set RealSense2_ROOT_DIR=C:\Program Files (x86)\Intel RealSense SDK 2.0
# Phase
- ps: wget 'https://github.com/i3drobotics/phase/releases/download/v0.1.1/phase-v0.1.1-windows-x86_64.exe' -outfile phase.exe
- cmd: phase.exe /VERYSILENT
- ECHO "Installed Phase:"
- ps: "ls \"C:/Program Files/I3DR/Phase\""
- set PATH=%PATH%;C:\Program Files\I3DR\Phase\bin
- set Phase_ROOT_DIR=C:\Program Files\I3DR\Phase
# Kinect 4 Azure
- ps: wget 'https://download.microsoft.com/download/3/d/6/3d6d9e99-a251-4cf3-8c6a-8e108e960b4b/Azure%20Kinect%20SDK%201.4.1.exe' -outfile azure.exe
- cmd: azure.exe /quiet
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cmake-ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:

jobs:
build:
if: startsWith(github.head_ref, 'add-phase') == false
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:

jobs:
build:
if: startsWith(github.head_ref, 'add-phase') == false
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down
35 changes: 1 addition & 34 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
docker_tag: [xenial, bionic, focal, android23, android24, android26, android30]
docker_tag: [xenial, bionic, focal]
include:
- docker_tag: xenial
docker_tags: |
Expand All @@ -37,39 +37,6 @@ jobs:
linux/amd64
linux/arm64
docker_path: 'focal'
- docker_tag: android23
docker_tags: |
i3dr/rtabmap:android23
i3dr/rtabmap:tango
docker_args: |
API_VERSION=23
docker_platforms: |
linux/amd64
docker_path: 'bionic/android/rtabmap_apiXX'
- docker_tag: android24
docker_tags: |
i3dr/rtabmap:android24
docker_args: |
API_VERSION=24
docker_platforms: |
linux/amd64
docker_path: 'bionic/android/rtabmap_apiXX'
- docker_tag: android26
docker_tags: |
i3dr/rtabmap:android26
docker_args: |
API_VERSION=26
docker_platforms: |
linux/amd64
docker_path: 'bionic/android/rtabmap_apiXX'
- docker_tag: android30
docker_tags: |
i3dr/rtabmap:android30
docker_args: |
API_VERSION=30
docker_platforms: |
linux/amd64
docker_path: 'bionic/android/rtabmap_apiXX'

steps:
-
Expand Down
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ option(WITH_ZEDOC "Include ZED Open Capture support" ON)
option(WITH_REALSENSE "Include RealSense support" ON)
option(WITH_REALSENSE_SLAM "Include RealSenseSlam support" ON)
option(WITH_REALSENSE2 "Include RealSense support" ON)
option(WITH_PHASE "Include Phase support" ON)
option(WITH_MYNTEYE "Include mynteye-s support" ON)
option(WITH_DEPTHAI "Include depthai-core support" OFF)
option(WITH_OCTOMAP "Include Octomap support" ON)
Expand Down Expand Up @@ -593,6 +594,13 @@ IF(WITH_REALSENSE2)
ENDIF(realsense2_FOUND)
ENDIF(WITH_REALSENSE2)

IF(WITH_PHASE)
FIND_PACKAGE(Phase QUIET)
IF(Phase_FOUND)
MESSAGE(STATUS "Found Phase: ${Phase_INCLUDE_DIRS}")
ENDIF(Phase_FOUND)
ENDIF(WITH_PHASE)

IF(WITH_MYNTEYE)
FIND_PACKAGE(mynteye QUIET)
IF(mynteye_FOUND)
Expand Down Expand Up @@ -929,6 +937,11 @@ IF(NOT realsense2_FOUND)
ELSE()
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${realsense2_LIBRARIES})
ENDIF()
IF(NOT Phase_FOUND)
SET(PHASE "//")
ELSE()
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${Phase_LIBRARIES})
ENDIF()
IF(NOT mynteye_FOUND)
SET(MYNTEYE "//")
ENDIF(NOT mynteye_FOUND)
Expand Down Expand Up @@ -1512,6 +1525,14 @@ ELSE()
MESSAGE(STATUS " With RealSense2 = NO (librealsense2 not found)")
ENDIF()

IF(Phase_FOUND)
MESSAGE(STATUS " With Phase = YES (License: Apache-2)")
ELSEIF(NOT WITH_PHASE)
MESSAGE(STATUS " With Phase = NO (WITH_PHASE=OFF)")
ELSE()
MESSAGE(STATUS " With Phase = NO (Phase library not found)")
ENDIF()

IF(mynteye_FOUND)
MESSAGE(STATUS " With MyntEyeS = YES (License: Apache-2)")
ELSEIF(NOT WITH_MYNTEYE)
Expand Down
1 change: 1 addition & 0 deletions Version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@REALSENSE@#define RTABMAP_REALSENSE
@REALSENSESLAM@#define RTABMAP_REALSENSE_SLAM
@REALSENSE2@#define RTABMAP_REALSENSE2
@PHASE@#define RTABMAP_PHASE
@MYNTEYE@#define RTABMAP_MYNTEYE
@DEPTHAI@#define RTABMAP_DEPTHAI
@OCTOMAP@#define RTABMAP_OCTOMAP
Expand Down
75 changes: 75 additions & 0 deletions cmake_modules/FindPhase.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# - Find Phase (https://github.com/i3drobotics/phase)
#
# Phase_ROOT_DIR environment variable can be set to find the library.
#
# It sets the following variables:
# Phase_FOUND - Set to false, or undefined, if Phase isn't found.
# Phase_INCLUDE_DIRS - The Phase include directory.
# Phase_LIBRARIES - The Phase library to link against.

#Phase library

cmake_minimum_required(VERSION 3.9)

SET(Phase_ROOT_DIR $ENV{Phase_ROOT_DIR})

if (WIN32)
file (GLOB Phase_LIBRARY_FILES
"${Phase_ROOT_DIR}/bin/*.dll"
)
endif()

find_path(Phase_INCLUDE_DIR
NAMES phase/phaseversion.h
HINTS ${Phase_ROOT_DIR}/include
NO_DEFAULT_PATH
DOC "The Phase include directory"
)

if (NOT Phase_INCLUDE_DIR)
message(WARNING "phase include directory not found")
endif()

find_library(Phase_LIB
NAMES phase
PATHS ${Phase_ROOT_DIR}/lib
NO_DEFAULT_PATH
DOC "The Phase_ROOT_DIR library"
)

if (NOT Phase_LIB)
message(WARNING "phase library directory not found")
endif()

file(GLOB Conan_LIBS
"${Phase_ROOT_DIR}/lib/*.lib"
"${Phase_ROOT_DIR}/lib/*.so*"
"${Phase_ROOT_DIR}/lib/i3drsgm/*.so*"
)

set(WITH_I3DRSGM ON)

if (WITH_I3DRSGM)
set (Phase_DEFINITIONS WITH_I3DRSGM)
endif()

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LOGGING_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Phase DEFAULT_MSG Phase_INCLUDE_DIR Phase_LIB)

if (Phase_FOUND)
set(Phase_LIBRARIES
${Phase_LIB}
${Conan_LIBS}
)
set(Phase_INCLUDE_DIRS
${Phase_INCLUDE_DIR}
)
set(Phase_DEFINITIONS ${Phase_DEFINITIONS})
else(Phase_FOUND)
message(FATAL_ERROR "Could not find Phase")
endif()

# Tell cmake GUIs to ignore the "local" variables.
mark_as_advanced(Phase_ROOT_DIR Phase_LIB Conan_LIBS Phase_INCLUDE_DIR)
1 change: 1 addition & 0 deletions corelib/include/rtabmap/core/CameraRGBD.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/core/camera/CameraOpenNICV.h>
#include <rtabmap/core/camera/CameraRealSense.h>
#include <rtabmap/core/camera/CameraRealSense2.h>
#include <rtabmap/core/camera/CameraPhase.h>
#include <rtabmap/core/camera/CameraRGBDImages.h>
#include <rtabmap/core/camera/CameraK4A.h>

76 changes: 76 additions & 0 deletions corelib/include/rtabmap/core/camera/CameraPhase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Universite de Sherbrooke nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines

#include "rtabmap/core/CameraModel.h"
#include "rtabmap/core/Camera.h"
#include "rtabmap/core/Version.h"

#include <pcl/pcl_config.h>

#ifdef RTABMAP_PHASE
// TODO add phase includes
#endif

namespace rtabmap
{

class RTABMAP_EXP CameraPhase :
public Camera
{
public:
static bool available();

public:
CameraPhase(
const std::string & deviceId = "",
float imageRate = 0,
const Transform & localTransform = Transform::getIdentity());
virtual ~CameraPhase();

virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
virtual bool isCalibrated() const;
virtual std::string getSerial() const;

#ifdef RTABMAP_PHASE
//TODO add phase camera members
#endif

protected:
virtual SensorData captureImage(CameraInfo * info = 0);

private:
#ifdef RTABMAP_PHASE
//TODO add phase camera variables
#endif
};


} // namespace rtabmap
12 changes: 12 additions & 0 deletions corelib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ SET(SRC_FILES
camera/CameraOpenNICV.cpp
camera/CameraRealSense.cpp
camera/CameraRealSense2.cpp
camera/CameraPhase.cpp
camera/CameraRGBDImages.cpp
camera/CameraStereoDC1394.cpp
camera/CameraStereoFlyCapture2.cpp
Expand Down Expand Up @@ -316,6 +317,17 @@ IF(realsense2_FOUND)
ENDIF()
ENDIF(realsense2_FOUND)

IF(Phase_FOUND)
SET(INCLUDE_DIRS
${INCLUDE_DIRS}
${Phase_INCLUDE_DIRS}
)
SET(LIBRARIES
${LIBRARIES}
${Phase_LIBRARIES}
)
ENDIF(Phase_FOUND)

IF(DC1394_FOUND)
SET(INCLUDE_DIRS
${INCLUDE_DIRS}
Expand Down
6 changes: 6 additions & 0 deletions corelib/src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,12 @@ ParametersMap Parameters::parseArguments(int argc, char * argv[], bool onlyParam
std::cout << str << std::setw(spacing - str.size()) << "true" << std::endl;
#else
std::cout << str << std::setw(spacing - str.size()) << "false" << std::endl;
#endif
str = "With Phase:";
#ifdef RTABMAP_PHASE
std::cout << str << std::setw(spacing - str.size()) << "true" << std::endl;
#else
std::cout << str << std::setw(spacing - str.size()) << "false" << std::endl;
#endif
str = "With MYNT EYE S:";
#ifdef RTABMAP_MYNTEYE
Expand Down
Loading