Skip to content

Commit

Permalink
OusterSDK + Ouster CLI 2023 Q2 Release (#534)
Browse files Browse the repository at this point in the history
OusterSDK + Ouster CLI 2023 Q2 Release
================================

With this release we are adding a bunch of things that we've used
internally at Ouster for some
time and we hope it will be useful to a broader set of users well.

Major things:

# Ouster CLI (Python)
Command Line Tools `ouster-cli` that combines basic and common actions
to work with sensors:
- Discover connected sensors (`ouster-cli discover`)
- Configure sensors (`ouster-cli source <SENSOR> config`)
- Get sensors metadata (`ouster-cli source <SENSOR> metadata`)
- Record data to a pcap with metadata json stored along (`ouster-cli
source <SENSOR> record`)
- Visualize data from sensor or pcap (`ouster-cli source [<SENSOR> |
<PCAP>] viz`)
- Pcap slice and convertion operations (`ouster-cli source <PCAP>
{info,slice,convert}`)
- Run slam to get trajectories and registered point clouds (`ouster-cli
source [<SENSOR> |
  <PCAP>] slam`)

# Ouster Mapping (Python)
Mapping utilities + tools to save registered point clouds from pcap or
running sensors that
accounts for sensor motion and deskews the cloud.

# Ouster OSF (C++/Python)
C++/Python library to save stream of LidarScans with metadata. Used by
mapping module to work with
scans + poses.

For more details please see the CHANGELOG.rst file.
  • Loading branch information
bexcite authored Jul 7, 2023
1 parent ff46c96 commit 9d09711
Show file tree
Hide file tree
Showing 193 changed files with 22,896 additions and 780 deletions.
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@ python/**/*.pyd

# visual studio
.vs/
out/
out/

# vim
*.swp

# CMake, Ninja
.ninja_deps
.ninja_log
CMakeFiles
CTestTestfile.cmake

# Built artifacts
generated
rules.ninja
*.a
58 changes: 58 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,64 @@
Changelog
=========

20230710
========

* Update vcpkg ref of build to 2023-02-24
*

ouster_osf
----------

* Add Ouster OSF C++/Python library to save stream of LidarScans with metadata

ouster_client
-------------

* Add ``LidarScan.pose`` with poses per column
* Add ``_client.IndexedPcapReader`` and ``_client.PcapIndex`` to enable random
pcap file access by frame number
* [BREAKING] remove ``ouster::Imu`` object
* Add get_field_types function for LidarScan, from sensor_info
* bugfix: return metadata regardless of sensor_info status field
* Make timeout on curl more configurable

ouster_viz
----------

* [BREAKING] Changed Python binding for ``Cloud.set_column_poses()`` to accept ``[Wx4x4]`` array
of poses, column-storage order
* bugfix: fix label re-use
* Add ``LidarScan.pose`` handling to ``viz.LidarScanViz``, and new ``T`` keyboard
binding to toggle column poses usage

ouster_pcap
-----------
* bugfix: Use unordered map to store stream_keys to avoid comparison operators on map

Python SDK
----------
* Add Python 3.11 wheels
* Retire simple-viz for ouster-cli utility
* Add default ? key binding to LidarScanViz and consolidate bindings into stored definition
* Remove pcap-to-csv for ouster-cli utility
* Add validator class for LidarPacket

ouster-cli
----------
This release also marks the introduction of the ouster-cli utility which includes, among many features:
* Visualization from a connected sensor with automatic configuration
* Recording from a connected sensor
* Simultaneous record and viz from a connected sensor
* Obtaining metadata from a connected sensor
* Visualization from a specified PCAP
* Slice, info, and conversion for a specificed PCAP
* Utilities for benchmarking system, printing system-info
* Discovery which indicates all connected sensors on network
* Automatic logging to .ouster-cli
* Mapping utilities


[20230403]
==========

Expand Down
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ include(DefaultBuildType)
include(VcpkgEnv)

# ==== Project Name ====
project(ouster_example VERSION 20230403)
project(ouster_example VERSION 20230710)

# generate version header
set(OusterSDK_VERSION_STRING 0.8.1)
set(OusterSDK_VERSION_STRING 0.9.0)
include(VersionGen)

# ==== Options ====
option(CMAKE_POSITION_INDEPENDENT_CODE "Build position independent code." ON)
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
option(BUILD_PCAP "Build pcap utils." ON)
option(BUILD_OSF "Build Ouster OSF library." OFF)
option(BUILD_VIZ "Build Ouster visualizer." ON)
option(BUILD_TESTING "Build tests" OFF)
option(BUILD_EXAMPLES "Build C++ examples" OFF)
Expand Down Expand Up @@ -56,6 +57,10 @@ if(BUILD_PCAP)
add_subdirectory(ouster_pcap)
endif()

if(BUILD_OSF)
add_subdirectory(ouster_osf)
endif()

if(BUILD_VIZ)
add_subdirectory(ouster_viz)
endif()
Expand Down Expand Up @@ -88,7 +93,7 @@ set(CPACK_SOURCE_IGNORE_FILES /.git /dist)
set(CPACK_DEBIAN_PACKAGE_NAME ouster-sdk)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"libjsoncpp-dev, libeigen3-dev, libtins-dev, libglfw3-dev, libglew-dev, libspdlog-dev")
"libjsoncpp-dev, libeigen3-dev, libtins-dev, libglfw3-dev, libglew-dev, libspdlog-dev, libpng-dev, libflatbuffers-dev")
include(CPack)

