Skip to content

Commit

Permalink
Bugfix update. See changelog for details
Browse files Browse the repository at this point in the history
* Add support for automatic UDP destination in simple_viz and ROS (ouster-lidar#255)
* Add a read timeout for TCP sockets (ouster-lidar#258)
* Fall back to ipv4 when ipv6 is disabled via kernel parameters (ouster-lidar#261)
* Fix open3d example crash on macos (ouster-lidar#267)
  • Loading branch information
Dima Garbuzov authored and dmitrig committed Aug 3, 2021
1 parent dabcc99 commit 47f25ed
Show file tree
Hide file tree
Showing 57 changed files with 1,548 additions and 235 deletions.
8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
BasedOnStyle: Google
IndentWidth: 4
---
Language: Cpp
DerivePointerAlignment: false
PointerAlignment: Left
Cpp11BracedListStyle: true
35 changes: 35 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,41 @@ Changelog
=========


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

* add preliminary cpack and install support. It should be possible to use a pre-built SDK package
instead of including the SDK in the build tree of your project

ouster_client
-------------
* update cmake package version to 0.2.1
* add a conservative socket read timeout so ``init_client()`` will fail with an error message when
another client fails to close a TCP connection (addresses #258)
* when passed an empty string for the ``udp_dest_host`` parameter, ``init_client()`` will now
configure the sensor using ``set_udp_dest_auto``. Previously, this would turn off UDP output on
the sensor, so any attempt to read data would time out (PR #255)
* fall back to binding ipv4 UDP sockets when ipv6 is not available (addresses #261)

ouster_pcap
-----------
* switch the default pcap encapsulation to ethernet for Ouster Studio compatibility (addresses #265)

ouster_ros
----------
* update ROS package version to 0.2.1
* the ``udp_dest`` parameter to ouster.launch is now optional when connecting to a sensor

ouster_viz
----------
* the second CLI argument of simple_viz specifying the UDP data destination is now optional

python
------
* update ouster-sdk version to 0.2.2
* fix open3d example crash on exit when replaying pcaps on macos (addresses #267)


[20210608]
==========

Expand Down
59 changes: 57 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(DefaultBuildType)

# ==== Project Name ====
project(ouster_example)
project(ouster_example VERSION 20210608)

# ==== Options ====
option(CMAKE_POSITION_INDEPENDENT_CODE "Build position independent code." ON)
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
option(BUILD_VIZ "Build Ouster visualizer." ON)
option(BUILD_PCAP "Build pcap utils." OFF)
option(BUILD_TESTING "Build tests" OFF)
option(BUILD_VIZ "Build Ouster visualizer." ON)

set(CMAKE_CXX_STANDARD 11)
if(MSVC)
Expand All @@ -20,6 +21,11 @@ else()
add_compile_options(-Wall -Wextra -Werror)
endif()

# === Testing ===
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
endif()

# === Subdirectories ===
add_subdirectory(ouster_client)

Expand All @@ -30,3 +36,52 @@ endif()
if(BUILD_VIZ)
add_subdirectory(ouster_viz)
endif()

if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(tests)
endif()

# ==== Install ====
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
OusterSDKConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion)

install(EXPORT ouster-sdk-targets
FILE OusterSDKTargets.cmake
NAMESPACE OusterSDK::
DESTINATION lib/cmake/OusterSDK)

configure_file(cmake/OusterSDKConfig.cmake.in OusterSDKConfig.cmake @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OusterSDKConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/OusterSDKConfigVersion.cmake"
DESTINATION lib/cmake/OusterSDK)

install(FILES LICENSE LICENSE-bin
DESTINATION share)

# ==== Packaging ====
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_VENDOR "Ouster")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ouster sensor SDK")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.rst")
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/ouster")
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_PACKAGE_NAME ouster_sdk)
set(CPACK_GENERATOR "DEB;TGZ")

# source packages
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_IGNORE_FILES /.git /dist)

# deb options
set(CPACK_DEBIAN_PACKAGE_NAME ouster-sdk)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "cmake, libjsoncpp-dev, libtclap-dev, libeigen3-dev,
libglfw3-dev, libglew-dev, libtins-dev, libpcap-dev")

include(CPack)

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018, ouster-lidar
Copyright (c) 2018, Ouster, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
181 changes: 181 additions & 0 deletions LICENSE-bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
Binary distributions of the Ouster SDK may also include the following software:

----

Name: eigen
Description: compiled-in header-only library
Availability: https://gitlab.com/libeigen/eigen
License: MPL2

Name: glew
Description: statically linked
Availability: https://github.com/nigels-com/glew
License: BSD 3-clause
The OpenGL Extension Wrangler Library
Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.

Name: glfw
Description: statically linked
Availability: https://github.com/glfw/glfw
License: zlib

Name: jsoncpp
Description: statically linked
Availability: https://github.com/open-source-parsers/jsoncpp
License: MIT
Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors

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.

Name: libpcap
Description: statically linked
Availability: https://github.com/the-tcpdump-group/libpcap
License: BSD 3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Name: libtins
Description: statically linked
Availability: https://github.com/mfontanini/libtins
License: BSD 2-clause
Copyright (c) 2012-2017, Matias Fontanini
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Name: optional-lite
Description: compiled-in header-only library
Availability: https://github.com/martinmoene/optional-lite
License: BSL-1.0
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Name: pybind11
Description: compiled-in header-only library
Availability: https://github.com/pybind/pybind11
License: BSD 3-clause
Copyright (c) 2016 Wenzel Jakob <[email protected]>, All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 changes: 15 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ and write point clouds out to CSV files::
./ouster_client_example <sensor hostname> <udp data destination>

where ``<sensor hostname>`` can be the hostname (os-99xxxxxxxxxx) or IP of the sensor and ``<udp
data destingation>`` is the hostname or IP to which the sensor should send lidar data. You can also supply ``""``, an empty string, to utilize automatic detection.
data destingation>`` is the hostname or IP to which the sensor should send lidar data. You can also
supply ``""``, an empty string, to utilize automatic detection.

On Windows, you may need to allow the client/visualizer through the Windows firewall to receive
sensor data.
Expand All @@ -125,10 +126,10 @@ Running the Sample Visualizer
Navigate to ``ouster_viz`` under the build directory, which should contain an executable named
``simple_viz`` . Run::

./simple_viz <flags> <sensor hostname> <udp data destination>
./simple_viz [flags] <sensor hostname> [udp data destination]

where ``<sensor hostname>`` can be the hostname (os-99xxxxxxxxxx) or IP of the sensor and ``<udp
data destingation>`` is the hostname or IP to which the sensor should send lidar data.
where ``<sensor hostname>`` can be the hostname (os-99xxxxxxxxxx) or IP of the sensor and ``[udp
data destingation]`` is an optional hostname or IP to which the sensor should send lidar data.

The sample visualizer does not currently include a GUI, but can be controlled with the mouse and
keyboard:
Expand Down Expand Up @@ -212,27 +213,28 @@ new terminal by running::

source myworkspace/devel/setup.bash

Running ROS Nodes with a Live Sensor
------------------------------------
Running ROS Nodes with a Sensor
-------------------------------

Make sure the sensor is connected to the network. See "Connecting to the Sensor" in the `Software
User Manual`_ for instructions and different options for network configuration.

To publish ROS topics from a running sensor, run::

roslaunch ouster_ros ouster.launch sensor_hostname:=<sensor hostname> \
udp_dest:=<udp data destination> \
metadata:=<path to metadata json> \
lidar_mode:=<lidar mode> viz:=<viz>
metadata:=<path to metadata json>

where:

* ``<sensor hostname>`` can be the hostname (os-99xxxxxxxxxx) or IP of the sensor
* ``<udp data destination>`` is the hostname or IP to which the sensor should send data
* ``<path to metadata json>`` is the path to the json file to which to save calibration metadata
* ``<lidar mode>`` is one of ``512x10``, ``512x20``, ``1024x10``, ``1024x20``, or ``2048x10``, and
* ``<viz>`` is either ``true`` or ``false``: if true, a window should open and start displaying data
after a few seconds.

you can also optionally specify:

* ``udp_dest:=<hostname>`` to specify the hostname or IP to which the sensor should send data
* ``lidar_mode:=<mode>`` where mode is one of ``512x10``, ``512x20``, ``1024x10``, ``1024x20``, or
``2048x10``, and
* ``viz:=true`` to visualize the sensor output, if you have the rviz ROS package installed

Note that by default the working directory of all ROS nodes is set to ``${ROS_HOME}``, generally
``$HOME/.ros``, so if ``metadata`` is a relative path, it will write to that path inside
Expand Down
Loading

0 comments on commit 47f25ed

Please sign in to comment.