Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/add_githu…
Browse files Browse the repository at this point in the history
…b_actions
  • Loading branch information
fspindle committed Jun 29, 2023
2 parents 9d8e194 + c0b1927 commit 61b5cbe
Show file tree
Hide file tree
Showing 55 changed files with 512 additions and 263 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos-dep-brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
make -j$(sysctl -n hw.logicalcpu)
4 changes: 2 additions & 2 deletions .github/workflows/macos-dep-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ jobs:
- name: Build and install ViSP
run: |
cd ${HOME}/visp/build
make -j2 install
make -j$(sysctl -n hw.logicalcpu) install
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VISP_DIR
- name: Configure CMake and build visp_sample
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
make -j$(sysctl -n hw.logicalcpu)
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu-dep-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
mkdir build && cd build && mkdir install
cmake .. -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
cat ViSP-third-party.txt
make -j2 install
make -j$(nproc) install
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VISP_DIR
- name: Configure CMake and build visp_sample
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
make -j($nproc)
18 changes: 9 additions & 9 deletions .github/workflows/ubuntu-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cd ${HOME}/librealsense
mkdir build && cd build && mkdir install
cmake .. -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j2 install
make -j$(nproc) install
echo "REALSENSE2_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $REALSENSE2_DIR
Expand All @@ -54,35 +54,35 @@ jobs:
mkdir build && cd build && mkdir install
cmake .. -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
cat ViSP-third-party.txt
make -j2 install
make -j$(nproc) install
echo "ViSP_WS=${HOME}" >> $GITHUB_ENV
echo $ViSP_WS
- name: Build visp_sample with ViSP from build tree
run: |
mkdir visp_sample-build && cd visp_sample-build
cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build
make -j2
make -j$(nproc)
- name: Build visp_sample using visp-config from build tree
run: |
make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build
make -f Makefile.visp-config clean
make -j$(nproc) -f Makefile.visp-config clean
- name: Build visp_sample with ViSP from install tree
run: |
mkdir visp_sample-build_2 && cd visp_sample-build_2
cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build/install/lib/cmake/visp
make -j2
make -j$(nproc)
- name: Build visp_sample using visp.pc from install tree
run: |
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ViSP_WS/visp/build/install/lib/pkgconfig
make -f Makefile.visp.pc
make -f Makefile.visp.pc clean
make -j$(nproc) -f Makefile.visp.pc
make -j$(nproc) -f Makefile.visp.pc clean
- name: Build visp_sample using visp-config from install tree
run: |
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ViSP_WS/visp/build/install/lib/pkgconfig
make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build/install
make -f Makefile.visp-config clean
make -j$(nproc) -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build/install
make -j$(nproc) -f Makefile.visp-config clean
84 changes: 84 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"editor.tabSize": 2,
"C_Cpp.vcFormat.indent.braces": false,
"C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.namespace": "newLine",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "newLine",
"C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyFunction": true,
"C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": true,
"C_Cpp.vcFormat.space.beforeInitializerListOpenBrace": true,
"C_Cpp.vcFormat.space.betweenEmptyBraces": true,
"C_Cpp.clang_format_style": "Visual Studio",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "newLine",
"C_Cpp.vcFormat.space.pointerReferenceAlignment": "right",
"C_Cpp.vcFormat.space.beforeEmptySquareBrackets": true,
"C_Cpp.vcFormat.space.beforeOpenSquareBracket": false,
"files.associations": {
"bitset": "cpp",
"optional": "cpp",
"iosfwd": "cpp",
"__bit_reference": "cpp",
"__bits": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tuple": "cpp",
"__verbose_abort": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"locale": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"variant": "cpp",
"vector": "cpp",
"__nullptr": "cpp",
"__string": "cpp",
"chrono": "cpp",
"compare": "cpp",
"concepts": "cpp",
"algorithm": "cpp"
}
}
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(visp-sample)

