ARIA-Users

Date Index Thread Index

[Aria-users] Questions about odometry and encoder packet



Hello.

I'm using PowerBot.
I have some questions about odometry.

1. For some reason, I made a code to get Encoder data after calling requestEncoderPackets()
myRobot->lock();
long int LeftEncoder= myRobot->getLeftEncoder();
long int RightEncoder= myRobot->getRightEncoder();
myRobot->unlock();
My code received the encoder data and printed them.
But, the data were okay until 32667 or -32667.
After the robot moved more than 32,667 encoder count, the next encoder count is -30000, and vice versa (from -32,000 to 320,000).
In the manual, the type of each encoder count is long int, that is, 4 bytes. right?
Then, how come this happens?

2. For some reason, I made a code to get each wheel angle of the robot incrementally.
First, I used getPose function in ArRobot.
And, I used getLeftEncoder and getRightEncoder data without gyro (I temporarily fixed the first problem above).
But, the two results (each wheel angle) are different.
When using getLeftEncoder and getRightEncoder data, I don't use any RevCount, TicksMM.
I guess getPose() uses RevCount and TicksMM. In my code, TicksMM is almost the same to the one in the PowerBot configuration.
So, I checked RevCount, but I don't understand how to compute the RevCount.
In the configuration, it's 25500. When the robot rotates 180 degree, in my opinion, it can be computed as
PI*(Wheelbase/2)*TicksMM~3.14*330mm*110= 113982.
Am I wrong? I guess I'm misunderstanding in some parts.
And, is the RevCount the reason why the two approaches (getPose and getLeftEncoder)  are different?
Please tell me them.
Thank you.

Sincerely,
--
/*!********************************************************************
Nosan Kwak
**********************************************************************/