From 43c9e9e7c0ef0a3626d5eeab8aff2a5c1e07bb01 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) --- 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 478819573..2602a5dfd 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"),