cmake_minimum_required(VERSION 3.0)

project(visp-sample)

#--------------------------------------------------------------------
# By default set release configuration
#--------------------------------------------------------------------
Expand All @@ -14,7 +14,6 @@ endif()
#--------------------------------------------------------------------
find_package(VISP REQUIRED)


#--------------------------------------------------------------------
# Propagate in subdirs
#--------------------------------------------------------------------
Expand All @@ -24,6 +23,7 @@ add_subdirectory(core)
add_subdirectory(detection)
add_subdirectory(gui)
add_subdirectory(io)
add_subdirectory(json)
add_subdirectory(klt)
add_subdirectory(mbt)
add_subdirectory(me)
Expand Down
2 changes: 1 addition & 1 deletion Makefile.visp.pc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CXX = g++
#CXX = g++
VISP_CFLAGS = `pkg-config --cflags visp`
VISP_LDFLAGS = `pkg-config --libs visp`

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ $ git clone https://github.com/lagadic/visp_sample
$ mkdir visp_sample-build
$ cd visp_sample-build
$ cmake ../visp_sample -DVISP_DIR=$ViSP_WS/visp-build
$ make -j4
```

### 2.2. Build visp_sample using `visp-config` from build tree

```
$ cd $ViSP_WS/visp_sample
$ make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp-build
$ make -f Makefile.visp-config clean
$ make -j4 -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp-build
$ make -j4 -f Makefile.visp-config clean
```

### 2.3. Build visp_sample with ViSP from install tree
Expand All @@ -72,22 +73,23 @@ $ git clone https://github.com/lagadic/visp_sample
$ mkdir visp_sample-build
$ cd visp_sample-build
$ cmake ../visp_sample -DVISP_DIR=/tmp/usr/local/lib/cmake/visp
$ make -j4
```

### 2.4. Build visp_sample using `visp.pc` from install tree

```
$ cd $ViSP_WS/visp_sample
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
$ make -f Makefile.visp.pc
$ make -f Makefile.visp.pc clean
$ make -j4 -f Makefile.visp.pc
$ make -j4 -f Makefile.visp.pc clean
```

### 2.5. Build visp_sample using `visp-config` from install tree

```
$ cd $ViSP_WS/visp_sample
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
$ make -f Makefile.visp-config VISP_INSTALL_PREFIX=/tmp/usr/local
$ make -f Makefile.visp-config clean
$ make -j4 -f Makefile.visp-config VISP_INSTALL_PREFIX=/tmp/usr/local
$ make -j4 -f Makefile.visp-config clean
```
4 changes: 2 additions & 2 deletions ar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(sample-core)

cmake_minimum_required(VERSION 3.0)

project(sample-core)

