From f72f301dd5233bbf5c9cd27cdf47936e39df69cc Mon Sep 17 00:00:00 2001 From: Mike Emery Date: Sun, 20 Aug 2023 22:06:02 +1000 Subject: [PATCH] Fix diffbot position integration (#350) (cherry picked from commit 43c9e9e7c0ef0a3626d5eeab8aff2a5c1e07bb01) --- example_2/hardware/diffbot_system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_2/hardware/diffbot_system.cpp b/example_2/hardware/diffbot_system.cpp index 47881957..2602a5df 100644 --- a/example_2/hardware/diffbot_system.cpp +++ b/example_2/hardware/diffbot_system.cpp @@ -180,7 +180,7 @@ hardware_interface::return_type DiffBotSystemHardware::read( // Simulate DiffBot wheels's movement as a first-order system // Update the joint status: this is a revolute joint without any limit. // Simply integrates - hw_positions_[i] = hw_positions_[1] + period.seconds() * hw_velocities_[i]; + hw_positions_[i] = hw_positions_[i] + period.seconds() * hw_velocities_[i]; RCLCPP_INFO( rclcpp::get_logger("DiffBotSystemHardware"),