Skip to content

Commit

Permalink
refactor: change load config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobilizes committed Jun 21, 2024
1 parent 7aadb5f commit 4bc4fad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/kansei/fallen/node/fallen_determinant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ FallenDeterminant::FallenDeterminant(const DeterminantType & type)

void FallenDeterminant::load_config(const std::string & path)
{
nlohmann::json imu_data = jitsuyo::load_config(path, "kansei.json");
if (imu_data.empty()) {
nlohmann::json imu_data;
if (!jitsuyo::load_config(path, "kansei.json", imu_data);) {
throw std::runtime_error("Failed to find config file");
}

Expand Down
4 changes: 2 additions & 2 deletions src/kansei/measurement/filter/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Filter::Filter()

void Filter::load_config(const std::string & path)
{
nlohmann::json imu_data = jitsuyo::load_config(path, "imu/kansei.json");
if (imu_data.empty()) {
nlohmann::json imu_data;
if (!jitsuyo::load_config(path, "imu/kansei.json", imu_data)) {
throw std::runtime_error("Failed to find config file");
}

Expand Down

0 comments on commit 4bc4fad

Please sign in to comment.