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

rosbag2_storage_mcap: merge into rosbag2 repo #1163

Merged
merged 4 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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
james-rms marked this conversation as resolved.
Show resolved Hide resolved
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_interfaces
rosbag2_py
rosbag2_storage
rosbag2_storage_mcap
rosbag2_storage_mcap_testdata
rosbag2_storage_sqlite3
rosbag2_test_common
rosbag2_tests
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>
james-rms marked this conversation as resolved.
Show resolved Hide resolved
<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