From 5c00aa97ee8244072ed9bf14870facf57d4aab98 Mon Sep 17 00:00:00 2001
From: dgarbuzov <34632025+dgarbuzov@users.noreply.github.com>
Date: Thu, 10 Dec 2020 16:30:38 -0800
Subject: [PATCH] Minor changes from the last week of feedback (#195)
* Make location of ROS build instructions more prominent in README
* Minor typo and formatting fixes in the README
* Avoid spurious git error messages when building outside a git repo
---
CHANGELOG.rst | 2 +-
README.rst | 23 ++++++++++++-----------
cmake/VersionGen.cmake | 1 +
ouster_client/include/ouster/types.h | 6 +++++-
ouster_client/src/client.cpp | 2 ++
ouster_client/src/types.cpp | 2 ++
6 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ef1dd25d..f124d861 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -2,7 +2,7 @@
Changelog
=========
-[20201202]
+[20201209]
==========
Changed
diff --git a/README.rst b/README.rst
index bc8ff40e..40babfd8 100644
--- a/README.rst
+++ b/README.rst
@@ -11,16 +11,16 @@ Ouster Example Code
Summary
=======
-Sample code for connecting to and configuring ouster sensors, reading and visualizing data, and
-interfacing with ROS.
+To get started building the client and visualizer libraries, see the `Sample Client and Visualizer`_
+section below. For instructions on ROS, start with the `Example ROS Code`_ section.
+
+This repository contains sample code for connecting to and configuring ouster sensors, reading and
+visualizing data, and interfacing with ROS.
* `ouster_client `_ contains an example C++ client for ouster sensors
* `ouster_viz `_ contains a basic point cloud visualizer
* `ouster_ros `_ contains example ROS nodes for publishing point cloud messages
-To get started building the client and visualizer libraries, see the ``Building`` section below. For
-instructions on ROS, start with the ``ROS`` section.
-
Sample Client and Visualizer
============================
@@ -69,10 +69,8 @@ for dependencies. Follow the official documentation to set up your build environ
* `Vcpkg, at tag "2020.07" installed and integrated with Visual Studio
`_
-.. note::
-
- You'll need to run ``git checkout 2020.07`` in the vcpkg directory before bootstrapping to use
- the correct versions of the dependencies. Building may fail unexpectedly if you skip this step.
+**Note** You'll need to run ``git checkout 2020.07`` in the vcpkg directory before bootstrapping to
+use the correct versions of the dependencies. Building may fail unexpectedly if you skip this step.
Don't forget to integrate vcpkg with Visual Studio after bootstrapping::
@@ -128,7 +126,8 @@ Navigate to ``ouster_viz`` under the build directory, which should contain an ex
where ```` can be the hostname (os-99xxxxxxxxxx) or IP of the sensor and ```` is the hostname or IP to which the sensor should send lidar data.
-For usage and other options, run ``./simple_viz -h`` Mouse controls:
+The sample visualizer does not currently include a GUI, but can be controlled with the mouse and
+keyboard:
* Click and drag rotates the view
* Middle click and drag moves the view
@@ -161,6 +160,8 @@ Keyboard controls:
``shift`` Camera Translation with mouse drag
============= ============================================
+For usage and other options, run ``./simple_viz -h``
+
Example ROS Code
================
@@ -233,7 +234,7 @@ Recording Data
To record raw sensor output use `rosbag record`_. After starting the ``roslaunch`` command above, in
another terminal, run::
- rosbag record /os_node/imu_packets /os_node/lidar_packets`
+ rosbag record /os_node/imu_packets /os_node/lidar_packets
This will save a bag file of recorded data in the current working directory.
diff --git a/cmake/VersionGen.cmake b/cmake/VersionGen.cmake
index e20d9dcd..00442a96 100644
--- a/cmake/VersionGen.cmake
+++ b/cmake/VersionGen.cmake
@@ -9,6 +9,7 @@ if(GIT_FOUND)
COMMAND ${GIT_EXECUTABLE} describe --always --match none --dirty
OUTPUT_VARIABLE GIT_OUTPUT
RESULT_VARIABLE GIT_RESULT
+ ERROR_QUIET
WORKING_DIRECTORY ${VERSION_GEN_SOURCE_DIR})
if(${GIT_RESULT} EQUAL 0)
diff --git a/ouster_client/include/ouster/types.h b/ouster_client/include/ouster/types.h
index 3ed6b4ab..9e78ddc8 100644
--- a/ouster_client/include/ouster/types.h
+++ b/ouster_client/include/ouster/types.h
@@ -47,6 +47,10 @@ enum timestamp_mode {
TIME_FROM_PTP_1588
};
+enum configuration_version {
+ FW_2_0 = 3
+};
+
struct data_format {
uint32_t pixels_per_column;
uint32_t columns_per_packet;
@@ -103,7 +107,7 @@ uint32_t n_cols_of_lidar_mode(lidar_mode mode);
/**
* Get the lidar rotation frequency from lidar mode.
- *
+ *
* @param lidar_mode
* @return lidar rotation frequency in Hz
*/
diff --git a/ouster_client/src/client.cpp b/ouster_client/src/client.cpp
index 8bba2b2e..629c14d0 100644
--- a/ouster_client/src/client.cpp
+++ b/ouster_client/src/client.cpp
@@ -268,6 +268,8 @@ bool collect_metadata(client& cli, SOCKET sock_fd, chrono::seconds timeout) {
cli.meta["lidar_mode"] = root["lidar_mode"];
cli.meta["client_version"] = ouster::CLIENT_VERSION;
+ cli.meta["json_calibration_version"] = FW_2_0;
+
return success;
}
} // namespace
diff --git a/ouster_client/src/types.cpp b/ouster_client/src/types.cpp
index c4fd7208..01af17e9 100644
--- a/ouster_client/src/types.cpp
+++ b/ouster_client/src/types.cpp
@@ -345,6 +345,8 @@ std::string to_string(const sensor_info& info) {
}
}
+ root["json_calibration_version"] = FW_2_0;
+
Json::StreamWriterBuilder builder;
builder["enableYAMLCompatibility"] = true;
builder["precision"] = 6;