I noticed that in the IDLE state, the currentState is assigned to the TURN state if the requested theta value is greater than the ROTATE_THRESHOLD (math.pi / 32).
Sometimes, when the requested movement was x=0, y=0, and some negative theta value, this TURN state was not triggered, because the raw theta value was considered, not the absolute value. Therefore, the rover would be stuck in the DRIVE state, drive(0, 0, ...) even though it should be in the TURN state.
So, I just added the absolute value. I didn't notice anything freeze up, but I also didn't run it for hours, so perhaps it is something else as well as this.
To test:
Start sim
In other term:
source ./devel/setup.bashroslaunch scoot scoot.launch "search:=searchRandomWalk" --screen
I noticed that in the IDLE state, the currentState is assigned to the TURN state if the requested theta value is greater than the ROTATE_THRESHOLD (math.pi / 32).
Sometimes, when the requested movement was x=0, y=0, and some negative theta value, this TURN state was not triggered, because the raw theta value was considered, not the absolute value. Therefore, the rover would be stuck in the DRIVE state, drive(0, 0, ...) even though it should be in the TURN state.
So, I just added the absolute value. I didn't notice anything freeze up, but I also didn't run it for hours, so perhaps it is something else as well as this.
To test:
source ./devel/setup.bash
roslaunch scoot scoot.launch "search:=searchRandomWalk" --screen
Fixes #194