back motion error corrected
during back motion speeds.left and speeds.right are less than zero i.e., negative and maxMotorSpeed is a positive value therefore compiler never enters the following if loop in the src/diff_drive/controller.py
if max(speeds.left, speeds.right) > self.maxMotorSpeed: factor = self.maxMotorSpeed / max(speeds.left, speeds.right) speeds.left *= factor speeds.right *= factor
during back motion speeds.left and speeds.right are less than zero i.e., negative and maxMotorSpeed is a positive value therefore compiler never enters the following if loop in the src/diff_drive/controller.py
if max(speeds.left, speeds.right) > self.maxMotorSpeed: factor = self.maxMotorSpeed / max(speeds.left, speeds.right) speeds.left *= factor speeds.right *= factor
The change to use the absolute values looks good. Other changes I'm not going to take, for two reasons:
-
The demo explicitly starts rviz, and I document that, so don't want to comment that out. Other changes to the launch file are whitespace changes that don't matter, so not taking them.
-
Cannot change to python 3, because ROS1 is stuck on python 2.
Will apply your abs() changes, but reject this pull request for the other changes. Thanks for the contribution.
Closing pull request without merging. However, have applied absolute value change.