BCLab-UNM / SC2

Swarmathon Team Code for the NASA Space Challenge 2 Competition
MIT License
2 stars 0 forks source link

Driver fix (hopefully) #225

Closed abbypribis closed 3 years ago

abbypribis commented 3 years ago

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:

  1. Start sim
  2. In other term: source ./devel/setup.bash roslaunch scoot scoot.launch "search:=searchRandomWalk" --screen
  3. See if it freezes up in drive state

Fixes #194