Skip to content

Commit

Permalink
Merge pull request #35 from ichiro-its/hotfix/fix-kinematic-get-key
Browse files Browse the repository at this point in the history
[Hotfix] Fix Kinematic Get Key
  • Loading branch information
FaaizHaikal authored Jun 25, 2024
2 parents 9bf82c1 + 13863fe commit c2c1858
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/aruku/walking/process/kinematic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ void Kinematic::set_config(const nlohmann::json & kinematic_data)
bool valid_section = true;
valid_section &= jitsuyo::assign_val(ratio_section, "period_time", period_time);
valid_section &= jitsuyo::assign_val(ratio_section, "dsp_ratio", dsp_ratio);
valid_section &= jitsuyo::assign_val(ratio_section, "z_move", z_move);
valid_section &= jitsuyo::assign_val(ratio_section, "y_swap_amplitude", y_swap_amplitude);
valid_section &= jitsuyo::assign_val(ratio_section, "z_swap_amplitude", z_swap_amplitude);
valid_section &= jitsuyo::assign_val(ratio_section, "foot_height", z_move);
valid_section &= jitsuyo::assign_val(ratio_section, "swing_right_left", y_swap_amplitude);
valid_section &= jitsuyo::assign_val(ratio_section, "swing_up_down", z_swap_amplitude);
valid_section &= jitsuyo::assign_val(ratio_section, "arm_swing_gain", arm_swing_gain);
valid_section &= jitsuyo::assign_val(ratio_section, "backward_hip_comp_ratio", backward_hip_comp_ratio);
valid_section &= jitsuyo::assign_val(ratio_section, "forward_hip_comp_ratio", forward_hip_comp_ratio);
Expand Down Expand Up @@ -422,6 +422,10 @@ void Kinematic::set_config(const nlohmann::json & kinematic_data)
valid_config = false;
}

if (!valid_config) {
throw std::runtime_error("Failed to load config file `kinematic.json`");
}

update_times();
update_move_amplitude();

Expand Down

0 comments on commit c2c1858

Please sign in to comment.