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

Install Findjsoncpp alongside project #460

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ea72cbb
Install findjsoncpp cmake module since package managers (at least bre…
themightyoarfish Nov 22, 2021
97b08ad
Merge pull request #1 from psiori/install-dependency-modules
themightyoarfish Nov 22, 2021
778af86
Add uninstall target
themightyoarfish Nov 22, 2021
9b43af3
Add uninstaller
themightyoarfish Dec 9, 2021
7dfdab5
Do not require viz dependencies
themightyoarfish Dec 15, 2021
98f342b
Fetch upstream
themightyoarfish Feb 22, 2022
f5a222f
Merge branch 'master' of github.com:ouster-lidar/ouster_example into …
themightyoarfish Feb 22, 2022
31e17a3
Merge branch 'master' into install-dependency-modules
themightyoarfish Feb 22, 2022
9017b3f
Merge remote-tracking branch 'origin/master' into HEAD
themightyoarfish Sep 16, 2022
3a61f8d
Fix init_client for ts and lidar mode bug (#438)
kairenw Sep 27, 2022
212df0e
Sync with master
Samahu Oct 3, 2022
84b195b
Update CHANGELOG
Samahu Oct 3, 2022
bcc7ec0
Drop the release tag on latest change log entry
Samahu Oct 4, 2022
a12011a
Merge pull request #440 from ouster-lidar/ouster-ros-separation
Samahu Oct 5, 2022
59570cd
Merge branch 'master' of github.com:psiori/ouster_example into master
themightyoarfish Oct 8, 2022
2d22b05
Merge remote-tracking branch 'upstream/master' into master
themightyoarfish Oct 8, 2022
279c9fb
Update for FW 3.0/2.5. See changelog for details (#456)
kairenw Nov 17, 2022
00e9dc9
Merge branch 'master' of github.com:ouster-lidar/ouster_example
themightyoarfish Nov 22, 2022
aaea32a
Merge branch 'master-ouster' into install-dependency-modules
themightyoarfish Nov 23, 2022
2abfbb9
Merge branch 'master' into install-dependency-modules
themightyoarfish Nov 23, 2022
9a304d9
Merge pull request #2 from psiori/install-dependency-modules
themightyoarfish Nov 23, 2022
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
57 changes: 56 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,60 @@
Changelog
=========

[unreleased]
============

ouster_client
--------------
* breaking change: signal multiplier type changed to double to support new FW values of signal
multiplier.
* breaking change: make_xyz_lut takes mat4d beam_to_lidar_transform instead of
lidar_origin_to_beam_origin_mm double to accomodate new FWs. Old reference Python implementation
was kept, but new reference was also added.
* address an issue that could cause the processed frame being dropped in favor or the previous
frame when the frame_id wraps-around.
* added a new flag ``CONFIG_FORCE_REINIT`` for ``set_config()`` method, to force the sensor to reinit
even when config params have not changed.
* breaking change: drop defaults parameters from the shortform ``init_client()`` method.
* added a new method ``init_logger()`` to provide control over the logs emitted by ``ouster_client``.
* add parsing for new FW 3.0 thermal features shot_limiting and thermal_shutdown statuses and countdowns
* add frame_status to LidarScan

python
------
* breaking change: drop defaults parameters of ``client.Sensor`` constructor.
* breaking change: change Scans interface Timeout to default to 1 second instead of None
* added a new method ``init_logger()`` to provide control over the logs emitted by ``client.Sensor``.
* add ``client.LidarScan`` methods ``__repr__()`` and ``__str__()``.

ouster_viz
----------
* add ``SimpleViz.screenshot()`` function and a key handler ``SHIFT-Z`` to
save a screenshot. Can be called from a client thread, and executes
asyncronously (i.e. returns immediately and pushes a one off callback
to frame buffer handlers)
* add ``PointViz.viewport_width()`` and ``PointViz.viewport_height()`` functions
* add ``PointViz.push/pop_frame_buffer_handler()`` to attach a callbacks on
every frame draw update that calls from the main rendering loop.
* add ``SHIFT-X`` key to SimpleViz to start continuous saving of screenshots
on every draw operation. (good for making videos)
* expose ``Camera.set_target`` function through pybind

ouster-sdk
----------
* Moved ouster_ros to its own repo
* pin ``openssl`` Conan package dependency to ``openssl/1.1.1s`` due to
``libtins`` and ``libcurl`` conflicting ``openssl`` versions


[20220927]
==========

ouster_client
--------------
* fix a bug in longform ``init_client()`` which was not setting timestamp_mode and lidar_mode correctly


[20220826]
==========

Expand Down Expand Up @@ -43,7 +97,8 @@ ouster_ros
* drop FW 1.13 compatibility for sensors and recorded bags
* remove setting of EIGEN_MAX_ALIGN_BYTES
* add two new ros services /ouster/get_config and /ouster/set_config (experimental)
* Add new timestamp_mode TIME_FROM_ROS_TIME
* add new timestamp_mode TIME_FROM_ROS_TIME
* declare PCL_NO_PRECOMPILE ahead of all PCL library includes


[20220608]
Expand Down
29 changes: 23 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
cmake_minimum_required(VERSION 3.10...3.22)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# for installation, install only custom find scripts which are not shipped by package
# managers or cmake itself. This does not apply e.g. to eigen
set(DEPENDENCY_MODULES ${CMAKE_CURRENT_LIST_DIR}/cmake/Findjsoncpp.cmake)

include(DefaultBuildType)

# configure vcpkg from environment variables, if present
include(VcpkgEnv)

# ==== Project Name ====
project(ouster_example VERSION 20220826)
project(ouster_example VERSION 20220927)

# generate version header
set(OusterSDK_VERSION_STRING 0.5.1)
set(OusterSDK_VERSION_STRING 0.7.1.b1)
include(VersionGen)

# ==== Options ====
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")
"libjsoncpp-dev, libeigen3-dev, libtins-dev, libglfw3-dev, libglew-dev, libspdlog-dev")

include(CPack)

Expand All @@ -109,6 +114,18 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OusterSDKConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/OusterSDKConfigVersion.cmake"
DESTINATION lib/cmake/OusterSDK)

install(FILES LICENSE
DESTINATION share/doc/${CPACK_DEBIAN_PACKAGE_NAME}
RENAME copyright)
# we install any custom dependency modules here
install(FILES ${DEPENDENCY_MODULES}
DESTINATION lib/cmake/OusterSDK/Modules)
install(FILES LICENSE LICENSE-bin
DESTINATION share)

# make uninstall
add_custom_target("uninstall" COMMENT "Uninstall installed files")
add_custom_command(
TARGET "uninstall"
POST_BUILD
COMMENT "Uninstall files with install_manifest.txt"
COMMAND xargs rm -vf < install_manifest.txt || echo Nothing in
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

posix only i suppose

install_manifest.txt to be uninstalled!
)
28 changes: 28 additions & 0 deletions LICENSE-bin
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,31 @@ License: Curl License
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.

Name: spdlog
Description: statically linked
Availability: https://github.com/gabime/spdlog
License: MIT
Copyright (c) 2016 Gabi Melman.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-- NOTE: Third party dependency used by this software --
This software depends on the fmt lib (MIT License),
and users must comply to its license: https://github.com/fmtlib/fmt/blob/master/LICENSE.rst
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ reading and visualizing 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)

