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

Solwr fixes #8

Open
wants to merge 4 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
48 changes: 4 additions & 44 deletions Python/API/VzenseDS_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,10 @@
class VzenseTofCam():
device_handle = c_void_p(0)
def __init__(self):
system_ = platform.system().lower()
machine_ = platform.machine().lower()
architecture_ = platform.architecture()[0]
print('system:',system_)
print('machine_:',machine_)
print('architecture:',architecture_)
if system_ == 'linux':
if machine_ == 'x86_64':
os_info = os.uname()
print('os_info:',type(os_info))
system_info = os_info.version
print('version:',system_info)
if system_info.find('18.04') != -1 or system_info.find('20.04') != -1:
libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Ubuntu18.04/Lib/libNebula_api.so"
print(libpath)
self.vz_cam_lib = cdll.LoadLibrary(libpath)
else:
libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Ubuntu16.04/Lib/libNebula_api.so"
print(libpath)
self.vz_cam_lib = cdll.LoadLibrary(libpath)
elif machine_ == 'aarch64':
libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/AArch64/Lib/libNebula_api.so"
print(libpath)
self.vz_cam_lib = cdll.LoadLibrary(libpath)
else:
print('do not supported OS', system_, machine_)
exit()
elif platform.system() == 'Windows':
if machine_ == 'amd64':
if architecture_ == '64bit':
libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Windows/Bin/x64/Nebula_api.dll"
print(libpath)
self.vz_cam_lib = cdll.LoadLibrary(libpath)
else:
libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Windows/Bin/x86/Nebula_api.dll"
print(libpath)
self.vz_cam_lib = cdll.LoadLibrary(libpath)
else:
print('do not supported OS', system_, machine_)
exit()
else:
print('do not supported OS', system_, machine_)
exit()


libpath = (os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + os.path.sep)) + "/Ubuntu18.04/Lib/libNebula_api.so"
self.vz_cam_lib = cdll.LoadLibrary(libpath)

self.device_handle = c_void_p(0)
self.vz_cam_lib.VZ_Initialize()

Expand Down
7 changes: 7 additions & 0 deletions Python/API/VzenseDS_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ class VzReturnStatus(Enum):
VzRetUpgradeImgError = -17
VzRetUpgradeImgPathTooLong = -18
VzRetUpgradeCallbackNotSet = -19
VzRetProductNotSupport = -20
VzRetNoConfigFolder = -21
VzRetWebServerStartError = -22
VzRetGetOverStayFrame = -23
VzRetCreateLogDirError = -24
VzRetCreateLogFileError = -25
VzRetNoAdapterConnected = -100
VzRetReInitialized = -101
VzRetNoInitialized = -102
Expand All @@ -50,6 +56,7 @@ class VzReturnStatus(Enum):
VzRetIPNotMatch = -106
VzRetNotStopStream = -107
VzRetNotStartStream = -108
VzRetNoDriversFolder = -109
VzRetOthers = -255

class VzConnectStatus(Enum):
Expand Down
Empty file added Python/API/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions Python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include API/LICENSE
recursive-include API/Ubuntu18.04/Lib *
recursive-include API/Ubuntu18.04/Include *
recursive-include API/Ubuntu16.04/Lib *
recursive-include API/Ubuntu16.04/Include *
17 changes: 17 additions & 0 deletions Python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
from setuptools import setup

version = os.environ.get("PKG_VERSION", "0.1")

setup(
name="nebula",
version=version,
description="Nebula SDK source code",
author="Vzense Technology",
author_email="[email protected]",
url='https://github.com/Vzense/NebulaSDK',
packages=["API"],
include_package_data=True,
license="BSD",
install_requires=['numpy'],
)