-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
23,895 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,43 @@ | ||
FIND_SOURCES=find ./test/ ./src ./include/ -iname "*.h" -or -iname "*.cpp" | ||
|
||
# 0ebaf69 = releases/cpp/v1.4.1 | ||
MCAP_SHA=0ebaf69efa2dd5dbe33a882ce51caa8451d518d2 | ||
MCAP_DIR=pjmsg_mcap/src/3rdparty/mcap | ||
|
||
# 2.2.6 | ||
FASTCDR_SHA=9149259a1eb54a9b1104a9f622f89b00a66b6011 | ||
FASTCDR_DIR=pjmsg_mcap/src/3rdparty/fastcdr | ||
|
||
|
||
format: | ||
${FIND_SOURCES} | xargs ${CLANG_FORMAT} -verbose -i | ||
|
||
update_mcap: | ||
-git remote add mcap https://github.com/foxglove/mcap.git --no-tags | ||
git fetch --depth=1 mcap ${MCAP_SHA} | ||
git rm --ignore-unmatch -rf ${MCAP_DIR} | ||
rm -rf ${MCAP_DIR} | ||
env GIT_LFS_SKIP_SMUDGE=1 git read-tree --prefix=${MCAP_DIR} -u ${MCAP_SHA} | ||
find ${MCAP_DIR} \ | ||
-not -wholename "${MCAP_DIR}/cpp/mcap*" \ | ||
-not -wholename "${MCAP_DIR}/cpp" \ | ||
-not -wholename "${MCAP_DIR}" \ | ||
| xargs rm -rf | ||
|
||
update_fastcdr: | ||
-git remote add fastcdr https://github.com/eProsima/Fast-CDR.git --no-tags | ||
git fetch --depth=1 fastcdr ${FASTCDR_SHA} | ||
git rm --ignore-unmatch -rf ${FASTCDR_DIR} | ||
rm -rf ${FASTCDR_DIR} | ||
env GIT_LFS_SKIP_SMUDGE=1 git read-tree --prefix=${FASTCDR_DIR} -u ${FASTCDR_SHA} | ||
find ${FASTCDR_DIR} \ | ||
-not -wholename "${FASTCDR_DIR}/cmake/common/check_configuration.cmake" \ | ||
-not -wholename "${FASTCDR_DIR}/cmake/common" \ | ||
-not -wholename "${FASTCDR_DIR}/cmake/packaging*" \ | ||
-not -wholename "${FASTCDR_DIR}/cmake" \ | ||
-not -wholename "${FASTCDR_DIR}/include*" \ | ||
-not -wholename "${FASTCDR_DIR}/src*" \ | ||
-not -wholename "${FASTCDR_DIR}/LICENSE" \ | ||
-not -wholename "${FASTCDR_DIR}" \ | ||
| xargs rm -rf | ||
cp ${FASTCDR_DIR}/../CMakeLists.txt.fastcdr ${FASTCDR_DIR}/CMakeLists.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>intrometry_api</name> | ||
<name>intrometry_frontend</name> | ||
<version>1.0.0</version> | ||
<description>Inner telemetry collector</description> | ||
<maintainer email="[email protected]">Alexander Sherikov</maintainer> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(intrometry_pjmsg_mcap VERSION 1.0.0 LANGUAGES CXX) | ||
|
||
if(CCWS_CLANG_TIDY) | ||
set(CMAKE_CXX_CLANG_TIDY "${CCWS_CLANG_TIDY}" CACHE STRING "" FORCE) | ||
endif() | ||
if(CCWS_CXX_FLAGS) | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CCWS_CXX_FLAGS}") | ||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CCWS_LINKER_FLAGS}") | ||
else() | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic -Werror) | ||
endif() | ||
endif() | ||
|
||
find_package(intrometry_frontend REQUIRED) | ||
find_package(thread_supervisor REQUIRED) | ||
find_package(ariles2-namevalue2 REQUIRED) | ||
|
||
add_subdirectory(src/3rdparty/) | ||
|
||
|
||
add_library(${PROJECT_NAME} SHARED | ||
src/intrometry.cpp | ||
) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES EXPORT_NAME pjmsg_mcap) | ||
target_link_libraries(${PROJECT_NAME} | ||
PUBLIC intrometry::frontend | ||
PRIVATE ariles2::namevalue2 | ||
PRIVATE thread_supervisor::thread_supervisor | ||
PRIVATE fastcdr | ||
) | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
target_include_directories(${PROJECT_NAME} | ||
SYSTEM PRIVATE src/3rdparty/mcap/cpp/mcap/include/ | ||
) | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) | ||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ${PROJECT_VERSION_MAJOR}) | ||
|
||
install( | ||
TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME} | ||
INCLUDES DESTINATION include | ||
) | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
|
||
install(DIRECTORY include/intrometry | ||
DESTINATION include | ||
FILES_MATCHING PATTERN "*.h" | ||
) | ||
|
||
|
||
if(NOT DEFINED BUILD_TESTING OR BUILD_TESTING) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() | ||
|
||
|
||
# --- | ||
# cmake package stuff | ||
export(EXPORT ${PROJECT_NAME} | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake" | ||
NAMESPACE ${PROJECT_NAME}:: | ||
) | ||
|
||
install(EXPORT ${PROJECT_NAME} | ||
FILE ${PROJECT_NAME}Targets.cmake | ||
NAMESPACE intrometry:: | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
write_basic_package_version_file( | ||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" | ||
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
file( | ||
WRITE | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" | ||
"include(\"\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake\")\n" | ||
"include(CMakeFindDependencyMacro)\n" | ||
"find_dependency(ariles2_namevalue2_ws)" | ||
) | ||
|
||
install( | ||
FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" | ||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
# --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
@file | ||
@author Alexander Sherikov | ||
@copyright 2024 Alexander Sherikov. Licensed under the Apache License, | ||
Version 2.0. (see LICENSE or http://www.apache.org/licenses/LICENSE-2.0) | ||
@brief Sink class. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "intrometry/api/sink.h" | ||
|
||
|
||
namespace intrometry::pjmsg_mcap | ||
{ | ||
namespace sink | ||
{ | ||
class Parameters | ||
{ | ||
public: | ||
/** | ||
* publish rate (system clock), | ||
* data written at higher rate is going to overwrite unpublished data | ||
*/ | ||
std::size_t rate_; | ||
/// id of the sink, disables publishing if empty | ||
std::string id_; | ||
|
||
public: | ||
Parameters(const std::string &id = ""); // NOLINT | ||
Parameters(const char *id = ""); // NOLINT | ||
|
||
Parameters &rate(const std::size_t value); | ||
Parameters &id(const std::string &value); | ||
}; | ||
|
||
class Implementation; | ||
} // namespace sink | ||
|
||
|
||
/** | ||
* @brief Publish data. | ||
* | ||
* @ingroup API | ||
*/ | ||
class Sink : public SinkPIMPLBase<sink::Parameters, sink::Implementation> | ||
{ | ||
public: | ||
using SinkPIMPLBase::SinkPIMPLBase; | ||
~Sink(); | ||
|
||
bool initialize(); | ||
void assign(const ariles2::DefaultBase &source, const Source::Parameters ¶meters = Source::Parameters()); | ||
void retract(const ariles2::DefaultBase &source); | ||
void write(const ariles2::DefaultBase &source, const uint64_t timestamp = 0); | ||
}; | ||
} // namespace intrometry::pjmsg_mcap |
Oops, something went wrong.