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

[21413] Record data in SQL #173

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4811991
COMMITS SQUASHED
EugenioCollado Oct 24, 2024
192dd2e
Colcon fix
EugenioCollado Oct 25, 2024
12c478f
SQL Sequence number
EugenioCollado Oct 28, 2024
f5231b7
Yaml config default and config mcap/sql enabling
EugenioCollado Oct 28, 2024
e534a31
SQL WAL journal mode (anti corruption in database)
EugenioCollado Oct 28, 2024
0a8d7d4
SQL RESOURCE LIMITS max size
EugenioCollado Oct 29, 2024
c2f6b82
SQL RESOURCE LIMITS file rotation, removing entries and defragment file
EugenioCollado Oct 29, 2024
007925a
SQL & MCAP recording at the same time
EugenioCollado Oct 30, 2024
a7981f0
SQL & MCAP resource limits (ending only the correspondig one)
EugenioCollado Oct 30, 2024
a68c9ff
SQL size checker
EugenioCollado Oct 30, 2024
a62d977
MCAP size checker
EugenioCollado Oct 31, 2024
2f6f271
SQL improved writing
EugenioCollado Oct 31, 2024
acb296e
YAML CONFIGURATION just once in init
EugenioCollado Nov 4, 2024
62fb528
RESOURCE LIMITS refactored and initial size checks | size_margin used…
EugenioCollado Nov 4, 2024
8246bc6
RECORDER TESTS
EugenioCollado Nov 5, 2024
89fff92
Regenerate types
EugenioCollado Nov 7, 2024
a2ab83f
RESOURCE LIMITS max_size equal to space_available if max_file_size se…
EugenioCollado Nov 11, 2024
b1f2d2f
FIX RECORDER TYPES
EugenioCollado Nov 11, 2024
a97bf55
FIX REPLAYER TYPES
EugenioCollado Nov 11, 2024
b39ab01
FIX REPLAYER ROS2
EugenioCollado Nov 12, 2024
623b604
COLCON FIX
EugenioCollado Nov 13, 2024
37b770b
RESOURCE LIMITS fix and tests
EugenioCollado Dec 16, 2024
94372b2
TESTS refactor
EugenioCollado Dec 16, 2024
7898099
ROS2 mcap & sql tests
EugenioCollado Dec 17, 2024
60ca313
Resource limits test
EugenioCollado Dec 19, 2024
e01c8d7
Documentation update
EugenioCollado Dec 19, 2024
cb0f53d
Fix test sql log-file
EugenioCollado Dec 19, 2024
6326c16
sqlite3 library amalgamation
EugenioCollado Dec 30, 2024
006d3ce
Fix data_cdr memory leak
EugenioCollado Dec 30, 2024
6ba899f
ASAN fix
EugenioCollado Jan 3, 2025
3014769
Windows fix
EugenioCollado Jan 21, 2025
bd5271a
Force Windows SDK version
EugenioCollado Jan 24, 2025
d74fe42
Fix Windows compilation
juanlofer-eprosima Jan 28, 2025
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
12 changes: 2 additions & 10 deletions ddsrecorder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
# CMake build rules for DDS Recorder Submodule
###############################################################################
cmake_minimum_required(VERSION 3.5)
set(CMAKE_SYSTEM_VERSION 10.0)

# Done this to set machine architecture and be able to call cmake_utils
enable_language(C)
enable_language(CXX)

###############################################################################
Expand Down Expand Up @@ -60,18 +62,8 @@ project(
# - Configure log depending on LOG_INFO flag and CMake type
configure_project_cpp()

file(
GLOB_RECURSE SOURCES_FILES
"${PROJECT_SOURCE_DIR}/src/cpp/tool/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/user_interface/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/main.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/command_receiver/Command*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/*/*/*/*.cxx"
)

compile_tool(
"${PROJECT_SOURCE_DIR}/src/cpp/" # Source directory
"${SOURCES_FILES}"
)

compile_test_tool("${PROJECT_SOURCE_DIR}/test/")
Expand Down
1 change: 1 addition & 0 deletions ddsrecorder/project_settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ set(MODULE_THIRDPARTY_HEADERONLY
mcap
nlohmann-json
optionparser
sqlite # Not header-only though, need to link .c
)

set(MODULE_THIRDPARTY_PATH
Expand Down
21 changes: 16 additions & 5 deletions ddsrecorder/src/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ int main(

// Load configuration from YAML
eprosima::ddsrecorder::yaml::RecorderConfiguration configuration(commandline_args.file_path, &commandline_args);
// Flag to avoid reloading configuration in the first iteration of enable_remote_controller loop
bool config_loaded = true;

/////
// Logging
Expand Down Expand Up @@ -297,7 +299,8 @@ int main(
logUser(DDSRECORDER_EXECUTION, "DDS Recorder running.");

// The file tracker must be stored outside of the loop since it is shared between instances
std::shared_ptr<eprosima::ddsrecorder::participants::FileTracker> file_tracker;
std::shared_ptr<eprosima::ddsrecorder::participants::FileTracker> mcap_file_tracker;
std::shared_ptr<eprosima::ddsrecorder::participants::FileTracker> sql_file_tracker;

if (configuration.enable_remote_controller)
{
Expand Down Expand Up @@ -344,7 +347,8 @@ int main(
{
// Save the set of output files from being overwritten.
// WARNING: If set, the resource-limits won't be consistent after stopping the DDS Recorder.
file_tracker.reset();
mcap_file_tracker.reset();
sql_file_tracker.reset();
}

prev_command = CommandCode::stop;
Expand Down Expand Up @@ -402,11 +406,18 @@ int main(

// Reload YAML configuration file, in case it changed during STOPPED state
// NOTE: Changes to all (but controller specific) recorder configuration options are taken into account
configuration = eprosima::ddsrecorder::yaml::RecorderConfiguration(commandline_args.file_path);
if(!config_loaded)
{
configuration = eprosima::ddsrecorder::yaml::RecorderConfiguration(commandline_args.file_path);
}
else
{
config_loaded = false;
}

// Create DDS Recorder
auto recorder = std::make_unique<DdsRecorder>(
configuration, initial_state, close_handler, file_tracker);
configuration, initial_state, close_handler, mcap_file_tracker, sql_file_tracker);

// Create File Watcher Handler
std::unique_ptr<eprosima::utils::event::FileWatcherHandler> file_watcher_handler;
Expand Down Expand Up @@ -540,7 +551,7 @@ int main(
{
// Start recording right away
auto recorder = std::make_unique<DdsRecorder>(
configuration, DdsRecorderState::RUNNING, close_handler, file_tracker);
configuration, DdsRecorderState::RUNNING, close_handler, mcap_file_tracker, sql_file_tracker);

// Create File Watcher Handler
std::unique_ptr<eprosima::utils::event::FileWatcherHandler> file_watcher_handler;
Expand Down
Loading
Loading