diff_drive icon indicating copy to clipboard operation
diff_drive copied to clipboard

back motion error corrected

Open trilokeshtarala opened this issue 4 years ago • 1 comments

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

trilokeshtarala avatar Oct 14 '21 18:10 trilokeshtarala

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

trilokeshtarala avatar Oct 16 '22 14:10 trilokeshtarala

The change to use the absolute values looks good. Other changes I'm not going to take, for two reasons:

  1. 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.

  2. 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.

merose avatar Mar 16 '23 19:03 merose

Closing pull request without merging. However, have applied absolute value change.

merose avatar Mar 16 '23 19:03 merose