.. note::
Ouster ROS driver code has been moved out to a separate GitHub repository. To get started using the
driver follow the instructions provided on the repository's main page: https://github.com/ouster-lidar/ouster-ros


Contact
=======

For support of the Ouster SDK, please use `Github Issues <https://github.com/ouster-lidar/ouster_example/issues>`_ in this repo.

For support of Ouster products outside of the SDK, please use `Ouster customer support <https://ouster.atlassian.net/servicedesk/customer/portal/8/group/22/create/86>`_.

For suspected security problems, please contact us at [email protected].


License
=======
Expand Down
4 changes: 3 additions & 1 deletion cmake/OusterSDKConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ message(STATUS "Found OusterSDK: ${CMAKE_CURRENT_LIST_FILE}")

include(CMakeFindDependencyMacro)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/Modules/")

# ouster_client dependencies
find_dependency(Eigen3)
find_dependency(jsoncpp)
find_dependency(CURL)
find_dependency(spdlog)

# viz dependencies
if(@BUILD_VIZ@)
set(OpenGL_GL_PREFERENCE GLVND)
find_dependency(OpenGL)
find_dependency(Threads)
find_dependency(glfw3)

if(@OUSTER_VIZ_USE_GLAD@)
Expand Down
7 changes: 7 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ 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("libcurl/7.82.0")

if self.options.build_pcap:
Expand Down
4 changes: 2 additions & 2 deletions docs/cpp/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Building the C++ Client from Source
===================================

Building the example code requires a compiler supporting C++11 and CMake 3.1 or newer and the
Building the example code requires a compiler supporting C++14 and CMake 3.1 or newer and the
jsoncpp, Eigen3, and tins libraries with headers installed on the system. The sample visualizer also
requires the GLFW3 and GLEW libraries.

Expand All @@ -19,7 +19,7 @@ To install build dependencies on Ubuntu, run:
.. code:: console

$ sudo apt install build-essential cmake libjsoncpp-dev libeigen3-dev libcurl4-openssl-dev \
libtins-dev libpcap-dev libglfw3-dev libglew-dev
libtins-dev libpcap-dev libglfw3-dev libglew-dev libspdlog-dev

You may also install curl with a different ssl backend, for example libcurl4-gnutls-dev or
libcurl4-nss-dev.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
:caption: ROS1 Guide
:hidden:

Build and Use <https://github.com/ouster-lidar/ouster-ros/docs/index.rst>
Build and Use <https://github.com/ouster-lidar/ouster-ros/wiki/index>

.. toctree::
:caption: SDK Reference
Expand Down
6 changes: 6 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,9 @@ C++

The Ouster C++ SDK currently must be built and installed from sources.
Please refer to :doc:`/cpp/building`.


