From f5b7ddece2e4fb1472ea2a2890f4fe20a155fc46 Mon Sep 17 00:00:00 2001 From: Javier Martinez Date: Sun, 28 Jan 2024 14:48:36 +0100 Subject: [PATCH] enc_counts_per_rev parameter changed to enc_counts_per_rev_l and enc_counts_per_rev_r --- hardware/diffbot_system.cpp | 7 ++++--- hardware/include/diffdrive_arduino/diffbot_system.hpp | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hardware/diffbot_system.cpp b/hardware/diffbot_system.cpp index 52c343d..7b1bd09 100644 --- a/hardware/diffbot_system.cpp +++ b/hardware/diffbot_system.cpp @@ -42,7 +42,8 @@ hardware_interface::CallbackReturn DiffDriveArduinoHardware::on_init( cfg_.device = info_.hardware_parameters["device"]; cfg_.baud_rate = std::stoi(info_.hardware_parameters["baud_rate"]); cfg_.timeout_ms = std::stoi(info_.hardware_parameters["timeout_ms"]); - cfg_.enc_counts_per_rev = std::stoi(info_.hardware_parameters["enc_counts_per_rev"]); + cfg_.enc_counts_per_rev_l = std::stoi(info_.hardware_parameters["enc_counts_per_rev_l"]); + cfg_.enc_counts_per_rev_r = std::stoi(info_.hardware_parameters["enc_counts_per_rev_r"]); if (info_.hardware_parameters.count("pid_p") > 0) { cfg_.pid_p = std::stoi(info_.hardware_parameters["pid_p"]); @@ -56,8 +57,8 @@ hardware_interface::CallbackReturn DiffDriveArduinoHardware::on_init( } - wheel_l_.setup(cfg_.left_wheel_name, cfg_.enc_counts_per_rev); - wheel_r_.setup(cfg_.right_wheel_name, cfg_.enc_counts_per_rev); + wheel_l_.setup(cfg_.left_wheel_name, cfg_.enc_counts_per_rev_l); + wheel_r_.setup(cfg_.right_wheel_name, cfg_.enc_counts_per_rev_r); for (const hardware_interface::ComponentInfo & joint : info_.joints) diff --git a/hardware/include/diffdrive_arduino/diffbot_system.hpp b/hardware/include/diffdrive_arduino/diffbot_system.hpp index f87067a..ae33c89 100644 --- a/hardware/include/diffdrive_arduino/diffbot_system.hpp +++ b/hardware/include/diffdrive_arduino/diffbot_system.hpp @@ -47,7 +47,8 @@ struct Config std::string device = ""; int baud_rate = 0; int timeout_ms = 0; - int enc_counts_per_rev = 0; + int enc_counts_per_rev_l = 0; + int enc_counts_per_rev_r = 0; int pid_p = 0; int pid_d = 0; int pid_i = 0;