We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6d1d24 commit 2c531d9Copy full SHA for 2c531d9
ros2_control_demo_hardware/src/diffbot_system.cpp
@@ -176,9 +176,12 @@ hardware_interface::return_type DiffBotSystemHardware::read()
176
rclcpp::get_logger("DiffBotSystemHardware"),
177
"Reading...");
178
179
+ double tau = 0.2;
180
+ double a = tau/(tau+1);
181
+ double b = 1/(tau+1);
182
for (uint i = 0; i < hw_commands_.size(); i++) {
- // Simulate DiffBot's movement
- hw_states_[1] = hw_commands_[i] + (hw_states_[1] - hw_commands_[i]) / hw_slowdown_;
183
+ // Simulate DiffBot wheels's movement as a first-order system
184
+ hw_states_[1] = a*hw_states_[1] + b*hw_commands_[i];
185
hw_states_[0] += hw_states_[1] / 2;
186
RCLCPP_INFO(
187
0 commit comments