From c3772b60936f6a68ba47db4beada6306a9cdeb4e Mon Sep 17 00:00:00 2001 From: hiikariri Date: Wed, 26 Jun 2024 19:57:21 +0700 Subject: [PATCH] feat: add config for half pivot --- include/suiryoku/locomotion/process/locomotion.hpp | 1 + src/suiryoku/locomotion/process/locomotion.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/suiryoku/locomotion/process/locomotion.hpp b/include/suiryoku/locomotion/process/locomotion.hpp index 864ac8d..7233190 100755 --- a/include/suiryoku/locomotion/process/locomotion.hpp +++ b/include/suiryoku/locomotion/process/locomotion.hpp @@ -87,6 +87,7 @@ class Locomotion std::string config_name; bool initial_pivot; + keisan::Angle pivot_stop_limit; private: diff --git a/src/suiryoku/locomotion/process/locomotion.cpp b/src/suiryoku/locomotion/process/locomotion.cpp index 72c583e..edd0799 100755 --- a/src/suiryoku/locomotion/process/locomotion.cpp +++ b/src/suiryoku/locomotion/process/locomotion.cpp @@ -170,6 +170,7 @@ void Locomotion::set_config(const nlohmann::json & json) bool valid_section = true; double pivot_target_tilt_double; + double pivot_stop_limit_double; valid_section &= jitsuyo::assign_val(pivot_section, "min_x", pivot_min_x); valid_section &= jitsuyo::assign_val(pivot_section, "max_x", pivot_max_x); @@ -179,8 +180,10 @@ void Locomotion::set_config(const nlohmann::json & json) valid_section &= jitsuyo::assign_val(pivot_section, "max_delta_direction", pivot_max_delta_direction); valid_section &= jitsuyo::assign_val(pivot_section, "pan_range_a_speed", pivot_pan_range_a_speed); valid_section &= jitsuyo::assign_val(pivot_section, "target_tilt", pivot_target_tilt_double); + valid_section &= jitsuyo::assign_val(pivot_section, "pivot_stop_limit", pivot_stop_limit_double); pivot_target_tilt = keisan::make_degree(pivot_target_tilt_double); + pivot_stop_limit = keisan::make_degree(pivot_stop_limit_double); if (!valid_section) { std::cout << "Error found at section `pivot`" << std::endl;