ROS
===
Ouster ROS driver code has been moved out to a separate GitHub repository. To get started using the
driver follow the instructions provided on the repository's main page: https://github.com/ouster-lidar/ouster-ros
3 changes: 2 additions & 1 deletion docs/python/devel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Building the Python SDK from source requires several dependencies:
- `libpcap <https://www.tcpdump.org/>`_
- `libglfw3 <https://www.glfw.org/>`_ >= 3.2
- `libglew <http://glew.sourceforge.net/>`_ >= 2.1 or `glad <https://github.com/Dav1dde/glad>`_
- `spdlog <https://github.com/gabime/spdlog>`_ >= 1.9
- `Python <https://www.python.org/>`_ >= 3.7 (with headers and development libraries)
- `pybind11 <https://pybind11.readthedocs.io>`_ >= 2.0

Expand All @@ -33,7 +34,7 @@ On supported Debian-based linux systems, you can install all build dependencies
$ sudo apt install build-essential cmake \
libeigen3-dev libjsoncpp-dev libtins-dev libpcap-dev \
python3-dev python3-pip pybind11-dev libcurl4-openssl-dev \
libglfw3-dev libglew-dev
libglfw3-dev libglew-dev libspdlog-dev

On macos >= 10.13, using homebrew, you should be able to run:

Expand Down
2 changes: 2 additions & 0 deletions docs/python/viz/viz-run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Keyboard controls:
``ctrl + ./,`` Step 10 frames forward/back
``>/<`` Increase/decrease playback rate (during replay)
``shift`` Camera Translation with mouse drag
``shift-z`` Save a screenshot of the current view
``shift-x`` Toggle a continuous saving of screenshots
============== ===============================================

..
Expand Down
11 changes: 8 additions & 3 deletions examples/client_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <iostream>
#include <vector>

#include "ouster/impl/build.h"
#include "ouster/client.h"
#include "ouster/impl/build.h"
#include "ouster/lidar_scan.h"
#include "ouster/types.h"

Expand All @@ -36,6 +36,11 @@ int main(int argc, char* argv[]) {

return argc == 1 ? EXIT_SUCCESS : EXIT_FAILURE;
}

// Limit ouster_client log statements to "info" and direct the output to log
// file rather than the console (default).
sensor::init_logger("info", "ouster.log");

std::cerr << "Ouster client example " << ouster::SDK_VERSION << std::endl;
/*
* The sensor client consists of the network client and a library for
Expand All @@ -50,11 +55,11 @@ int main(int argc, char* argv[]) {
const std::string sensor_hostname = argv[1];
const std::string data_destination = (argc == 3) ? argv[2] : "";

std::cerr << "Connecting to \"" << sensor_hostname << "\"... ";
std::cerr << "Connecting to \"" << sensor_hostname << "\"...\n";

auto handle = sensor::init_client(sensor_hostname, data_destination);
if (!handle) FATAL("Failed to connect");
std::cerr << "ok" << std::endl;
std::cerr << "Connection to sensor succeeded" << std::endl;

/*
* Configuration and calibration parameters can be queried directly from the
Expand Down
6 changes: 3 additions & 3 deletions examples/representations_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <vector>

#include "helpers.h"
#include "ouster/impl/build.h"
#include "ouster/client.h"
#include "ouster/impl/build.h"
#include "ouster/lidar_scan.h"
#include "ouster/types.h"

Expand Down Expand Up @@ -101,8 +101,8 @@ int main(int argc, char* argv[]) {
// say a vehicle center
//! [doc-stag-extrinsics-to-xyzlut]
auto lut_extrinsics = make_xyz_lut(
w, h, sensor::range_unit, info.lidar_origin_to_beam_origin_mm,
transformation, info.beam_azimuth_angles, info.beam_altitude_angles);
w, h, sensor::range_unit, info.beam_to_lidar_transform, transformation,
info.beam_azimuth_angles, info.beam_altitude_angles);

std::cerr << "Calculating 3d Points of with special transform provided.."
<< std::endl;
Expand Down
6 changes: 4 additions & 2 deletions ouster_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
find_package(Eigen3 REQUIRED)
find_package(jsoncpp REQUIRED)
find_package(CURL REQUIRED)
find_package(spdlog REQUIRED)

# ==== Libraries ====
add_library(ouster_client src/client.cpp src/types.cpp src/netcompat.cpp src/lidar_scan.cpp
src/image_processing.cpp src/buffered_udp_source.cpp src/parsing.cpp
src/sensor_http.cpp src/sensor_http_imp.cpp src/sensor_tcp_imp.cpp)
src/sensor_http.cpp src/sensor_http_imp.cpp src/sensor_tcp_imp.cpp src/logging.cpp)
target_link_libraries(ouster_client
PUBLIC
Eigen3::Eigen
$<BUILD_INTERFACE:ouster_build>
PRIVATE
CURL::libcurl
jsoncpp_lib)
jsoncpp_lib
spdlog::spdlog)
target_compile_definitions(ouster_client PRIVATE EIGEN_MPL2_ONLY)
add_library(OusterSDK::ouster_client ALIAS ouster_client)

Expand Down
Loading