getwheelodotops

Questions about Marilou Open Devices Access (MODA)
Post Reply
travolta
Posts: 8
Joined: Tue Jan 12, 2010 5:31 am

getwheelodotops

Post by travolta » Sat Jan 30, 2010 10:43 pm

Hi
What does the function "getwheelodotops" return.Does it return how much the wheel moves in one rotation
Last edited by travolta on Sun Jan 31, 2010 8:06 pm, edited 1 time in total.

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Sun Jan 31, 2010 12:33 pm

Hi,

The GetWheelODOTops returns the number of 'ticks' for one wheel complete turn (360.0°) (http://doc.anykode.com/00888.html).

the GetOdometerCounter returns the ticks count since the motor has started.

The odometer is inside the motor, that is attached to the joint's axis.

For example, if your odometer has 360.0 ticks per wheel turn:

-> GetWheelODOTops will return 360.0.
-> If you make your wheel turns 2 times, GetWheelODOTops will return 2*GetWheelODOTops() =720.0.

You can reset the counter by using RAZOdometerCounter.

Working with odometers is more difficult that working with servos's absolute angle ... because in the real life odometer counter can be placed before of after the gearbox reduction (http://doc.anykode.com/00175.html).
LR

travolta
Posts: 8
Joined: Tue Jan 12, 2010 5:31 am

number of ticks

Post by travolta » Sun Jan 31, 2010 8:05 pm

so,how can I know the number of ticks that my robot wheel has?

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Mon Feb 01, 2010 9:28 am

-> If you want to know the ticks count embeded in your modor encoder (your hardware): take a look at your device definition:

Image

Note that the ticks count is probably not an integer (can have decimal places), because its location (after or before motor's gear box).

-> If you want to get this value from your MODA application: use GetWheelODOTops

-> if you want to read the current value (ticks*number of wheel turns): use GetOdometerCounter
LR

jstoquica
Posts: 24
Joined: Fri Apr 22, 2011 6:45 am

Re: getwheelodotops

Post by jstoquica » Fri Oct 14, 2011 5:03 am

good day,

i have an error, when i use RAZOdometerCounter (), and after that set the velocity at motors, generate a infinite loop and ever the odometercounter is 0. I dont why . . . .

_pRightCenterMotor->RAZOdometerCounter ();

while(_pRightCenterMotor->GetOdometerCounter ()<107)
{
giroderecha ();
_pRightCenterMotor->GetOdometerCounter ();
cout<<"Odometer"<<a<<endl;
}

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Re: getwheelodotops

Post by LR » Fri Oct 14, 2011 7:22 am

_pRightCenterMotor->RAZOdometerCounter ();
//Now the odo counter = 0

while(_pRightCenterMotor->GetOdometerCounter ()<107) //always true if your robot is stopped ...
{
giroderecha ();
_pRightCenterMotor->GetOdometerCounter ();
cout<<"Odometer"<<a<<endl;
}
LR

Post Reply