forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IntelRealSense#6136 from dorodnic/ethernet
RealSense Device over Network
- Loading branch information
Showing
72 changed files
with
5,103 additions
and
38 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,12 @@ | ||
@PACKAGE_INIT@ | ||
|
||
set(realsense2-net_VERSION_MAJOR "@REALSENSE_VERSION_MAJOR@") | ||
set(realsense2-net_VERSION_MINOR "@REALSENSE_VERSION_MINOR@") | ||
set(realsense2-net_VERSION_PATCH "@REALSENSE_VERSION_PATCH@") | ||
|
||
set(realsense2-net_VERSION ${realsense2-net_VERSION_MAJOR}.${realsense2-net_VERSION_MINOR}.${realsense2-gl_VERSION_PATCH}) | ||
|
||
set_and_check(realsense2-net_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/realsense2-netTargets.cmake") | ||
set(realsense2-net_LIBRARY realsense2-net::realsense2-net) |
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
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,17 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
includedir=${prefix}/include | ||
#TODO: libdir=${exec_prefix}/lib@MULTI_ARCH_SUFFIX@ | ||
libdir= ${prefix}/lib/x86_64-linux-gnu | ||
|
||
Name: realsense2-gl | ||
Description: Intel(R) RealSense(tm) Network Device Extension Module | ||
Version: @REALSENSE-NET_VERSION_STRING@ | ||
URL: https://github.com/IntelRealSense/librealsense | ||
Requires.private: @LRS_LIB_NAME@ | ||
Libs: -L${libdir} -l@LRS_LIB_NAME@ | ||
Libs.private: @LRS_PKG_LIBS@ | ||
Cflags: -I${includedir} | ||
|
||
#TODO check -Wl -Bdynamic | ||
#Libs: -L${libdir} -Wl,-Bdynamic -lrealsense |
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,29 @@ | ||
/* License: Apache 2.0. See LICENSE file in root directory. | ||
Copyright(c) 2020 Intel Corporation. All Rights Reserved. */ | ||
|
||
/** \file rs_net.h | ||
* \ | ||
* Exposes RealSense network device functionality for C compilers | ||
*/ | ||
|
||
#ifndef LIBREALSENSE_RS2_NET_H | ||
#define LIBREALSENSE_RS2_NET_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "librealsense2/rs.h" | ||
|
||
/** | ||
* Net device is a rs2_device that can be stream and be contolled remotely over network | ||
* \param[in] api_version Users are expected to pass their version of \c RS2_API_VERSION to make sure they are running the correct librealsense version. | ||
* \param[in] address remote devce ip address. should be the address of the hosting device | ||
* \param[out] error if non-null, receives any error that occurs during this call, otherwise, errors are ignored | ||
*/ | ||
rs2_device* rs2_create_net_device(int api_version, const char* address, rs2_error** error); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
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,47 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2020 Intel Corporation. All Rights Reserved. | ||
|
||
#ifndef LIBREALSENSE_RS2_NET_HPP | ||
#define LIBREALSENSE_RS2_NET_HPP | ||
|
||
#include <librealsense2/rs.hpp> | ||
#include "rs_net.h" | ||
|
||
#include <memory> | ||
|
||
namespace rs2 | ||
{ | ||
class net_device : public rs2::device | ||
{ | ||
public: | ||
net_device(const std::string& address) : rs2::device(init(address)) { } | ||
|
||
/** | ||
* Add network device to existing context. | ||
* Any future queries on the context will return this device. | ||
* This operation cannot be undone (except for destroying the context) | ||
* | ||
* \param[in] ctx context to add the device to | ||
*/ | ||
void add_to(context& ctx) | ||
{ | ||
rs2_error* e = nullptr; | ||
rs2_context_add_software_device(((std::shared_ptr<rs2_context>)ctx).get(), _dev.get(), &e); | ||
error::handle(e); | ||
} | ||
|
||
|
||
private: | ||
std::shared_ptr<rs2_device> init(const std::string& address) | ||
{ | ||
rs2_error* e = nullptr; | ||
auto dev = std::shared_ptr<rs2_device>( | ||
rs2_create_net_device(RS2_API_VERSION, address.c_str(), &e), | ||
rs2_delete_device); | ||
error::handle(e); | ||
|
||
return dev; | ||
} | ||
}; | ||
} | ||
#endif // LIBREALSENSE_RS2_NET_HPP |
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,6 @@ | ||
#!/bin/bash -e | ||
|
||
echo 8388608 > /proc/sys/net/core/wmem_default | ||
echo 8388608 > /proc/sys/net/core/rmem_default | ||
|
||
echo "Setting-up network queues successfully changed" |
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,65 @@ | ||
# License: Apache 2.0. See LICENSE file in root directory. | ||
# Copyright(c) 2019 Intel Corporation. All Rights Reserved. | ||
cmake_minimum_required(VERSION 3.1.0) | ||
|
||
project(realsense2-compression VERSION 1.0.0 LANGUAGES CXX C) | ||
|
||
# Save the command line compile commands in the build output | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS 1) | ||
|
||
set(DEPENDENCIES ${DEPENDENCIES} realsense2) | ||
|
||
file(GLOB COMPRESSION_SOURCES | ||
"*.h" | ||
"*.cpp" | ||
"../ipDeviceCommon/*.h" | ||
) | ||
|
||
set(COMPRESSION_SOURCES ${COMPRESSION_SOURCES} ${LZ4_DIR}/lz4.h ${LZ4_DIR}/lz4.c) | ||
|
||
add_library(${PROJECT_NAME} STATIC ${COMPRESSION_SOURCES}) | ||
|
||
include_directories(${PROJECT_NAME} | ||
../../common | ||
../ipDeviceCommon | ||
../../third-party/easyloggingpp/src | ||
) | ||
|
||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) | ||
#set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) | ||
|
||
add_dependencies(${PROJECT_NAME} | ||
libjpeg-turbo | ||
) | ||
|
||
include_directories(${PROJECT_NAME} | ||
${CMAKE_BINARY_DIR}/libjpeg-turbo/include | ||
${LZ4_DIR} | ||
) | ||
|
||
if(WIN32) | ||
target_link_libraries(${PROJECT_NAME} | ||
PRIVATE ${DEPENDENCIES} | ||
PRIVATE ${CMAKE_BINARY_DIR}/libjpeg-turbo/lib/turbojpeg-static.lib | ||
) | ||
else() | ||
target_link_libraries(${PROJECT_NAME} | ||
PRIVATE ${DEPENDENCIES} | ||
PRIVATE ${CMAKE_BINARY_DIR}/libjpeg-turbo/lib/libturbojpeg.a | ||
) | ||
endif() | ||
|
||
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Library") | ||
|
||
set(CMAKECONFIG_COMPRESS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
install(TARGETS ${PROJECT_NAME} | ||
EXPORT realsense2-compressTargets | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
) | ||
|
||
install(EXPORT realsense2-compressTargets | ||
FILE realsense2-compressTargets.cmake | ||
NAMESPACE ${PROJECT_NAME}:: | ||
DESTINATION ${CMAKECONFIG_COMPRESS_INSTALL_DIR} | ||
) |
Oops, something went wrong.