Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions hardware/diffbot_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion hardware/include/diffdrive_arduino/diffbot_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down