# ==== Install ====
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reading and visualizing data.

* `ouster_client <ouster_client/>`_ contains an example C++ client for ouster sensors
* `ouster_pcap <ouster_pcap/>`_ contains C++ pcap functions for ouster sensors
* `ouster_osf <ouster_osf/>`_ contains C++ OSF library to store ouster sensors data
* `ouster_viz <ouster_viz/>`_ contains a customizable point cloud visualizer
* `python <python/>`_ contains the code for the ouster sensor python SDK (``ouster-sdk`` Python package)

Expand Down
8 changes: 8 additions & 0 deletions cmake/FindPcap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ find_library(PCAP_LIBRARY
NAMES pcap pcap_static wpcap
HINTS ${PC_PCAP_LIBRARY_DIRS})

if(NOT TARGET libpcap::libpcap)
add_library(libpcap::libpcap UNKNOWN IMPORTED)
set_target_properties(libpcap::libpcap PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PCAP_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${PCAP_LIBRARY}")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Pcap
REQUIRED_VARS PCAP_LIBRARY PCAP_INCLUDE_DIR
Expand Down
54 changes: 54 additions & 0 deletions cmake/FindPybind11Internal.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
include(FindPackageHandleStandardArgs)

if(DEFINED PYTHON_EXECUTABLE)
execute_process(
COMMAND
"${PYTHON_EXECUTABLE}" "-c"
"import sys; print(f'{str(sys.version_info.major)}.{str(sys.version_info.minor)}.{str(sys.version_info.micro)}')"
OUTPUT_VARIABLE _version_full
OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(
COMMAND
"${PYTHON_EXECUTABLE}" "-c"
"import pybind11;print(pybind11.get_cmake_dir())"
OUTPUT_VARIABLE _pybind_dir
RESULT_VARIABLE _pybind_result
ERROR_VARIABLE _pybind_error
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${_pybind_result} EQUAL 0)
LIST(APPEND CMAKE_PREFIX_PATH "${_pybind_dir}")
if("${_version_full}" VERSION_GREATER_EQUAL "3.11.0")
find_package(pybind11 2.10 REQUIRED)
else()
find_package(pybind11 2.0 REQUIRED)
endif()

set(_PYBIND11_INTERNAL_PYTHON_VERSION "")
if(NOT PYTHON_VERSION STREQUAL "")
message("Found Python Version VIA: PYTHON_VERSION")
set(_PYBIND11_INTERNAL_PYTHON_VERSION "${PYTHON_VERSION}")
elseif(NOT PYTHONLIBS_VERSION_STRING STREQUAL "")
message("Found Python Version VIA: PYTHONLIBS_VERSION_STRING")
set(_PYBIND11_INTERNAL_PYTHON_VERSION "${PYTHONLIBS_VERSION_STRING}")
elseif(NOT PYTHON_VERSION_STRING STREQUAL "")
message("Found Python Version VIA: PYTHON_VERSION_STRING")
set(_PYBIND11_INTERNAL_PYTHON_VERSION "${PYTHON_VERSION_STRING}")
endif()
if(VCPKG_TOOLCHAIN AND NOT "${_version_full}" VERSION_EQUAL "${_PYBIND11_INTERNAL_PYTHON_VERSION}")
message(FATAL_ERROR "Python Versions Do Not Match
\tRequested Version:
\t\t${_version_full}
\tVersions Found:
\t\tPYTHON_VERSION: \"${PYTHON_VERSION}\"
\t\tPYTHONLIBS_VERSION_STRING: \"${PYTHONLIBS_VERSION_STRING}\"
\t\tPYTHON_VERSION_STRING: \"${PYTHON_VERSION_STRING}\"
\tInternal Cache: \"${_PYBIND11_INTERNAL_PYTHON_VERSION}\"")
endif()
else()
message(FATAL_ERROR "ERROR In Setting Pybind11 CMAKE Prefix Path: ${_pybind_error}")
endif()
else()
message(FATAL_ERROR "PYTHON_EXECUTABLE NOT SET")
endif()

1 change: 1 addition & 0 deletions cmake/Findlibtins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ if(NOT TARGET libtins)
add_library(libtins INTERFACE)
set_target_properties(libtins PROPERTIES
INTERFACE_LINK_LIBRARIES ${LIBTINS_LIBRARIES})
add_library(libtins::libtins ALIAS libtins)
install(TARGETS libtins EXPORT ouster-sdk-targets)
endif()
7 changes: 7 additions & 0 deletions cmake/OusterSDKConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ find_dependency(jsoncpp)
find_dependency(CURL)
find_dependency(spdlog)

# ouster_osf dependencies
if(@BUILD_OSF@)
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(Flatbuffers NAMES Flatbuffers FlatBuffers)
endif()

# viz dependencies
if(@BUILD_VIZ@)
set(OpenGL_GL_PREFERENCE GLVND)
Expand Down
6 changes: 5 additions & 1 deletion conan/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_package"
cmake.definitions["BUILD_OSF"] = True
cmake.definitions[
"CMAKE_PROJECT_PackageTest_INCLUDE"] = os.path.join(
self.build_folder, "conan_paths.cmake")
Expand All @@ -27,4 +28,7 @@ def test(self):
os.chdir("examples")
# on Windows VS puts execulables under `./Release` or `./Debug` folders
exec_path = f"{os.sep}{self.settings.build_type}" if self.settings.os == "Windows" else ""
self.run(".%s%sclient_example" % (exec_path, os.sep))
self.run(f".{exec_path}{os.sep}client_example")

# Smoke test OSF lib
self.run(f".{exec_path}{os.sep}osf_reader_example")
17 changes: 10 additions & 7 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class OusterSDKConan(ConanFile):
options = {
"build_viz": [True, False],
"build_pcap": [True, False],
"build_osf": [True, False],
"shared": [True, False],
"fPIC": [True, False],
"ensure_cpp17": [True, False],
Expand All @@ -25,6 +26,7 @@ class OusterSDKConan(ConanFile):
default_options = {
"build_viz": False,
"build_pcap": False,
"build_osf": False,
"shared": False,
"fPIC": True,
"ensure_cpp17": False,
Expand All @@ -37,6 +39,7 @@ class OusterSDKConan(ConanFile):
"conan/*",
"ouster_client/*",
"ouster_pcap/*",
"ouster_osf/*",
"ouster_viz/*",
"tests/*",
"CMakeLists.txt",
Expand All @@ -57,20 +60,19 @@ def config_options(self):
del self.options.fPIC

def requirements(self):
# not required directly here but because libtins and libcurl pulling
# slightly different versions of zlib and openssl we need to set it
# here explicitly
self.requires("zlib/1.2.13")
self.requires("openssl/1.1.1s")

self.requires("eigen/3.4.0")
self.requires("jsoncpp/1.9.5")
self.requires("spdlog/1.10.0")
self.requires("spdlog/1.11.0")
self.requires("fmt/9.1.0")
self.requires("libcurl/7.84.0")

if self.options.build_pcap:
self.requires("libtins/4.3")

if self.options.build_osf:
self.requires("flatbuffers/23.5.26")
self.requires("libpng/1.6.39")

if self.options.build_viz:
self.requires("glad/0.1.34")
if self.settings.os != "Windows":
Expand All @@ -83,6 +85,7 @@ def configure_cmake(self):
cmake = CMake(self)
cmake.definitions["BUILD_VIZ"] = self.options.build_viz
cmake.definitions["BUILD_PCAP"] = self.options.build_pcap
cmake.definitions["BUILD_OSF"] = self.options.build_osf
cmake.definitions["OUSTER_USE_EIGEN_MAX_ALIGN_BYTES_32"] = self.options.eigen_max_align_bytes
# alt way, but we use CMAKE_TOOLCHAIN_FILE in other pipeline so avoid overwrite
# cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = os.path.join(self.build_folder, "conan_paths.cmake")
Expand Down
6 changes: 6 additions & 0 deletions docs/cli/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=========
Changelog
=========

[0.9.0]
* Initial Public Release
Loading

0 comments on commit 9d09711

Please sign in to comment.