Skip to content

Commit

Permalink
[Humble backport] rosbag2_storage_mcap: merge into rosbag2 repo (#1163)…
Browse files Browse the repository at this point in the history
… (#1189)

* [backport] rosbag2_storage_mcap: merge into rosbag2 repo (#1163)

* rosbag2_storage_mcap: merge into ros2/rosbag2

Signed-off-by: James Smith <james@foxglove.dev>

mcap_storage: 'none' is a valid storage preset profile (#86)

Signed-off-by: James Smith <james@foxglove.dev>

bloom: add changelog changes

0.6.0

* ci: include rosbag2_storage_mcap

Signed-off-by: James Smith <james@foxglove.dev>

* package.xml: include ROS Tooling WG maintainers

Signed-off-by: James Smith <james@foxglove.dev>

* rosbag2_storage_mcap: update readme after move

Signed-off-by: James Smith <james@foxglove.dev>

Signed-off-by: James Smith <james@foxglove.dev>

* zstd_vendor: do not remove zstd_errors.h

Signed-off-by: James Smith <james@foxglove.dev>

Signed-off-by: James Smith <james@foxglove.dev>
  • Loading branch information
james-rms authored Dec 1, 2022
1 parent 57181ac commit 953c8ed
Show file tree
Hide file tree
Showing 31 changed files with 2,366 additions and 11 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,27 @@ jobs:
rosbag2_transport
shared_queues_vendor
ament_lint_clang_format: # Linters applicable to C++ packages formatted with clang-format
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [cppcheck, cpplint, clang_format]
include:
- linter: clang_format
arguments: "--config rosbag2_storage_mcap/.clang-format"
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/action-ros-lint@v0.1
with:
linter: ${{ matrix.linter }}
arguments: ${{ matrix.arguments }}
distribution: rolling
package-name: rosbag2_storage_mcap

ament_lint_python: # Linters applicable to Python packages
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: |
mcap_vendor
ros2bag
rosbag2
rosbag2_compression
Expand All @@ -29,6 +30,8 @@ jobs:
rosbag2_py
rosbag2_storage
rosbag2_storage_default_plugins
rosbag2_storage_mcap
rosbag2_storage_mcap_testdata
rosbag2_test_common
rosbag2_tests
rosbag2_transport
Expand Down
64 changes: 64 additions & 0 deletions mcap_vendor/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package mcap_vendor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.6.0 (2022-11-28)
------------------
* Fix Windows build (`#73 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/73>`_)
Update mcap version to newest windows-compatible release.
Add visibility macros for tests.
Add clang-format preprocessor indentation for visibility_control to be readable.
* Contributors: Emerson Knapp

0.5.0 (2022-11-02)
------------------
* mcap_vendor: update to v0.6.0 (`#69 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/69>`_)
* Cleanup in `mcap_vendor` package (`#62 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/62>`_)
* Switch to using the vendored zstd library. (`#59 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/59>`_)
* Contributors: Chris Lalancette, Michael Orlov, James Smith

0.4.0 (2022-10-06)
------------------

0.2.0 (2022-09-08)
------------------
* Support timestamp-ordered playback (`#50 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/50>`_)
* Support regex topic filtering
* Contributors: James Smith

0.1.7 (2022-08-15)
------------------
* Add all lz4 sources to fix undefined symbols at runtime (`#46 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/46>`_)
* Contributors: Emerson Knapp

0.1.6 (2022-07-22)
------------------
* Upgrade mcap to fix LZ4 error and segfault (`#42 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/42>`_)
Incorporates fixes from https://github.com/foxglove/mcap/pull/478 and https://github.com/foxglove/mcap/pull/482
* Add missing buildtool_depend on git (`#37 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/37>`_)
This vendor package uses git to fetch sources for other packages. It should declare a dependency on that build tool.
This should address the current cause of RPM build failures for RHEL: https://build.ros2.org/view/Rbin_rhel_el864/job/Rbin_rhel_el864__mcap_vendor__rhel_8_x86_64__binary/
* Contributors: Jacob Bandes-Storch, Scott K Logan

0.1.5 (2022-04-25)
------------------
* Test Foxy & Galactic in CI, fix missing test_depends in mcap_vendor/package.xml (`#33 <https://github.com/ros-tooling/rosbag2_storage_mcap/issues/33>`_)
* Contributors: Jacob Bandes-Storch

0.1.4 (2022-04-21)
------------------
* fix: minor issues (`#31 <https://github.com/wep21/rosbag2_storage_mcap/issues/31>`_)
* remove unnecessary block
* use target_link_libraries instead of ament_target_dependencies
* remove ros environment
* add prefix to compile definition
* Update email address for Foxglove maintainers (`#32 <https://github.com/wep21/rosbag2_storage_mcap/issues/32>`_)
* Contributors: Daisuke Nishimatsu, Jacob Bandes-Storch

0.1.3 (2022-04-20)
------------------

0.1.2 (2022-04-20)
------------------
* Added mcap_vendor package. Updated CMakeLists.txt to fetch dependencies with FetchContent rather than Conan.
* Contributors: Jacob Bandes-Storch
82 changes: 82 additions & 0 deletions mcap_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
cmake_minimum_required(VERSION 3.5)
project(mcap_vendor LANGUAGES C CXX ASM)

## Dependencies
find_package(ament_cmake REQUIRED)
find_package(zstd_vendor REQUIRED)
find_package(zstd REQUIRED)

## Compile options
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
endif()
if (MSVC)
add_compile_options(/W4 /WX
/wd4251 # suppress warning about having template instances (such as std::string) as public class members
)
# suppress error disallowing `fopen` in favor of `fopen_s`
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()

## Define vendor macro
macro(build_mcap_vendor)
include(FetchContent)
fetchcontent_declare(mcap
GIT_REPOSITORY https://github.com/foxglove/mcap.git
GIT_TAG dc6561d9ba867901709e36526dcf7f7359861e9c # releases/cpp/v0.7.0
)
fetchcontent_makeavailable(mcap)

fetchcontent_declare(lz4
GIT_REPOSITORY https://github.com/lz4/lz4.git
GIT_TAG d44371841a2f1728a3f36839fd4b7e872d0927d3 # v1.9.3
)
fetchcontent_makeavailable(lz4)

file(GLOB _lz4_srcs
${lz4_SOURCE_DIR}/lib/*.c)

add_library(mcap SHARED
src/main.cpp
${_lz4_srcs}
)

set(_mcap_include_dir ${mcap_SOURCE_DIR}/cpp/mcap/include)

target_include_directories(mcap PRIVATE
${lz4_SOURCE_DIR}/lib
)
target_include_directories(mcap PUBLIC
"$<BUILD_INTERFACE:${_mcap_include_dir}>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
ament_target_dependencies(mcap zstd)

install(
DIRECTORY ${_mcap_include_dir}/mcap
DESTINATION include/${PROJECT_NAME}
)

install(
TARGETS mcap
EXPORT mcap
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
endmacro()

## Call vendor macro
build_mcap_vendor()

ament_export_include_directories(include/${PROJECT_NAME})
ament_export_targets(mcap HAS_LIBRARY_TARGET)
ament_export_dependencies(zstd_vendor zstd)

## Package
ament_package()
19 changes: 19 additions & 0 deletions mcap_vendor/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>mcap_vendor</name>
<version>0.6.0</version>
<description>mcap vendor package</description>
<maintainer email="ros-tooling@foxglove.dev">Foxglove</maintainer>
<maintainer email="ros-tooling@googlegroups.com">ROS Tooling Working Group</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>git</buildtool_depend>

<depend>zstd_vendor</depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
16 changes: 16 additions & 0 deletions mcap_vendor/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2022, Foxglove Technologies. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#define MCAP_IMPLEMENTATION
#include <mcap/mcap.hpp>
37 changes: 37 additions & 0 deletions rosbag2_storage_mcap/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
Language: Cpp
Standard: c++17
BasedOnStyle: Google

AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Empty
AccessModifierOffset: -2
TabWidth: 2
ContinuationIndentWidth: 2
UseTab: Never
BreakConstructorInitializers: BeforeComma
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterEnum: true
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
FixNamespaceComments: true
PointerAlignment: Middle
ReflowComments: false
SortIncludes: true
IndentPPDirectives: BeforeHash

IncludeCategories:
- Regex: '^"'
Priority: 1
- Regex: "^<mcap"
Priority: 2
- Regex: "^<.*/"
Priority: 3
- Regex: "^<.*"
Priority: 4
13 changes: 13 additions & 0 deletions rosbag2_storage_mcap/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// -*- jsonc -*-
{
"git.alwaysSignOff": true,

// https://github.com/microsoft/vscode-cpptools/issues/722
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.default.cppStandard": "c++17",

"[cpp]": {
"editor.formatOnSave": true
},
"cmake.sourceDirectory": "${workspaceFolder}",
}
Loading

0 comments on commit 953c8ed

Please sign in to comment.