file(GLOB src_cpp RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.cpp")

foreach(src ${src_cpp})
Expand Down
4 changes: 2 additions & 2 deletions blob/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(sample-core)

cmake_minimum_required(VERSION 3.0)

project(sample-core)

file(GLOB src_cpp RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.cpp")

foreach(src ${src_cpp})
Expand Down
6 changes: 1 addition & 5 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
project(sample-core)

cmake_minimum_required(VERSION 3.0)

# C++11 is needed for brace-enclosed initializer list in sample-vpVelocityTwistMatrix-3.cpp:9:37
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(sample-core)

file(GLOB src_cpp RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.cpp")

Expand Down
2 changes: 1 addition & 1 deletion core/sample-vpForceTwistMatrix-3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main()
{
#ifdef VISP_HAVE_VIPER850
vpRobotViper850 robot;
vpColVector sH = robot.getForceTorque(sH); // Get the force/torque measures
vpColVector sH = robot.getForceTorque(); // Get the force/torque measures

// Set the transformation from sensor frame to the probe frame
vpHomogeneousMatrix pMs;
Expand Down
3 changes: 2 additions & 1 deletion core/sample-vpForceTwistMatrix-4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

int main()
{
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
{
vpTranslationVector stp(0.1, 0.2, 0.3);
vpRotationMatrix sRp( {0, 0, -1,
Expand All @@ -17,5 +18,5 @@ int main()
vpForceTwistMatrix sFp(sRp);
std::cout << "sFp:\n" << sFp << std::endl;
}

#endif
}
20 changes: 20 additions & 0 deletions core/sample-vpImagePoint-4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
#include <visp3/core/vpImagePoint.h>

int main()
{
vpImagePoint start_pixel(10, 12);
vpImagePoint end_pixel(20, 16);
//vpImagePoint start_pixel(10.5, 12.2);
//vpImagePoint end_pixel(20, 12);
//vpImagePoint end_pixel(20.5, 16.2);
//vpImagePoint end_pixel(21, 16.4);

for (auto curr_pixel = start_pixel; curr_pixel.inSegment(start_pixel, end_pixel);
curr_pixel = curr_pixel.nextInSegment(start_pixel, end_pixel)) {
std::cout << "pixel: " << curr_pixel << std::endl;
if (curr_pixel == end_pixel) break;
}

return EXIT_SUCCESS;
}
10 changes: 10 additions & 0 deletions core/sample-vpIoTools-4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <visp3/core/vpIoTools.h>

int main()
{
std::cout << vpIoTools::getIndex("file-1.txt", "file-%d.txt") << std::endl;
std::cout << vpIoTools::getIndex("/tmp/file0040.txt", "/tmp/file%04d.txt") << std::endl;
std::cout << vpIoTools::getIndex("file.txt", "file%d.txt") << std::endl;
std::cout << vpIoTools::getIndex("file03.txt", "file%02d.txt") << std::endl;
std::cout << vpIoTools::getIndex("file-03.txt", "file%02d.txt") << std::endl;
}
21 changes: 21 additions & 0 deletions core/sample-vpIoTools-5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <visp3/core/vpIoTools.h>

int main()
{
std::string tmp_path = vpIoTools::getTempPath();
std::cout << "Temp path: " << tmp_path << std::endl;

std::string tmp_dir1 = vpIoTools::makeTempDirectory(tmp_path);
std::cout << "Created unique temp dir1: " << tmp_dir1 << std::endl;

std::string tmp_dir2_template = tmp_path + vpIoTools::path("/") + "dir_XXXXXX";
std::string tmp_dir2 = vpIoTools::makeTempDirectory(tmp_dir2_template);
std::cout << "Created unique temp dir2: " << tmp_dir2 << std::endl;

if (vpIoTools::remove(tmp_dir1)) {
std::cout << "Temp dir1 was deleted" << std::endl;
}
if (vpIoTools::remove(tmp_dir2)) {
std::cout << "Temp dir2 was deleted" << std::endl;
}
}
30 changes: 30 additions & 0 deletions core/sample-vpMatrix-19.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <visp3/core/vpMatrix.h>

int main()
{
std::string filename("matrix.yaml");
{
vpMatrix M(2, 3);
M[0][0] = -1; M[0][1] = -2; M[0][2] = -3;
M[1][0] = 4; M[1][1] = 5.5; M[1][2] = 6.0f;

std::string header("My header");

if (vpMatrix::saveMatrixYAML(filename, M, header.c_str())) {
std::cout << "Matrix saved in " << filename << std::endl;
M.print(std::cout, 10, header);
} else {
std::cout << "Cannot save matrix in " << filename << std::endl;
}
}
{
vpMatrix N;
char header[FILENAME_MAX];
if (vpMatrix::loadMatrixYAML(filename, N, header)) {
std::cout << "Matrix loaded from " << filename << std::endl;
N.print(std::cout, 10, header);
} else {
std::cout << "Cannot load matrix from " << filename << std::endl;
}
}
}
Loading

0 comments on commit 61b5cbe

Please sign in to comment.