diff --git a/src/modelec_com/src/pcb_odo_interface.cpp b/src/modelec_com/src/pcb_odo_interface.cpp index 41c723e..5fa5b29 100644 --- a/src/modelec_com/src/pcb_odo_interface.cpp +++ b/src/modelec_com/src/pcb_odo_interface.cpp @@ -74,16 +74,16 @@ namespace Modelec [this](const sensor_msgs::msg::Joy::SharedPtr msg) { double left_axis = msg->axes[1]; - double right_axis = msg->axes[3]; + double right_axis = msg->axes[2]; if (fabs(left_axis) < 0.05) left_axis = 0.0; if (fabs(right_axis) < 0.05) right_axis = 0.0; - // int left = static_cast(forward * 626 - turn * 626); - // int right = static_cast(forward * 626 + turn * 626); + int left_motor = static_cast(forward * 626 - turn * 626); + int right_motor = static_cast(forward * 626 + turn * 626); - int left_motor = static_cast(left_axis * 626); - int right_motor = static_cast(right_axis * 626); + // int left_motor = static_cast(left_axis * 626); + // int right_motor = static_cast(right_axis * 626); left_motor = std::max(-626, std::min(626, left_motor)); right_motor = std::max(-626, std::min(626, right_motor));