-
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 #38 from tritonuas/chore/arena-sdk
- Loading branch information
Showing
6 changed files
with
122 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ RUN apt-get update \ | |
gdb \ | ||
git \ | ||
cmake \ | ||
clang-tidy | ||
clang-tidy \ | ||
wget |
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,31 @@ | ||
if(UNIX AND NOT APPLE) | ||
set(ARENA_SDK_DIR "${CMAKE_BINARY_DIR}/_deps/arena-sdk") | ||
set(INSTALL_SCRIPT "${PROJECT_SOURCE_DIR}/deps/arena-sdk/install-arena.sh") | ||
|
||
# run install script with output directory as argument | ||
execute_process( | ||
COMMAND sh ${INSTALL_SCRIPT} ${ARENA_SDK_DIR} | ||
RESULT_VARIABLE ret | ||
) | ||
if(ret EQUAL "0") | ||
# Add a preprocessor macro that will enable us to compile | ||
# functionality that depends on the Arena SDK. | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE | ||
ARENA_SDK_INSTALLED | ||
) | ||
else() | ||
message(FATAL_ERROR "Unable to install Arena-SDK. ${INSTALL_SCRIPT} script exited with code ${ret}.") | ||
endif() | ||
|
||
target_include_directories(${PROJECT_NAME} PRIVATE | ||
"${ARENA_SDK_DIR}/extracted/include/Arena" | ||
"${ARENA_SDK_DIR}/extracted/GenICam/library/CPP/include" | ||
) | ||
file(GLOB_RECURSE ARENA_LIBS | ||
"${ARENA_SDK_DIR}/extracted/lib64/*.so" | ||
"${ARENA_SDK_DIR}/extracted/ffmpeg/*.so" | ||
) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
${ARENA_LIBS} | ||
) | ||
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,64 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
PKGS_DIR=$1 | ||
|
||
if [ ! "$PKGS_DIR" ]; then | ||
echo "ERROR: Could not install Arena SDK. Did not specify installation directory. Must provide installation directory as an argument" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "$PKGS_DIR" | ||
|
||
ARCH=`uname -m` | ||
OS=`uname` | ||
|
||
echo "Installing Arena SDK for $ARCH on $OS to $PKGS_DIR" | ||
if [ $OS != "Linux" ]; then | ||
echo "ERROR: Arena SDK can only be installed on Linux" | ||
exit 1 | ||
else | ||
# pull Arena SDK from TUAS Google Drive | ||
# https://drive.google.com/drive/folders/1Ek1luFtO-FpDUJHP9_NQ9RH5dYhyhWXi?usp=share_link | ||
if [ $ARCH = "aarch64" ]; then | ||
FILE_NAME="ArenaSDK_v0.1.49_Linux_ARM64.tar.gz" | ||
FILE_ID="1VtBji-cWfetM5nXZwt55JuHPWPGahQOH" | ||
ARENA_SDK_DIR="ArenaSDK_Linux_ARM64" | ||
ARENA_CONF="Arena_SDK_ARM64.conf" | ||
elif [ $ARCH = "x86_64" ]; then | ||
FILE_NAME="ArenaSDK_v0.1.68_Linux_x64.tar.gz" | ||
FILE_ID="1pQtheOK-f2N4C2CDi43HTqttGuxHKptg" | ||
ARENA_SDK_DIR="ArenaSDK_Linux_x64" | ||
ARENA_CONF="Arena_SDK_Linux_x64.conf" | ||
else | ||
echo "ERROR: Unable to install Arena-SDK. Unkown architecture $ARCH. Architecture must be aarch64 or x86_64." | ||
exit 1 | ||
fi; | ||
|
||
if [ ! -d "$PKGS_DIR/$ARENA_SDK_DIR" ]; then \ | ||
# Check that wget is installed | ||
if ! command -v wget > /dev/null; then \ | ||
echo "ERROR: Unable to install Arena-SDK. wget is not installed. Install wget for your system and retry." | ||
exit 1 | ||
fi; | ||
|
||
# Check that tar is installed | ||
if ! command -v tar > /dev/null; then \ | ||
echo "ERROR: Unable to install Arena-SDK. tar is not installed. Install tar for your system and retry." | ||
exit 1 | ||
fi; | ||
|
||
# This command is kinda crazy to bypass Google drive's virus scanning warning for large files https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99 | ||
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$FILE_ID" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$FILE_ID" -O "$PKGS_DIR/$FILE_NAME" && rm -rf /tmp/cookies.txt | ||
tar xf "$PKGS_DIR/$FILE_NAME" --directory="$PKGS_DIR" | ||
else \ | ||
echo "WARNING: Arena SDK is already installed at $PKGS_DIR/$ARENA_SDK_DIR. Will not download again."; \ | ||
fi; | ||
|
||
# Symlink arch specific arena install to architecture agnostic directory. | ||
# Build system can point to this folder without knowing which architecture to use. | ||
SYMLINKED_DIR="$PKGS_DIR/extracted" | ||
echo "Symlinking $ARENA_SDK_DIR to $SYMLINKED_DIR" | ||
ln -sf "$PKGS_DIR/$ARENA_SDK_DIR" "$SYMLINKED_DIR" | ||
fi; |
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#ifndef CAMERA_LUCID_HPP_ | ||
#define CAMERA_LUCID_HPP_ | ||
|
||
#ifdef ARENA_SDK_INSTALLED | ||
|
||
#include "interface.hpp" | ||
|
||
class LucidCamera : public CameraInterface { | ||
// override all the camera connection interface functions | ||
}; | ||
|
||
#endif // CAMERA_LUCID_HPP_ | ||
#endif // ARENA_SDK_INSTALLED | ||
|
||
#endif // CAMERA_LUCID_HPP_ |