-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Added * Mockup-server, which can simulate a Blickfeld scanner by reading a point cloud recording. The implementation is currently **incomplete**, please read the documentation in the source code and the C++ server example. # Changed * Protocol: Improved documentation of algorithms * Python: Extended set_default_point_cloud_algorithms with static transformation
- Loading branch information
1 parent
83f8dc6
commit 320247f
Showing
6 changed files
with
94 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## | ||
## Copyright (c) 2020 Blickfeld GmbH. | ||
## All rights reserved. | ||
## | ||
## This source code is licensed under the BSD-style license found in the | ||
## LICENSE.md file in the root directory of this source tree. | ||
## | ||
cmake_minimum_required (VERSION 2.6) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
if (NOT TARGET blickfeld-scanner) | ||
find_package(blickfeld-scanner REQUIRED full) | ||
endif() | ||
|
||
add_executable(bf-server main.cpp) | ||
target_link_libraries(bf-server blickfeld-scanner) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2020 Blickfeld GmbH. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE.md file in the root directory of this source tree. | ||
*/ | ||
|
||
#include <blickfeld/exception.h> | ||
#include <blickfeld/mockup_server.h> | ||
|
||
int example(int argc, char* argv[]) { | ||
std::string dump_fn; | ||
if (argc > 1) | ||
dump_fn = argv[1]; | ||
else | ||
throw blickfeld::str_exception("Please provide filename of recording"); | ||
|
||
blickfeld::network::mockup_server server(dump_fn, [](const blickfeld::protocol::stream::Subscribe::PointCloud subscribe) { | ||
// Handler is called for each client point cloud subscription. | ||
// Variables can be initialized in this step. | ||
|
||
// Return function, which as called for every frame provided to the client. | ||
return [](blickfeld::protocol::data::Frame& frame) { | ||
// Process & mutate client frame | ||
}; | ||
}); | ||
return server.serve_forever(); | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
try { | ||
return example(argc, argv); | ||
} catch (const std::exception& e) { | ||
fprintf(stderr, "main caught exception:\n%s\n", e.what()); | ||
} | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters