chrisl8 / ArloBot

ROS Package for a Parallax ArloBot Robot
https://log.voidshipephemeral.space/Arlobot/ArloBot+Build+Index
MIT License
39 stars 27 forks source link

heading error when running PropellerSerialTest.sh #40

Closed robotsir closed 5 years ago

robotsir commented 5 years ago

Hi,

I was testing with ~/catkin_ws/src/ArloBot/scripts/PropellerSerialTest.sh, and I noticed that when I moved the robot forward with keyboard, the heading number increased from 0 to 2.0 very quickly, then it overflew and jumped back to 0. I would expect the heading to maintain around 0, since the robot moved forward, without any turning. Also, is the unit here in radians? if so, shouldn't it overflow when it reaches pi*2? I also saw "Received ERROR: GOSPD: previous ... new ..." every time when I pressed the keyboard, is that normal?

In Rviz, when I drove the robot forward, the robot actually turned, and suddenly jumped to a new location when overflow happened.

I confirmed that my encoders were working properly with: https://learn.parallax.com/tutorials/robot/arlo/arlo-activity-board-brain/control-arlo-simpleide-terminal. Any ideas?

Thanks!

robotsir commented 5 years ago

OK, I found the bug. In broadcastOdometryAndRunMotors.h, change uint8_t dhb10_ticksLeft, dhb10_ticksRight... to int64_t ..., since the encoder value can be +/- and way beyond 255

chrisl8 commented 5 years ago

Yay, bug fixes!!

I'll try to update the code this weekend with your fix, or you can send me a pull request if you want credit on github. :)